Property Attributes

Table of Property Attributes

All properties support the attributes listed in the following table. Attributes enable you to modify the behavior of properties. Attribute values apply to all properties defined within the properties block that specifies the nondefault values.

Attribute Name

Class

Description

AbortSet

logical

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

logical

default = false

If 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. See 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).

Access

char

default = public

public – unrestricted access

protected – access from class or derived classes

private – access by class members only

Use Access to set both SetAccess and GetAccess to the same value. Query the values of SetAccess and GetAccess directly (not Access).

Constant

logical

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 for more information.

Dependent

logical

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 Dependent Properties, Property Get Methods, Avoiding Property Initialization Order Dependency

GetAccess

enumeration

default = public

public — unrestricted access

protected — access from class or derived classes

private — access by class members only

GetObservable

logical

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

Hidden

logical

default = false

Determines whether the property should be shown in a property list (e.g., Property Inspector, call to set or get, etc.).

SetAccess

enumeration

default = public

public — unrestricted access

protected — access from class or derived classes

private — access by class members only

SetObservable

logical

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

logical

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.

  


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