MATLAB Object-Oriented Programming

(Joyce) #1

Class Metadata


In this section...
“What Is Class Metadata?” on page 16-2
“The meta Package” on page 16-3
“Metaclass Objects” on page 16-3
“Metaclass Object Lifecycle” on page 16-4

What Is Class Metadata?


Class metadata is information about class definitions that is available from various
metaclasses objects. Use metaclass objects to obtain information without having to create
instances of the class. Metadata enables the programmatic inspection of classes. Each
metaclass has properties, methods, and events that contain information about the class or
class component it describes.

All class components have an associated metaclass, which you access from the
meta.class object. For example, create the meta.class object for the
matlab.mixin.Copyable class:

mc = ?matlab.mixin.Copyable

mc =
class with properties:
Name: 'matlab.mixin.Copyable'
Description: 'Implement copy method for handle objects in MA...'
DetailedDescription: ''
Hidden: 0
Sealed: 0
Abstract: 1
Enumeration: 0
ConstructOnLoad: 1
HandleCompatible: 1
InferiorClasses: {0x1 cell}
ContainingPackage: [1x1 meta.package]
PropertyList: [0x1 meta.property]
MethodList: [19x1 meta.method]
EventList: [1x1 meta.event]
EnumerationMemberList: [0x1 meta.EnumeratedValue]
SuperclassList: [1x1 meta.class]

16 Information from Class Metadata

Free download pdf