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

tv.amwa.maj.meta.impl

## Class MetaDictionaryImpl

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

- All Implemented Interfaces:
    Serializable, Cloneable, MetadataObject, MetaDictionary

      @MediaClass(definedName="MetaDictionary",
                  uuid1=218169601,
                  uuid2=549,
                  uuid3=0,
                  uuid4={6,14,43,52,2,6,1,1},
                  description="The meta dictionary class is deprecated and replaced by extension schemes and the baseline dictionary.",
                  symbol="MetaDictionary",
                  namespace="http://www.smpte-ra.org/schemas/2001-2/2007/aaf",
                  prefix="aaf")
      public class MetaDictionaryImpl
      extends Object
      implements MetaDictionary, MetadataObject, Cloneable, Serializable

  Contains definitions of meta classes and types.

  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `MetaDictionaryImpl()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `MetaDictionary` | `clone()` Create a cloned copy of this meta dictionary.
    `int` | `countClassDefinitions()` Returns the number of class definitions contained in this dictionary.
    `int` | `countOpaqueTypeDefinitions()` Returns the number of opaque type definitions in the dictionary.
    `int` | `countTypeDefinitions()` Returns the number of type definitions contained in the dictionary.
    `void` | `createForwardClassReference(AUID classId)` Creates a forward class reference that is used to allow a class definition to be referenced before it has had its full definition stored into this dictionary.
    `InterchangeObject` | `createInstance(AUID identification)` Deprecated.
    `MetaDefinition` | `createMetaInstance(AUID identification)` Deprecated.
    `boolean` | `equals(Object o)`
    `Set<? extends ClassDefinition>` | `getClassDefinitions()` Returns the set of all class definitions in this dictionary.
    `boolean` | `getIsDynamic()` Is this meta dictionary dynamic? A dynamic meta dictionary represents only the meta definitions required to represent a given preface at a specific point in time.
    `Set<? extends TypeDefinition>` | `getOpaqueTypeDefinitions()` Return the set of all registered opaque type definitions in the dictionary.
    `Set<? extends TypeDefinition>` | `getTypeDefinitions()` Returns the set of all type definitions contained within this dictionary.
    `boolean` | `hasForwardClassReference(AUID classId)` Returns `true` if the given class identification is a forward reference registered with this dictionary.
    `int` | `hashCode()`
    `ClassDefinition` | `lookupClassDefinition(AUID identification)` Returns the class definition with the given identifier that is contained in this dictionary.
    `TypeDefinition` | `lookupOpaqueTypeDefinition(AUID typeId)` Return the opaque type definition with the given id.
    `TypeDefinition` | `lookupTypeDefinition(AUID identification)` Return the type definition with the given identifier that is contained within this dictionary.
    `void` | `makeDynamic(Preface preface)` Turn this meta dictionary from static to dynamic and/or update the meta definitions to represent those required to represent the given preface.
    `void` | `makeStatic()` Turn this meta dictionary into a static meta dictionary, which is the default state.
    `void` | `registerClassDefinition(ClassDefinition classDefinition)` Add a class definition to those contained in this dictionary.
    `void` | `registerOpaqueTypeDefinition(TypeDefinition typeDef)` Add the opaque type definition to the dictionary.
    `void` | `registerTypeDefinition(TypeDefinition typeDefinition)` Add a type definition to those contained in this dictionary.
    `String` | `toString()`

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

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

- - ### Constructor Detail

    - #### MetaDictionaryImpl

          public MetaDictionaryImpl()

  - ### Method Detail

    - #### countClassDefinitions

          public int countClassDefinitions()

      Description copied from interface: `MetaDictionary`

      Returns the number of class definitions contained in this dictionary.

      Specified by:
        `countClassDefinitions` in interface `MetaDictionary`
      Returns:
        Number of class definitions contained in this dictionary.

    - #### countOpaqueTypeDefinitions

          public int countOpaqueTypeDefinitions()

      Description copied from interface: `MetaDictionary`

      Returns the number of opaque type definitions in the dictionary.

      Specified by:
        `countOpaqueTypeDefinitions` in interface `MetaDictionary`
      Returns:
        Number of opaque type definitions.

    - #### countTypeDefinitions

          public int countTypeDefinitions()

      Description copied from interface: `MetaDictionary`

      Returns the number of type definitions contained in the dictionary.

      Specified by:
        `countTypeDefinitions` in interface `MetaDictionary`
      Returns:
        Number of type definitions in this dictionary.

    - #### createForwardClassReference

          public void createForwardClassReference(AUID classId)
                                           throws InvalidParameterException

      Description copied from interface: `MetaDictionary`

      Creates a forward class reference that is used to allow a class definition to be referenced before it has had its full definition stored into this dictionary.

      Specified by:
        `createForwardClassReference` in interface `MetaDictionary`
      Parameters:
        `classId` - Unique class identifier for the forward reference.
      Throws:
        `InvalidParameterException` - The given ID represents an existing forward class reference or a class definition that has already been successfully registered.

    - #### createInstance

          @Deprecated
          public InterchangeObject createInstance(AUID identification)
                                                       throws NullPointerException,
                                                              IllegalArgumentException

      Deprecated.
      Description copied from interface: `MetaDictionary`

      Creates a single uninitialized AAF object of the class associated with a specified interchange object class identifier.

      This method is a factory for creating objects found within the body of an AAF file. In MAJ, the equivalent functionality is provided through the factory provided on the media engine.

      Specified by:
        `createInstance` in interface `MetaDictionary`
      Parameters:
        `identification` - Class identifier (id) of the stored object. This is the corresponding SMPTE identifier (as a GUID) for all predefined built-in classes or registered extension classes.
      Returns:
        Object that is an instance of the specified class and implements the interchange object interface.
      Throws:
        `NullPointerException` - Cannot create an instance from a `null` value.
        `IllegalArgumentException` - The given identifier is not known or is not for an object of interchange type.

    - #### createMetaInstance

          @Deprecated
          public MetaDefinition createMetaInstance(AUID identification)
                                                        throws NullPointerException,
                                                               IllegalArgumentException

      Deprecated.
      Description copied from interface: `MetaDictionary`

      Creates a single uninitialized AAF meta definition (class or type) associated with a specified class identifier.

      This method is a factory for creating objects used to describe the meta dictionary of an AAF file. In MAJ, the equivalent functionality is provided through the factory provided on the media engine.

      Specified by:
        `createMetaInstance` in interface `MetaDictionary`
      Parameters:
        `identification` - Identifier (id) of a class or type definition. This is the corresponding SMPTE identifier (as a GUID) for all predefined built-in definitions or registered extensions.
      Returns:
        Instantiated metaclass.
      Throws:
        `NullPointerException` - Cannot create a meta instance for a `null` value.
        `IllegalArgumentException` - The given identifier is not known or is not for a meta definition.

    - #### getClassDefinitions

          @MediaProperty(definedName="ClassDefinitions",
                         uuid1=100729095,
                         uuid2=1792,
                         uuid3=0,
                         uuid4={6,14,43,52,1,1,1,2},
                         symbol="ClassDefinitions",
                         typeName="ClassDefinitionStrongReferenceSet",
                         optional=true,
                         uniqueIdentifier=false,
                         pid=3)
          public Set<? extends ClassDefinition> getClassDefinitions()

      Description copied from interface: `MetaDictionary`

      Returns the set of all class definitions in this dictionary.

      Specified by:
        `getClassDefinitions` in interface `MetaDictionary`
      Returns:
        Shallow copy of the set of all class definitions contained in this dictionary.

    - #### getOpaqueTypeDefinitions

          public Set<? extends TypeDefinition> getOpaqueTypeDefinitions()

      Description copied from interface: `MetaDictionary`

      Return the set of all registered opaque type definitions in the dictionary.

      Specified by:
        `getOpaqueTypeDefinitions` in interface `MetaDictionary`
      Returns:
        Iterator over the set of all registered opaque type definitions.

    - #### getTypeDefinitions

          @MediaProperty(definedName="TypeDefinitions",
                         uuid1=100729095,
                         uuid2=2048,
                         uuid3=0,
                         uuid4={6,14,43,52,1,1,1,2},
                         symbol="TypeDefinitions",
                         typeName="TypeDefinitionStrongReferenceSet",
                         optional=true,
                         uniqueIdentifier=false,
                         pid=4)
          public Set<? extends TypeDefinition> getTypeDefinitions()

      Description copied from interface: `MetaDictionary`

      Returns the set of all type definitions contained within this dictionary.

      Specified by:
        `getTypeDefinitions` in interface `MetaDictionary`
      Returns:
        Shallow copy of the set of type definitions contained in this dictionary.

    - #### hasForwardClassReference

          public boolean hasForwardClassReference(AUID classId)
                                           throws InvalidParameterException

      Description copied from interface: `MetaDictionary`

      Returns `true` if the given class identification is a forward reference registered with this dictionary.

      Specified by:
        `hasForwardClassReference` in interface `MetaDictionary`
      Parameters:
        `classId` - Unique class identifier.
      Returns:
        Has the class got a forward reference in this dictionary?
      Throws:
        `InvalidParameterException` - The given ID is not recognized as a class definition id.

    - #### lookupClassDefinition

          public ClassDefinition lookupClassDefinition(AUID identification)
                                                throws NullPointerException,
                                                       InvalidParameterException

      Description copied from interface: `MetaDictionary`

      Returns the class definition with the given identifier that is contained in this dictionary.

      Specified by:
        `lookupClassDefinition` in interface `MetaDictionary`
      Parameters:
        `identification` - Unique identifier for a class contained in this dictionary.
      Returns:
        Class definition with the given identification that is contained in this dictionary.
      Throws:
        `NullPointerException` - Argument is null.
        `InvalidParameterException` - The given class identifier does not match a class definition stored in this dictionary.
      See Also:
        `Warehouse.lookForClass(Class)`, `MediaClass`

    - #### lookupOpaqueTypeDefinition

          public TypeDefinition lookupOpaqueTypeDefinition(AUID typeId)
                                                    throws NullPointerException,
                                                           InvalidParameterException

      Description copied from interface: `MetaDictionary`

      Return the opaque type definition with the given id.

      Specified by:
        `lookupOpaqueTypeDefinition` in interface `MetaDictionary`
      Parameters:
        `typeId` - Unique type ID.
      Returns:
        Corresponding type definition.
      Throws:
        `NullPointerException` - Argument is null.
        `InvalidParameterException` - The given ID is not recognized as a type definition ID.

    - #### lookupTypeDefinition

          public TypeDefinition lookupTypeDefinition(AUID identification)
                                              throws NullPointerException,
                                                     InvalidParameterException

      Description copied from interface: `MetaDictionary`

      Return the type definition with the given identifier that is contained within this dictionary.

      Specified by:
        `lookupTypeDefinition` in interface `MetaDictionary`
      Parameters:
        `identification` - Unique identifier for the type definition contained in this dictionary.
      Returns:
        Type definition in this dictionary with the given type id.
      Throws:
        `NullPointerException` - The given type identifier is `null`.
        `InvalidParameterException` - The given identifier does not match that of a type definition contained in this dictionary.

    - #### registerClassDefinition

          public void registerClassDefinition(ClassDefinition classDefinition)
                                       throws NullPointerException,
                                              InvalidParameterException

      Description copied from interface: `MetaDictionary`

      Add a class definition to those contained in this dictionary.

      Specified by:
        `registerClassDefinition` in interface `MetaDictionary`
      Parameters:
        `classDefinition` - Class definition to add.
      Throws:
        `NullPointerException` - The given class definition is `null`.
        `InvalidParameterException` - A class definition with the same identifier is already contained in this dictionary.
      See Also:
        `Warehouse.lookForClass(Class)`, `Warehouse.lookForClass(String)`

    - #### registerOpaqueTypeDefinition

          public void registerOpaqueTypeDefinition(TypeDefinition typeDef)
                                            throws NullPointerException,
                                                   InvalidParameterException

      Description copied from interface: `MetaDictionary`

      Add the opaque type definition to the dictionary.

      An opaque type definition defines a property type that has a value whose type is specified in each instance.

      Specified by:
        `registerOpaqueTypeDefinition` in interface `MetaDictionary`
      Parameters:
        `typeDef` - Type definition object.
      Throws:
        `NullPointerException` - Argument is null.
        `InvalidParameterException` - The given type has already been registered.

    - #### registerTypeDefinition

          public void registerTypeDefinition(TypeDefinition typeDefinition)
                                      throws NullPointerException,
                                             InvalidParameterException

      Description copied from interface: `MetaDictionary`

      Add a type definition to those contained in this dictionary.

      Specified by:
        `registerTypeDefinition` in interface `MetaDictionary`
      Parameters:
        `typeDefinition` - Type definition to add to this dictionary.
      Throws:
        `NullPointerException` - The given type definition is `null`.
        `InvalidParameterException` - The given type has an id that matches the id of a type definition already contained in the dictionary.
      See Also:
        `Warehouse.lookForType(String)`, `Warehouse.lookForType(AUID)`, `Warehouse.registerTypes(Class, String, String)`, `Warehouse.register(TypeDefinition, String, String)`

    - #### makeDynamic

          public void makeDynamic(Preface preface)
                           throws NullPointerException

      Description copied from interface: `MetaDictionary`

      Turn this meta dictionary from static to dynamic and/or update the meta definitions to represent those required to represent the given preface.

      Specified by:
        `makeDynamic` in interface `MetaDictionary`
      Parameters:
        `preface` - Preface to compute the meta dictionary for.
      Throws:
        `NullPointerException` - Cannot make a dynamic meta dictionary from a `null` value.
      See Also:
        `MetaDictionary.getIsDynamic()`, `MetaDictionary.makeStatic()`

    - #### makeStatic

          public void makeStatic()

      Description copied from interface: `MetaDictionary`

      Turn this meta dictionary into a static meta dictionary, which is the default state. In this state, the meta dictionary holds all meta definitions known to the current virtual machine.

      Specified by:
        `makeStatic` in interface `MetaDictionary`
      See Also:
        `MetaDictionary.getIsDynamic()`, `MetaDictionary.makeDynamic(Preface)`

    - #### getIsDynamic

          public boolean getIsDynamic()

      Description copied from interface: `MetaDictionary`

      Is this meta dictionary dynamic? A dynamic meta dictionary represents only the meta definitions required to represent a given preface at a specific point in time. Otherwise, the meta dictionary is static and represents all meta definitions known to the current virtual machine.

      Specified by:
        `getIsDynamic` in interface `MetaDictionary`
      Returns:
        Is this meta dictionary dynamic?
      See Also:
        `MetaDictionary.makeStatic()`, `MetaDictionary.makeDynamic(Preface)`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `Object`

    - #### clone

          public MetaDictionary clone()

      Description copied from interface: `MetaDictionary`

      Create a cloned copy of this meta dictionary.

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

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