MetaDefinitionImpl (Media Authoring with Java API)
Date: 2016-02-05

tv.amwa.maj.meta.impl

## Class MetaDefinitionImpl

- java.lang.Object
- - tv.amwa.maj.meta.impl.MetaDefinitionImpl

- All Implemented Interfaces:
    Serializable, Cloneable, CommonConstants, MetadataObject, WeakReferenceTarget, MetaDefinition, DefinitionType
  Direct Known Subclasses:
    ClassDefinitionImpl, PropertyDefinitionImpl, TypeDefinitionImpl

      @MediaClass(uuid1=218169601,
                  uuid2=548,
                  uuid3=0,
                  uuid4={6,14,43,52,2,6,1,1},
                  definedName="MetaDefinition",
                  description="The MetaDefinition class is an abstract class that defines a class, type, or property in an AAF file.",
                  symbol="MetaDefinition",
                  namespace="http://www.smpte-ra.org/schemas/2001-2/2007/aaf",
                  prefix="aaf")
      public abstract class MetaDefinitionImpl
      extends Object
      implements MetaDefinition, DefinitionType, WeakReferenceTarget, Serializable, CommonConstants, Cloneable

  Implements the definition of a class, type, or property in an AAF file.

  Extension of the meta model with external classes is not encouraged. The metamodel can be used to describe extensions in the main AAF object model. Therefore, the registration of classes is restricted to this package only.

  See Also:
    Serialized Form

- - ### Field Summary

    - ### Fields inherited from interface tv.amwa.maj.constant.CommonConstants

      `AAF_METADICT_NAMESPACE, AAF_METADICT_PREFIX, AAF_XML_NAMESPACE, AAF_XML_PREFIX, ApplicationPluginObjectID, ApplicationPluginsID, MAX_NUM_RGBA_COMPS, MemberOfID, ObjectClassID, ParentClassID, PropertiesID, XMLClassIDAsAttributeName`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MetaDefinitionImpl()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `aafNameToName(String name)`
    `void` | `appendMetadictXML(Node metadict, String namespace, String prefix)` Append an XML representation of this meta definition to the given XML node.
    `void` | `appendXMLChildren(Node parent)`
    `MetaDefinition` | `clone()` Create a cloned copy of this meta definition.
    `boolean` | `deepEquals(Object o)` Determines whether this definition is equal to the given object by comparing each property.
    `boolean` | `equals(Object o)` Determines whether this meta definition is equal to the given meta definition by comparing identifiers.
    `boolean` | `getAAFNamesInUse()` Are AAF-style names are in use for this meta definition? The default is `false` that is to use pass through names that match those defined in the meta dictionary.
    `String[]` | `getAliases()` Returns alternative names for the subject of this meta definition.
    `AUID` | `getAUID()` Returns the identification for this meta definition.
    `String` | `getComment()`
    `String` | `getDescription()` Returns the description of this meta definition.
    `AUID` | `getIdentification()`
    `String` | `getName()` Returns the name of this meta definition.
    `String` | `getNamespace()` Returns the namespace in which the subject of this meta definition is defined.
    `String` | `getPrefix()` Returns the namespace prefix to use when serializing a value of the subject of this meta definition to XML.
    `String` | `getSymbol()` Returns the symbol used when serializing a value of the subject of this meta definition, such as its XML element or attribute name.
    `String` | `getWeakTargetReference()` Provides a name that can be used to make a weak object reference to an instance of the implementing class.
    `int` | `hashCode()` Calculates a hash code value for this meta definition, which is calculated from its identity.
    `static AUID` | `initializeMetaDefinitionIdentification()`
    `static String` | `initializeMetaDefinitionName()`
    `String` | `nameToAAFName(String name)`
    `void` | `setAAFNamesInUse(boolean aafNamesInUse)` Set whether AAF-style names are in use for this meta definition.
    `void` | `setAliases(String[] aliases)`
    `void` | `setDescription(String description)` Sets the description of this meta definition.
    `void` | `setIdentification(AUID identification)`
    `void` | `setName(String name)` Sets the name of this meta definition.
    `void` | `setNamespace(String namespace)` Sets the namespace in which the subject of this meta definition is defined.
    `void` | `setPrefix(String prefix)` Sets the namespace prefix to use when serializing a value of the subject of this meta definition to XML.
    `void` | `setSymbol(String symbol)` Sets the symbol used when serializing a value of the subject of this meta definition, such as its XML element or attribute name.
    `String` | `toString()` Creates a string representation of this meta definition.

    - ### Methods inherited from class java.lang.Object

      `getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### MetaDefinitionImpl

          public MetaDefinitionImpl()

  - ### Method Detail

    - #### getAUID

          @MediaProperty(uuid1=100729095,
                         uuid2=4864,
                         uuid3=0,
                         uuid4={6,14,43,52,1,1,1,2},
                         definedName="MetaDefinitionIdentification",
                         aliases={"Identification","AUID"},
                         typeName="AUID",
                         optional=false,
                         uniqueIdentifier=true,
                         pid=5,
                         symbol="MetaDefinitionIdentification")
          public final AUID getAUID()

      Description copied from interface: `MetaDefinition`

      Returns the identification for this meta definition.

      Specified by:
        `getAUID` in interface `WeakReferenceTarget`
      Specified by:
        `getAUID` in interface `MetaDefinition`
      Specified by:
        `getAUID` in interface `DefinitionType`
      Returns:
        Identification for this meta definition.

    - #### getIdentification

          public AUID getIdentification()

    - #### initializeMetaDefinitionIdentification

          public static final AUID initializeMetaDefinitionIdentification()

    - #### setIdentification

          @MediaPropertySetter(value="MetaDefinitionIdentification")
          public final void setIdentification(AUID identification)
                                                                                                  throws NullPointerException

      Throws:
        `NullPointerException`

    - #### getDescription

          @MediaProperty(uuid1=100729095,
                         uuid2=5121,
                         uuid3=0,
                         uuid4={6,14,43,52,1,1,1,2},
                         definedName="MetaDefinitionDescription",
                         aliases="Description",
                         typeName="UTF16String",
                         optional=true,
                         uniqueIdentifier=false,
                         pid=7,
                         symbol="MetaDefinitionDescription")
          public final String getDescription()
                                                                                                                                                                                                                                                                                                                                                                                                                                                       throws PropertyNotPresentException

      Description copied from interface: `MetaDefinition`

      Returns the description of this meta definition. This is an optional property.

      Specified by:
        `getDescription` in interface `MetaDefinition`
      Specified by:
        `getDescription` in interface `DefinitionType`
      Returns:
        Description of this meta definition.
      Throws:
        `PropertyNotPresentException` - The optional description property is not present in this meta definition.

    - #### setDescription

          @MediaPropertySetter(value="MetaDefinitionDescription")
          public final void setDescription(String description)

      Description copied from interface: `MetaDefinition`

      Sets the description of this meta definition. Set this optional property to `null` to omit it.

      Specified by:
        `setDescription` in interface `MetaDefinition`
      Parameters:
        `description` - Description of this meta definition.

    - #### getName

          @MediaProperty(uuid1=50463745,
                         uuid2=513,
                         uuid3=0,
                         uuid4={6,14,43,52,1,1,1,2},
                         definedName="MetaDefinitionName",
                         aliases="Name",
                         typeName="UTF16String",
                         optional=false,
                         uniqueIdentifier=false,
                         pid=6,
                         symbol="MetaDefinitionName")
          public final String getName()

      Description copied from interface: `MetaDefinition`

      Returns the name of this meta definition.

      Specified by:
        `getName` in interface `MetaDefinition`
      Specified by:
        `getName` in interface `DefinitionType`
      Returns:
        Name of the meta definition.
      See Also:
        `MetaDefinition.getAAFNamesInUse()`, `MetaDefinition.setAAFNamesInUse(boolean)`

    - #### setName

          @MediaPropertySetter(value="MetaDefinitionName")
          public final void setName(String name)
                                                                              throws NullPointerException

      Description copied from interface: `MetaDefinition`

      Sets the name of this meta definition.

      Specified by:
        `setName` in interface `MetaDefinition`
      Parameters:
        `name` - Name to set for this meta definition.
      Throws:
        `NullPointerException` - The given meta definition name is `null`.
      See Also:
        `MetaDefinition.getAAFNamesInUse()`, `MetaDefinition.setAAFNamesInUse(boolean)`

    - #### initializeMetaDefinitionName

          public static final String initializeMetaDefinitionName()

    - #### equals

          public final boolean equals(Object o)

      Description copied from interface: `MetaDefinition`

      Determines whether this meta definition is equal to the given meta definition by comparing identifiers. Identities are only compared if the given object is not `null` and implements this interface.

      Specified by:
        `equals` in interface `MetaDefinition`
      Overrides:
        `equals` in class `Object`
      Parameters:
        `o` - Object to check equality against.
      Returns:
        Is this meta definition is equal to the given meta definition by identification?
      See Also:
        `MetaDefinition.deepEquals(Object)`, `Object.equals(Object)`

    - #### deepEquals

          public boolean deepEquals(Object o)

      Description copied from interface: `MetaDefinition`

      Determines whether this definition is equal to the given object by comparing each property. The `MetaDefinition.equals(Object)` method only checks that the identities of two definitions are equal, relying on the uniqueness ensured by identity registration. This method is provided for debugging and validation purposes.

      Specified by:
        `deepEquals` in interface `MetaDefinition`
      Parameters:
        `o` - Object to compare to this meta definition.
      Returns:
        Is the given object a meta definition with all of its properties equal to this meta definition?
      See Also:
        `MetaDefinition.equals(Object)`

    - #### hashCode

          public final int hashCode()

      Description copied from interface: `MetaDefinition`

      Calculates a hash code value for this meta definition, which is calculated from its identity.

      Specified by:
        `hashCode` in interface `MetaDefinition`
      Overrides:
        `hashCode` in class `Object`
      Returns:
        Hash code value for this meta definition
      See Also:
        `Object.hashCode()`

    - #### toString

          public String toString()

      Description copied from interface: `MetaDefinition`

      Creates a string representation of this meta definition. In the MAJ API, the string representation is an XML representation that should validate against SMPTE Reg-XML (SMPTE 2001).

      Specified by:
        `toString` in interface `MetaDefinition`
      Overrides:
        `toString` in class `Object`
      Returns:
        String representation of this meta definition.
      See Also:
        `Object.toString()`, `Object.toString()`

    - #### appendXMLChildren

          public void appendXMLChildren(Node parent)

    - #### getComment

          public String getComment()

    - #### getSymbol

          public String getSymbol()

      Description copied from interface: `MetaDefinition`

      Returns the symbol used when serializing a value of the subject of this meta definition, such as its XML element or attribute name.

      Specified by:
        `getSymbol` in interface `MetaDefinition`
      Returns:
        Symbol used when serializing a value of the subject of this meta definition.
      See Also:
        `MediaProperty.symbol()`, `MediaClass.symbol()`, `Utilities.makeSymbol(String)`

    - #### setSymbol

          public void setSymbol(String symbol)
                         throws NullPointerException

      Description copied from interface: `MetaDefinition`

      Sets the symbol used when serializing a value of the subject of this meta definition, such as its XML element or attribute name.

      Specified by:
        `setSymbol` in interface `MetaDefinition`
      Throws:
        `NullPointerException` - Cannot set the symbol of a meta definition to `null`.
      See Also:
        `MediaProperty.symbol()`, `MediaClass.symbol()`

    - #### getWeakTargetReference

          public String getWeakTargetReference()

      Description copied from interface: `WeakReferenceTarget`

      Provides a name that can be used to make a weak object reference to an instance of the implementing class.

      Specified by:
        `getWeakTargetReference` in interface `WeakReferenceTarget`
      Returns:
        A name to use to make weak reference to this object.

    - #### getNamespace

          public String getNamespace()

      Description copied from interface: `MetaDefinition`

      Returns the namespace in which the subject of this meta definition is defined.

      Specified by:
        `getNamespace` in interface `MetaDefinition`
      Returns:
        Namespace in which the subject of this meta definition is defined.
      See Also:
        `MediaProperty.namespace()`, `MediaClass.namespace()`, `ExtensionScheme.getSchemeURI()`

    - #### setNamespace

          public void setNamespace(String namespace)

      Description copied from interface: `MetaDefinition`

      Sets the namespace in which the subject of this meta definition is defined.

      Specified by:
        `setNamespace` in interface `MetaDefinition`
      Parameters:
        `namespace` - Namespace in which the subject of this meta definition is defined.
      See Also:
        `MediaProperty.namespace()`, `MediaClass.namespace()`

    - #### getPrefix

          public String getPrefix()

      Description copied from interface: `MetaDefinition`

      Returns the namespace prefix to use when serializing a value of the subject of this meta definition to XML.

      Specified by:
        `getPrefix` in interface `MetaDefinition`
      Returns:
        Namespace prefix to use when serializing a value of the subject of this meta definition to XML.
      See Also:
        `MediaProperty.prefix()`, `MediaClass.prefix()`

    - #### setPrefix

          public void setPrefix(String prefix)

      Description copied from interface: `MetaDefinition`

      Sets the namespace prefix to use when serializing a value of the subject of this meta definition to XML.

      Specified by:
        `setPrefix` in interface `MetaDefinition`
      See Also:
        `MediaProperty.prefix()`, `MediaClass.prefix()`

    - #### setAliases

          public void setAliases(String[] aliases)

    - #### getAliases

          public String[] getAliases()

      Description copied from interface: `MetaDefinition`

      Returns alternative names for the subject of this meta definition. These names are alternative names to the defined name for the definition.

      Specified by:
        `getAliases` in interface `MetaDefinition`
      Returns:
        Alternative names for the subject defined by this meta definition.
      See Also:
        `MediaProperty.aliases()`, `MediaClass.aliases()`

    - #### getAAFNamesInUse

          public boolean getAAFNamesInUse()

      Description copied from interface: `MetaDefinition`

      Are AAF-style names are in use for this meta definition? The default is `false` that is to use pass through names that match those defined in the meta dictionary. AAF names have slightly different values, for example:

      - `aafInt32` instead of `Int32`;
      - `kAAFTypeID_LocatorStrongReference` instead of `LocatorStrongReference`.

      These names are useful when writing meta dictionaries into AAF files. The internal mappings inside the class deal with mapping to and from the different names so that @link #getName()} and `MetaDefinition.setName(String)` always match.

      Specified by:
        `getAAFNamesInUse` in interface `MetaDefinition`
      Returns:
        Are AAF-style names in use?
      See Also:
        `MetaDefinition.setAAFNamesInUse(boolean)`, `MetaDefinition.getName()`, `MetaDefinition.setName(String)`

    - #### setAAFNamesInUse

          public void setAAFNamesInUse(boolean aafNamesInUse)

      Description copied from interface: `MetaDefinition`

      Set whether AAF-style names are in use for this meta definition. The default is `false` that is to use pass through names that match those defined in the meta dictionary. AAF names have slightly different values, for example:

      - `aafInt32` instead of `Int32`;
      - `kAAFTypeID_LocatorStrongReference` instead of `LocatorStrongReference`.

      These names are useful when writing meta dictionaries into AAF files. The internal mappings inside the class deal with mapping to and from the different names so that `MetaDefinition.getName()` and `MetaDefinition.setName(String)` always match.

      Specified by:
        `setAAFNamesInUse` in interface `MetaDefinition`
      Parameters:
        `aafNamesInUse` - Set whether AAF-style names are in use.
      See Also:
        `MetaDefinition.getAAFNamesInUse()`, `MetaDefinition.getName()`, `MetaDefinition.setName(String)`

    - #### nameToAAFName

          public String nameToAAFName(String name)

    - #### aafNameToName

          public String aafNameToName(String name)

    - #### appendMetadictXML

          public void appendMetadictXML(Node metadict,
                                        String namespace,
                                        String prefix)

      Description copied from interface: `MetaDefinition`

      Append an XML representation of this meta definition to the given XML node.

      Specified by:
        `appendMetadictXML` in interface `MetaDefinition`
      Parameters:
        `metadict` - Meta dictionary node to append a description of this node to.
      See Also:
        `CommonConstants.AAF_METADICT_NAMESPACE`

    - #### clone

          public MetaDefinition clone()

      Description copied from interface: `MetaDefinition`

      Create a cloned copy of this meta definition.

      Specified by:
        `clone` in interface `MetaDefinition`
      Overrides:
        `clone` in class `Object`
      Returns:
        Cloned copy of this meta definition.

(c)2007-2016 Richard Cartwright, all rights reserved. Licensed under Apache 2 license and subject to the AMWA IPR policy.