| Contents | Index |
The meta.property class provides information about the properties of MATLAB classes. The read/write properties of the meta.property class correspond to property attributes and are specified only from within your class definitions.
You can query the read-only properties of the meta.property object to obtain information that is specified syntactically by the class (for example, to obtain the function handle of a property's set access method).
You cannot instantiate a meta.property object directly. Obtain a meta.property object from the meta.class PropertList property, which contains an array of meta.property objects, one for each class property. For example, replace ClassName with the name of the class whose properties you want to query:
mco = ?ClassName;
plist = mco.PropertyList;
plist(1).Name; % name of first property
Use the metaclass function to obtain a meta.class object from a class instance:
mco = metaclass(obj);
| Property | Purpose |
|---|---|
| AbortSet attribute, default = false | If true, and this property belongs to a handle class, then MATLAB does not set the property value if the new value is the same as the current value. This prevents the triggering of property PreSet and PostSet events. |
| Abstract attribute, default = false | If true, the property has no implementation,
but a concrete subclass must redefine this property without Abstract being
set to true.
|
| Constant attribute, default = false | Set to true if you want only one value for this property in all instances of the class.
|
| DefaultValue | Property default value (if specified in class definition). See also HasDefault property. Abstract, dependent and dynamic properties cannot specify default values. |
| DefiningClass | The meta.class object representing the class that defines this property. |
| Dependent attribute, default = false | If false, property value is stored in object. If true, property value is not stored in object and the set and get functions cannot access the property by indexing into the object using the property name. |
| Description read only | Currently not used |
| DetailedDescription read only | Currently not used |
| GetAccess attribute, default = public | public – unrestricted access protected – access from class or subclasses private – access by class members only List classes that have get access to this property. Specify classes as meta.class objects in the form:
|
| GetMethod read only | Function handle of the get method associated with this property. Empty if there is no get method specified. See Get Method Syntax |
| GetObservable attribute, default = false | If true, and it is a handle class property, then listeners can be created for access to this property. The listeners are called whenever property values are queried. See Property-Set and Query Events |
| HasDefault | Property contains a boolean value indicating if the property defines a default value. Test HasDefault before querying the DefaultValue property to avoid a MATLAB:class:NoDefaultDefined error. |
| Hidden attribute, default = false | Determines whether the property should be shown in a property list (e.g., Property Inspector, call to properties, etc.). |
| Name read only | Name of the property. |
| SetAccess attribute, default = public | public – unrestricted access protected – access from class or subclasses private – access by class members only immutable — property can be set only in the constructor. See Mutable and Immutable Properties List classes that have set access to this property. Specify classes as meta.class objects in the form:
|
| SetMethod read only | Function handle of the set method associated with this property. Empty if there is no set method specified. See Property Set Methods |
| SetObservable attribute, default = false | If true, and it is a handle class property, then listeners can be created for access to this property. The listeners are called whenever property values are modified. See Property-Set and Query Events |
| Transient attribute, default = false | If true, property value is not saved when object is saved to a file. See Understanding the Save and Load Process for more about saving objects. |
See for information on using property events.
| Event Name | Purpose |
|---|---|
| PreGet | Event occurs just before property is queried. |
| PostGet | Event occurs just after property has been queried |
| PreSet | Event occurs just before this property is modified |
| PostSet | Event occurs just after this property has been modified |
meta.class | meta.event | meta.method | metaclass
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |