meta.property - meta.property class describes MATLAB class properties

Description

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);

Properties

PropertyPurpose
Name read only

Name of the property.

Description read only

Currently not used

DetailedDescription read only

Currently not used

Abstract attribute, default = falseIf true, the property has no implementation, but a concrete subclass must redefine this property without Abstract being set to true.
  • Abstract properties cannot define set or get access methods. See Controlling Property Access

  • Abstract properties cannot define initial values. Assigning an Initial Value

  • All subclasses must specify the same values as the superclass for the property SetAccess and GetAccess attributes.

  • Abstract=true should be used with the class attribute Sealed=false (the default).

constant attribute, default = false

Set to true if you want only one value for this property in all instances of the class.

  • Subclasses inherit constant properties, but cannot change them.

  • Constant properties cannot be Dependent

  • SetAccess is ignored.

See

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.

See Property Get Methods

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 = falseDetermines whether the property should be shown in a property list (e.g., Property Inspector, call to properties, etc.).
GetObservable attribute, default = falseIf 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 = falseIf 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 onlyFunction handle of the set method associated with this property. Empty if there is no set method specified. See Property Set Methods
DefiningClassThe meta.class object representing the class that defines this property.

Events

See for information on using property events.

Event NamePurpose
PreGetEvent occurs just before property is queried.
PostGetEvent occurs just after property has been queried
PreSetEvent occurs just before this property is modified
PostSetEvent occurs just after this property has been modified

See Also

meta.class, meta.method, meta.event, metaclass

Properties — Storing Class Data

Obtaining Information About Classes with Meta-Classes

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS