Products & Services Solutions Academia Support User Community Company

Learn more about MATLAB   

meta.DynamicProperty - meta.DynamicProperty class describes dynamic property of MATLAB object

Description

The meta.DynamicProperty class contains descriptive information about dynamic properties that you have added to an instance of a MATLAB classes. The MATLAB class must be a subclass of dynamicprops. The properties of the meta.DynamicProperty class correspond to property attributes that you specify from within class definitions. Dynamic properties are not defined in classdef blocks, but you can set their attributes by setting the meta.DynamicProperty object properties.

You add a dynamic property to an object using the addprop method of the dynamicprops class. The addprop method returns a meta.DynamicProperty instance representing the new dynamic property. You can modify the properties of the meta.DynamicProperty object to set the attributes of the dynamic property or to add set and get access methods, which would be defined in the classdef for regular properties.

You cannot instantiate the meta.DynamicProperty class. You must use addprop to obtain a meta.DynamicProperty object.

To remove the dynamic property, call the delete handle class method on the meta.DynamicProperty object.

Obtain a meta.DynamicProperty object from the addprops method, which returns an array of meta.DynamicProperty objects, one for each dynamic property.

See Dynamic Properties — Adding Properties to an Instance for more information.

Properties

PropertyPurpose
Name

Name of the property.

Description

Can contain text

DetailedDescription

Can contain text

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 a Default 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 Defining Named Constants

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 The Save and Load Process 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
GetMethodFunction handle of the get method associated with this property. Empty if there is no get method specified. See Property Get Method
SetMethodFunction 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 Listening for Changes to Property Values 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
ObjectBeingDestroyedInherited from handle

See Also

addprop, handle

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

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