| MATLAB® | ![]() |
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).
Obtain a meta.property object from the meta.class Properties property, which contains a cell array of meta.property objects, one for each class property. For example:
mco = ?classname;
propcell = mco.Properties;
propcell{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 |
|---|---|
| Name read only | Name of the property. |
| Description read only | Currently not used |
| DetailedDescription read only | Currently not used |
| 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.
|
| GetAccess attribute, default = public | public – unrestricted access protected – access from class or derived classes private – access by class members only |
| SetAccess attribute, default = public | public – unrestricted access protected – access from class or derived classes private – access by class members only |
| 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. |
| Transient attribute, default = false | If true, property value is not saved when object is saved to a file. See Saving and Loading Objects for more about saving objects. |
| Hidden attribute, default = false | Determines whether the property should be shown in a property list (e.g., Property Inspector, call to properties, etc.). |
| 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 |
| 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 |
| GetMethod read only | Function handle of the get method associated with this property. Empty if there is no get method specified. See Property Get Method |
| 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 |
| DefiningClass | The meta.class object representing the class that defines this property. |
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.method, meta.event, metaclass
Properties — Storing Class Data
Obtaining Information About Classes with Meta-Classes
![]() | meta.package.getAllPackages | metaclass | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |