Media Authoring
with Java API

tv.amwa.maj.meta
Class TypeDefinitionRename

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

@AAFClass(uuid1=218169601,
          uuid2=526,
          uuid3=0,
          uuid4={6,14,43,52,2,6,1,1},
          definedName="TypeDefinitionRename",
          description="The TypeDefinitionRename class defines a property type that has the same structure and representation as its underlying type but has a different meaning.")
public final class TypeDefinitionRename
extends TypeDefinition
implements TypeDefinitionRename, Serializable, XMLSerializable, MAJCommon

Implements the definition of a property type that has the same structure and representation as its underlying type but has a different meaning.

THE COMMENTS FOR THIS CLASS ARE INCOMPLETE.

Author:
Richard Cartwright
See Also:
Serialized Form

Nested Class Summary
static class TypeDefinitionRename.RenamedValue
           
static class TypeDefinitionRename.XMLHandler
           
 
Field Summary
static TypeDefinitionRename JPEGTableIDType
           
static TypeDefinitionRename LengthType
           
static TypeDefinitionRename PhaseFrameType
           
static TypeDefinitionRename PluginCategoryType
           
static TypeDefinitionRename PositionType
           
static TypeDefinitionRename TransferCharacteristicType
           
 
Constructor Summary
TypeDefinitionRename(AUID identification, String typeName, TypeDefinition baseType)
          Creates and initializes a renamed type definition, which defines a property type that has the same structure and representation as its underlying type but has a different meaning.
 
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.
 PropertyValue createValue(Object javaValue)
          Create a property value from the given Java object.
 PropertyValue createValueFromBaseValue(PropertyValue propertyValue)
          Returns a property value defined by this rename type definition containing, wrapping the given property value.
 boolean deepEquals(Object o)
          Check to see if this definition is equal to the given object by comparing each property.
 TypeDefinition getBaseType()
          Returns the type definition of the base type for which this rename type definition is an alias.
 PropertyValue getBaseValue(PropertyValue propertyValue)
          Returns a property value of the base type, unwrapping the the given property value that is defined by this rename type definition.
 TypeCategory getTypeCategory()
          Returns the type category to which this type definition belongs, which corresponds to its sub interface.
 boolean resolveTheUnresolved(Map<AUID,MetaDefinition> localTypes)
          Called after the parsing of an element containing references.
 void setPropertiesFromInterface(TypeDefinitionRename castFrom)
           
 
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.MetaDefinition
getAUID, getDescription, getName, setDescription, setName
 
Methods inherited from interface tv.amwa.maj.meta.MAJCommon
equals, hashCode, toString
 

Field Detail

PositionType

public static final TypeDefinitionRename PositionType

LengthType

public static final TypeDefinitionRename LengthType

JPEGTableIDType

public static final TypeDefinitionRename JPEGTableIDType

PhaseFrameType

public static final TypeDefinitionRename PhaseFrameType

TransferCharacteristicType

public static final TypeDefinitionRename TransferCharacteristicType

PluginCategoryType

public static final TypeDefinitionRename PluginCategoryType
Constructor Detail

TypeDefinitionRename

public TypeDefinitionRename(AUID identification,
                            @AAFString
                            String typeName,
                            TypeDefinition baseType)
                     throws NullPointerException

Creates and initializes a renamed type definition, which defines a property type that has the same structure and representation as its underlying type but has a different meaning.

Parameters:
identification - AUID to be used to identify this type.
typeName - Friendly name of the rename type definition.
baseType - Underlying base type this rename type definition is an alias for.
Throws:
NullPointerException - The identification and/or the base type arguments is/are null.
Method Detail

setPropertiesFromInterface

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

createValueFromBaseValue

public PropertyValue createValueFromBaseValue(PropertyValue propertyValue)
                                       throws NullPointerException,
                                              IllegalPropertyValueException
Description copied from interface: TypeDefinitionRename

Returns a property value defined by this rename type definition containing, wrapping the given property value. The given property value shall be of the same type as the underlying base type of the rename type definition, as returned by TypeDefinitionRename.getBaseType().

Note that the value returned may contain a reference to the same internal value as the given property value and this data is not necessarily a new copy.

Specified by:
createValueFromBaseValue in interface TypeDefinitionRename
Parameters:
propertyValue - Property value of the base type to create a new property value of this rename type from.
Returns:
New property value created from the given property value of this type.
Throws:
NullPointerException - The given property value is null.
IllegalPropertyValueException - The given property value is not compatible with the base type of this rename type definition.

getBaseType

@AAFProperty(uuid1=100729095,
             uuid2=4608,
             uuid3=0,
             uuid4={6,14,43,52,1,1,1,2},
             definedName="RenamedType",
             typeName="WeakReference to TypeDefinition",
             optional=false,
             uniqueIdentifier=false,
             pid=30)
public TypeDefinition getBaseType()
Description copied from interface: TypeDefinitionRename

Returns the type definition of the base type for which this rename type definition is an alias. The base type is also known as the renamed type.

Specified by:
getBaseType in interface TypeDefinitionRename
Returns:
Base type for this rename type definition.

getBaseValue

public PropertyValue getBaseValue(PropertyValue propertyValue)
                           throws NullPointerException,
                                  IllegalPropertyValueException
Description copied from interface: TypeDefinitionRename

Returns a property value of the base type, unwrapping the the given property value that is defined by this rename type definition.

Note that the value returned may contain a reference to the same internal value as the given property value and this data is not necessarily a new copy.

Specified by:
getBaseValue in interface TypeDefinitionRename
Parameters:
propertyValue - Property value defined by the rename type definition.
Returns:
Equivalent property value defined by the base type definition.
Throws:
NullPointerException - The given property value is null.
IllegalPropertyValueException - The given property value is not compatible with this rename type definition.
See Also:
TypeDefinitionRename.getBaseType()

createValue

public PropertyValue createValue(Object javaValue)
                          throws ClassCastException
Description copied from class: TypeDefinition

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 class TypeDefinition
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.

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 MetaDefinition
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 MetaDefinition
Parameters:
parent - XML parent element to append child nodes to.

resolveTheUnresolved

public boolean resolveTheUnresolved(Map<AUID,MetaDefinition> localTypes)
Description copied from class: MetaDefinition

Called after the parsing of an element containing references. The references will be resolved against the glocal TypeDefinitionWarehouse first and then against the given map of unregistered type definitions.

Parameters:
localTypes - Unregistered type definitions to resolve references against.
Returns:
Have all the unresolved type references now been resolved?

Media Authoring
with Java API

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