Media Authoring
with Java API

tv.amwa.maj.meta
Class TypeDefinitionWeakObjectReference

java.lang.Object
  extended by tv.amwa.maj.meta.MetaDefinition
      extended by tv.amwa.maj.meta.TypeDefinition
          extended by tv.amwa.maj.meta.TypeDefinitionObjectReference
              extended by tv.amwa.maj.meta.TypeDefinitionWeakObjectReference
All Implemented Interfaces:
Serializable, DefinitionType, MetaDefinition, TypeDefinition, TypeDefinitionObjectReference, TypeDefinitionWeakObjectReference, XMLSerializable, MAJCommon

@AAFClass(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.")
public final class TypeDefinitionWeakObjectReference
extends TypeDefinitionObjectReference
implements TypeDefinitionWeakObjectReference, Serializable, XMLSerializable, MAJCommon

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.

THE COMMENTS FOR THIS CLASS ARE INCOMPLETE.

Author:
Richard Cartwright
See Also:
Serialized Form

Nested Class Summary
static class TypeDefinitionWeakObjectReference.XMLHandler
           
 
Nested classes/interfaces inherited from class tv.amwa.maj.meta.TypeDefinitionObjectReference
TypeDefinitionObjectReference.ObjectReferenceValue, TypeDefinitionObjectReference.TypeDefinitionObjectReferenceUnresolved
 
Field Summary
static TypeDefinitionWeakObjectReference ClassDefinition
           
static TypeDefinitionWeakObjectReference CodecDefinition
           
static TypeDefinitionWeakObjectReference ContainerDefinition
           
static TypeDefinitionWeakObjectReference DataDefinition
           
static TypeDefinitionWeakObjectReference InterpolationDefinition
           
static TypeDefinitionWeakObjectReference Mob
           
static TypeDefinitionWeakObjectReference OperationDefinition
           
static TypeDefinitionWeakObjectReference ParameterDefinition
           
static TypeDefinitionWeakObjectReference PluginDefinition
           
static TypeDefinitionWeakObjectReference PropertyDefinition
           
static TypeDefinitionWeakObjectReference TypeDefinition
           
 
Constructor Summary
TypeDefinitionWeakObjectReference(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
 void appendXMLChildren(Node parent)
          Append child elements to the given parent node to serialize the value of an object to an XML fragment.
 boolean deepEquals(Object o)
          Check to see if this definition is equal to the given object by comparing each property.
 ClassDefinition getReferencedType()
           
 AUID[] getTargetSet()
           
 TypeCategory getTypeCategory()
          Returns the type category to which this type definition belongs, which corresponds to its sub interface.
 void setPropertiesFromInterface(TypeDefinitionWeakObjectReference castFrom)
           
 
Methods inherited from class tv.amwa.maj.meta.TypeDefinitionObjectReference
createValue, getObject, getObjectType, setObject, setPropertiesFromInterface
 
Methods inherited from class tv.amwa.maj.meta.TypeDefinition
setPropertiesFromInterface
 
Methods inherited from class tv.amwa.maj.meta.MetaDefinition
castFromInterface, equals, getAUID, getDescription, getIdentification, getName, hashCode, setDescription, setName, setPropertiesFromInterface, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface tv.amwa.maj.iface.TypeDefinitionObjectReference
createValue, getObject, getObjectType, setObject
 
Methods inherited from interface tv.amwa.maj.iface.MetaDefinition
getAUID, getDescription, getName, setDescription, setName
 
Methods inherited from interface tv.amwa.maj.meta.MAJCommon
equals, hashCode, toString
 

Field Detail

ClassDefinition

public static final TypeDefinitionWeakObjectReference ClassDefinition

ContainerDefinition

public static final TypeDefinitionWeakObjectReference ContainerDefinition

DataDefinition

public static final TypeDefinitionWeakObjectReference DataDefinition

InterpolationDefinition

public static final TypeDefinitionWeakObjectReference InterpolationDefinition

Mob

public static final TypeDefinitionWeakObjectReference Mob

OperationDefinition

public static final TypeDefinitionWeakObjectReference OperationDefinition

ParameterDefinition

public static final TypeDefinitionWeakObjectReference ParameterDefinition

TypeDefinition

public static final TypeDefinitionWeakObjectReference TypeDefinition

PluginDefinition

public static final TypeDefinitionWeakObjectReference PluginDefinition

CodecDefinition

public static final TypeDefinitionWeakObjectReference CodecDefinition

PropertyDefinition

public static final TypeDefinitionWeakObjectReference PropertyDefinition
Constructor Detail

TypeDefinitionWeakObjectReference

public TypeDefinitionWeakObjectReference(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 mob 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 header object.

For example, if the containment hierarchy is:

Header->A->B->C

then the first AUID corresponds to the header'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 AAFFactory.typeDefinitionForName(String) or AAFFactory.typeDefinitionForIdentification(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

setPropertiesFromInterface

public final void setPropertiesFromInterface(TypeDefinitionWeakObjectReference castFrom)
See Also:
MetaDefinition.setPropertiesFromInterface(tv.amwa.maj.iface.MetaDefinition)

getReferencedType

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

getTargetSet

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

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 TypeDefinition
Returns:
Type category to which the type definition belongs.
See Also:
TypeCategory

deepEquals

public final boolean deepEquals(Object o)
Description copied from class: MetaDefinition

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

Overrides:
deepEquals in class TypeDefinitionObjectReference
Parameters:
o - Object to compare to this definition.
Returns:
Is the given object a meta definiition with all of its properties equal to this meta definition?

appendXMLChildren

public void appendXMLChildren(Node parent)
Description copied from interface: XMLSerializable

Append child elements to the given parent node to serialize the value of an object to an XML fragment. Methods of the XMLBuilder class are provided to help with this process.

Specified by:
appendXMLChildren in interface XMLSerializable
Overrides:
appendXMLChildren in class TypeDefinitionObjectReference
Parameters:
parent - XML parent element to append child nodes to.

Media Authoring
with Java API

(c) 2007-2008 Richard Cartwright, all rights reserved. Subject to the terms of the AAF SDK Public Source License.