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

tv.amwa.maj.meta

## Interface MetaDefinition

- All Superinterfaces:
    MetadataObject, WeakReferenceTarget
  All Known Subinterfaces:
    ClassDefinition, PropertyDefinition, PropertyWrapperDefinition, TypeDefinition, TypeDefinitionCharacter, TypeDefinitionEnumeration, TypeDefinitionExtendibleEnumeration, TypeDefinitionFixedArray, TypeDefinitionIndirect, TypeDefinitionInteger, TypeDefinitionObjectReference, TypeDefinitionOpaque, TypeDefinitionRecord, TypeDefinitionRename, TypeDefinitionSet, TypeDefinitionStream, TypeDefinitionString, TypeDefinitionStrongObjectReference, TypeDefinitionVariableArray, TypeDefinitionWeakObjectReference
  All Known Implementing Classes:
    ClassDefinitionImpl, MetaDefinitionImpl, PropertyDefinitionImpl, PropertyWrapperDefinitionImpl, SingletonTypeDefinitionImpl, TypeDefinitionCharacterImpl, TypeDefinitionEnumerationImpl, TypeDefinitionExtendibleEnumerationImpl, TypeDefinitionFixedArrayImpl, TypeDefinitionImpl, TypeDefinitionIndirectImpl, TypeDefinitionIntegerImpl, TypeDefinitionObjectReferenceImpl, TypeDefinitionOpaqueImpl, TypeDefinitionRecordImpl, TypeDefinitionRenameImpl, TypeDefinitionSetImpl, TypeDefinitionStreamImpl, TypeDefinitionStringImpl, TypeDefinitionStrongObjectReferenceImpl, TypeDefinitionVariableArrayImpl, TypeDefinitionWeakObjectReferenceImpl

      public interface MetaDefinition
      extends MetadataObject, WeakReferenceTarget

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

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `appendMetadictXML(Node metadict, String namesapce, String prefix)` Append an XML representation of this meta definition to the given XML node.
    `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` | `getDescription()` Returns the description of this meta definition.
    `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.
    `int` | `hashCode()` Calculates a hash code value for this meta definition, which is calculated from its identity.
    `void` | `setAAFNamesInUse(boolean aafNames)` Set whether AAF-style names are in use for this meta definition.
    `void` | `setDescription(String description)` Sets the description of this meta definition.
    `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 interface tv.amwa.maj.industry.WeakReferenceTarget

      `getWeakTargetReference`

- - ### Method Detail

    - #### getAUID

          AUID getAUID()

      Returns the identification for this meta definition.

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

    - #### setName

          void setName(@AAFString
                       String name)
                throws NullPointerException

      Sets the name of this meta definition.

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

    - #### getName

          @AAFString
          String getName()

      Returns the name of this meta definition.

      Returns:
        Name of the meta definition.
      See Also:
        `getAAFNamesInUse()`, `setAAFNamesInUse(boolean)`

    - #### setDescription

          void setDescription(@AAFString
                              String description)

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

      Parameters:
        `description` - Description of this meta definition.

    - #### getDescription

          @AAFString
          String getDescription()
                                    throws PropertyNotPresentException

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

      Returns:
        Description of this meta definition.
      Throws:
        `PropertyNotPresentException` - The optional description property is not present in this meta definition.

    - #### getNamespace

          String getNamespace()

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

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

    - #### setNamespace

          void setNamespace(String namespace)

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

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

    - #### getAliases

          String[] getAliases()

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

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

    - #### getPrefix

          String getPrefix()

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

      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

          void setPrefix(String prefix)

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

      See Also:
        `MediaProperty.prefix()`, `MediaClass.prefix()`

    - #### getSymbol

          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.

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

    - #### setSymbol

          void setSymbol(String symbol)
                  throws NullPointerException

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

      Throws:
        `NullPointerException` - Cannot set the symbol of a meta definition to `null`.
      See Also:
        `MediaProperty.symbol()`, `MediaClass.symbol()`

    - #### getAAFNamesInUse

          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. 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 `setName(String)` always match.

      Returns:
        Are AAF-style names in use?
      See Also:
        `setAAFNamesInUse(boolean)`, `getName()`, `setName(String)`

    - #### setAAFNamesInUse

          void setAAFNamesInUse(boolean aafNames)

      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 `getName()` and `setName(String)` always match.

      Parameters:
        `aafNames` - Set whether AAF-style names are in use.
      See Also:
        `getAAFNamesInUse()`, `getName()`, `setName(String)`

    - #### equals

          boolean equals(Object o)

      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.

      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:
        `deepEquals(Object)`, `Object.equals(Object)`

    - #### deepEquals

          boolean deepEquals(Object o)

      Determines whether this definition is equal to the given object by comparing each property. The `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.

      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:
        `equals(Object)`

    - #### hashCode

          int hashCode()

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

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

    - #### toString

          String toString()

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

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

    - #### appendMetadictXML

          void appendMetadictXML(Node metadict,
                                 String namesapce,
                                 String prefix)

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

      Parameters:
        `metadict` - Meta dictionary node to append a description of this node to.
      See Also:
        `CommonConstants.AAF_METADICT_NAMESPACE`

    - #### clone

          MetaDefinition clone()

      Create a cloned copy of this meta definition.

      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.