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

tv.amwa.maj.meta.impl

## Class TypeDefinitionWeakObjectReferenceImpl

- java.lang.Object
- - tv.amwa.maj.meta.impl.MetaDefinitionImpl
  - - tv.amwa.maj.meta.impl.TypeDefinitionImpl
    - - tv.amwa.maj.meta.impl.SingletonTypeDefinitionImpl
      - - tv.amwa.maj.meta.impl.TypeDefinitionObjectReferenceImpl
        - - tv.amwa.maj.meta.impl.TypeDefinitionWeakObjectReferenceImpl

- All Implemented Interfaces:
    Serializable, Cloneable, CommonConstants, MetadataObject, WeakReferenceTarget, XMLSerializable, MetaDefinition, TypeDefinition, TypeDefinitionObjectReference, TypeDefinitionWeakObjectReference, DefinitionType

      @MediaClass(uuid1=218169601,
                  uuid2=518,
                  uuid3=0,
                  uuid4={6,14,43,52,2,6,1,1},
                  definedName="TypeDefinitionWeakObjectReference",
                  description="The TypeDefinitionWeakObjectReference class defines a property type that defines an object relationship where the target of the weak reference is referenced by the object with the property with the TypeDefinitionWeakObjectReference type.",
                  symbol="TypeDefinitionWeakObjectReference")
      public final class TypeDefinitionWeakObjectReferenceImpl
      extends TypeDefinitionObjectReferenceImpl
      implements TypeDefinitionWeakObjectReference, Serializable, Cloneable

  Implements the definition of a property type that defines an object relationship where the target of the weak reference is referenced by the object with the property with the TypeDefinitionWeakObjectReference type.

  See Also:
    Serialized Form

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class tv.amwa.maj.meta.impl.TypeDefinitionObjectReferenceImpl

      `TypeDefinitionObjectReferenceImpl.ObjectReferenceValue, TypeDefinitionObjectReferenceImpl.UnresolvedReferenceValue`

    - ### Nested classes/interfaces inherited from class tv.amwa.maj.meta.impl.SingletonTypeDefinitionImpl

      `SingletonTypeDefinitionImpl.SingletonMethodBag`

    - ### Nested classes/interfaces inherited from class tv.amwa.maj.meta.impl.TypeDefinitionImpl

      `TypeDefinitionImpl.PropertyValueImpl`

  - ### 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
    `TypeDefinitionWeakObjectReferenceImpl(AUID identification, String typeName, ClassDefinition objectType, AUID[] targetSet)` Creates and initializes a weak object reference type definition, which defines a property type that defines an object relationship where the target of the weak reference is referenced by the object with the property.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `appendMetadictXML(Node metadict, String namespace, String prefix)` Append an XML representation of this meta definition to the given XML node.
    `TypeDefinitionWeakObjectReference` | `clone()` Create a cloned copy of this meta definition.
    `PropertyValue` | `createValue(Object javaValue)` Create a property value from the given Java object.
    `ClassDefinition` | `getReferencedType()`
    `AUID[]` | `getTargetSet()` Returns the target set of the reference type that provides the path from the root of an AAF file to a string referenced set than can be used to resolve a weak reference of this type.
    `TypeCategory` | `getTypeCategory()` Returns the type category to which this type definition belongs, which corresponds to its sub interface.
    `static AUID[]` | `initializeTargetSet()`
    `static ClassDefinition` | `initializeWeakReferencedType()`
    `void` | `setReferencedType(ClassDefinition referencedType)`
    `void` | `setTargetSet(AUID[] targetSet)`

    - ### Methods inherited from class tv.amwa.maj.meta.impl.TypeDefinitionObjectReferenceImpl

      `createFromBytes, getLocalReference, getObject, getObjectType, lengthAsBytes, setObject, writeAsBytes`

    - ### Methods inherited from class tv.amwa.maj.meta.impl.SingletonTypeDefinitionImpl

      `setPropertyValue`

    - ### Methods inherited from class tv.amwa.maj.meta.impl.TypeDefinitionImpl

      `getNamespace, getPrefix, getPropertyValue, initalizeTypeNameMap, nameToAAFName, resolveReferences, writeAsStructuredStorageBytes`

    - ### Methods inherited from class tv.amwa.maj.meta.impl.MetaDefinitionImpl

      `aafNameToName, appendXMLChildren, deepEquals, equals, getAAFNamesInUse, getAliases, getAUID, getComment, getDescription, getIdentification, getName, getSymbol, getWeakTargetReference, hashCode, initializeMetaDefinitionIdentification, initializeMetaDefinitionName, setAAFNamesInUse, setAliases, setDescription, setIdentification, setName, setNamespace, setPrefix, setSymbol, toString`

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

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

    - ### Methods inherited from interface tv.amwa.maj.meta.TypeDefinitionObjectReference

      `getObject, getObjectType, setObject`

    - ### Methods inherited from interface tv.amwa.maj.meta.TypeDefinition

      `createFromBytes, getPropertyValue, lengthAsBytes, resolveReferences, setPropertyValue, writeAsBytes, writeAsStructuredStorageBytes`

    - ### Methods inherited from interface tv.amwa.maj.meta.MetaDefinition

      `deepEquals, equals, getAAFNamesInUse, getAliases, getAUID, getDescription, getName, getNamespace, getPrefix, getSymbol, hashCode, setAAFNamesInUse, setDescription, setName, setNamespace, setPrefix, setSymbol, toString`

    - ### Methods inherited from interface tv.amwa.maj.industry.WeakReferenceTarget

      `getWeakTargetReference`

    - ### Methods inherited from interface tv.amwa.maj.io.xml.XMLSerializable

      `appendXMLChildren, getComment`

- - ### Constructor Detail

    - #### TypeDefinitionWeakObjectReferenceImpl

          public TypeDefinitionWeakObjectReferenceImpl(AUID identification,
                                                       @AAFString
                                                       String typeName,
                                                       ClassDefinition objectType,
                                                       AUID[] targetSet)
                                                throws NullPointerException

      Creates and initializes a weak object reference type definition, which defines a property type that defines an object relationship where the target of the weak reference is referenced by the object with the property. Only objects that define a unique identification (`AUID` or `package id`) can be the targets of weak object references. An object can be the target of one or more than one weak references.

      The `targetSet` parameter points to an array of property definition AUIDs that indicate the location of the property containing the target of the weak reference. The AUIDs indicate the containment path to the target property, starting at the root `preface` object.

      For example, if the containment hierarchy is:

      `Preface->A->B->C`
      then the first `AUID` corresponds to the preface's property that contains object A; the second `AUID` corresponds to object A's property which contains object B; and the third `AUID` corresponds to object B's property C that contans the target of this weak reference. If any intermediate property is a vector or set, all objects in that vector or set are searched for the target.

      Note that the final `AUID` must correspond to a property that is currently set.

      Creating new and unregistered type definitions is not recommended as this may cause interoperability issues with other systems. The official registry of type definitions is available from SMPTE at SMPTE Metadata Registries And Related Items. The full range of data types documented in the AAF 1.1 object specification can be accessed by name and identification using either `Warehouse.lookForType(String)` or `Warehouse.lookForType(tv.amwa.maj.record.AUID)` respectively.

      Parameters:
        `identification` - AUID to be used to identify this type.
        `typeName` - Friendly name of the type definition.
        `objectType` - Class definition of objects that the reference is permitted to reference. The referenced object may also belong to a subclass of the referenced class.
        `targetSet` - List of property definition ids that indicate where the target of the reference is to be found.
      Throws:
        `NullPointerException` - One or more of the identification, object type or target set arguments is null and all are required.

  - ### Method Detail

    - #### getReferencedType

          @MediaProperty(uuid1=100729095,
                         uuid2=2560,
                         uuid3=0,
                         uuid4={6,14,43,52,1,1,1,2},
                         definedName="WeakReferencedType",
                         aliases="ReferencedType",
                         typeName="ClassDefinitionWeakReference",
                         optional=false,
                         uniqueIdentifier=false,
                         pid=18,
                         symbol="WeakReferencedType")
          public ClassDefinition getReferencedType()

    - #### setReferencedType

          @MediaPropertySetter(value="WeakReferencedType")
          public void setReferencedType(ClassDefinition referencedType)

    - #### initializeWeakReferencedType

          public static final ClassDefinition initializeWeakReferencedType()

    - #### getTargetSet

          @MediaProperty(uuid1=50397699,
                         uuid2=2816,
                         uuid3=0,
                         uuid4={6,14,43,52,1,1,1,2},
                         definedName="TargetSet",
                         aliases={"ReferenceTargetSet","TargetList"},
                         typeName="AUIDArray",
                         optional=false,
                         uniqueIdentifier=false,
                         pid=19,
                         symbol="TargetSet")
          public AUID[] getTargetSet()

      Description copied from interface: `TypeDefinitionWeakObjectReference`

      Returns the target set of the reference type that provides the path from the root of an AAF file to a string referenced set than can be used to resolve a weak reference of this type.

      Specified by:
        `getTargetSet` in interface `TypeDefinitionWeakObjectReference`
      Returns:
        Property path for resolving properties of this reference kind.

    - #### setTargetSet

          @MediaPropertySetter(value="TargetSet")
          public void setTargetSet(AUID[] targetSet)
                                                                    throws NullPointerException

      Throws:
        `NullPointerException`

    - #### initializeTargetSet

          public static final AUID[] initializeTargetSet()

    - #### createValue

          public PropertyValue createValue(Object javaValue)
                                    throws ClassCastException

      Description copied from class: `TypeDefinitionImpl`

      Create a property value from the given Java object. If the type of the object is not compatible with this type definition, a `ClassCastException` is thrown.

      Specified by:
        `createValue` in interface `TypeDefinition`
      Specified by:
        `createValue` in interface `TypeDefinitionObjectReference`
      Overrides:
        `createValue` in class `TypeDefinitionObjectReferenceImpl`
      Parameters:
        `javaValue` - Java object to use to create a property value of this type.
      Returns:
        Property value representing the given value.
      Throws:
        `ClassCastException` - The given object cannot be cast to a property value with this type definition.
      See Also:
        `TypeDefinitionObjectReference.setObject(PropertyValue, Object)`

    - #### getTypeCategory

          public TypeCategory getTypeCategory()

      Description copied from interface: `TypeDefinition`

      Returns the type category to which this type definition belongs, which corresponds to its sub interface. For example, TypeCategory.Int is returned for a `TypeDefinitionInteger`.

      Specified by:
        `getTypeCategory` in interface `TypeDefinition`
      Specified by:
        `getTypeCategory` in class `TypeDefinitionImpl`
      Returns:
        Type category to which the type definition belongs.
      See Also:
        `TypeCategory`

    - #### 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`
      Overrides:
        `appendMetadictXML` in class `MetaDefinitionImpl`
      Parameters:
        `metadict` - Meta dictionary node to append a description of this node to.
      See Also:
        `CommonConstants.AAF_METADICT_NAMESPACE`

    - #### clone

          public TypeDefinitionWeakObjectReference clone()

      Description copied from interface: `MetaDefinition`

      Create a cloned copy of this meta definition.

      Specified by:
        `clone` in interface `MetaDefinition`
      Specified by:
        `clone` in interface `TypeDefinition`
      Specified by:
        `clone` in interface `TypeDefinitionObjectReference`
      Specified by:
        `clone` in interface `TypeDefinitionWeakObjectReference`
      Overrides:
        `clone` in class `TypeDefinitionObjectReferenceImpl`
      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.