类自检和元数据
从类的元数据中获取有关类的详细信息
元数据可提供有关类定义的信息。查找有关类定义的所有属性、方法以及事件的信息,而不构造类的对象。
函数
metaclass | 获取 matlab.metadata.Class 对象 |
matlab.metadata.abstractDetails | Find abstract methods and properties |
matlab.metadata.Class.fromName | Return matlab.metadata.Class object that describes named
class |
matlab.metadata.Namespace.fromName | Return matlab.metadata.Namespace object for specified
namespace |
matlab.metadata.Namespace.getAllNamespaces | Get all top-level namespaces |
properties | 类属性名称 |
methods | 类方法名称 |
ismethod | 确定对象是否具有指定的方法 |
events | 事件名称 |
superclasses | 超类的名称 |
类
matlab.metadata.Class | Describe MATLAB class |
matlab.metadata.Property | Describe property of MATLAB class |
matlab.metadata.Method | Describe MATLAB class method |
matlab.metadata.Event | Describe event defined by MATLAB class |
matlab.metadata.Namespace | Describe MATLAB namespace |
matlab.metadata.DynamicProperty | Describe dynamic property of MATLAB object |
matlab.metadata.EnumerationMember | Describe enumeration member of MATLAB class |
matlab.metadata.MetaData | Root of metadata class hierarchy |
matlab.metadata.ArrayDimension | Size information for property validation |
matlab.metadata.Validation | Describes property validation |
matlab.metadata.FixedDimension | Fixed dimension in property size specification |
matlab.metadata.UnrestrictedDimension | Unrestricted dimension in property size specification |
主题
- Class Metadata
Metaclasses provide a way to inspect class definitions programmatically.
- Class Introspection with Metadata
Inspect class member definitions using metadata.
- Find Objects with Specific Values
Metaclasses support methods that enable you to search for objects with properties set to specific values.
- Get Information About Properties
Use
matlab.metadata.Property
objects to find detailed information about object properties. - Find Default Values in Property Metadata
Use property metadata to find default values assigned to properties in the class definition.