PlistEdit Pro > Help > How structure definitions work

How structure definitions work

A property list structure definition is made up mainly of a list of property list classes. Each class describes a particular kind of property list object and how it should be displayed when editing. Every structure definition has a special class named “root”, which specifies what the root object of the property list should look like, what keys it supports, and so forth. The root class then determines what classes should be used for its children. The children’s classes in turn specify what class should be used for their children, and so on down the hierarchy. When using a structure definition, you’ll notice that for many items, instead of the basic types like “Array”, “Boolean”, etc., you will instead see the name of the class that has been assigned to that item by the definition

In the example above, the Info.plist structure definition’s root class specifies that the object under the “Document types” key should be assigned the “DocumentTypeArray” class. The “DocumentTypeArray” class specifies that all its children should be assigned the “DocumentTypeDict” class, and then the “DocumentTypeDict” class specifies what should be used for its various child keys.

The most important piece of information for a class is what basic type should be used for property list objects that are assigned that clas. This can be one of the seven basic property list types: Array, Boolean, Data, Date, Dictionary, Number or String, as well as a Variant Dictionary type that will be explained a little later. The “root” class is typically a dictionary, though it can sometimes be an array as well. Depending on what type of object a class represents, the class will have different attributes that specify how that type of object should be treated when viewing and editing it. Note that currently, there is no way for one class to “subclass” another and inherit its properties.

<< Using a structure definition when editing a property list
Creating a structure definition >>