Media Authoring
with Java API

tv.amwa.maj.meta
Class TypeDefinitionCharacter

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

@AAFClass(uuid1=218169601,
          uuid2=547,
          uuid3=0,
          uuid4={6,14,43,52,2,6,1,1},
          definedName="TypeDefinitionCharacter",
          description="The TypeDefinitionCharacter class defines a property type that has a value of a single 2-byte character.")
public final class TypeDefinitionCharacter
extends TypeDefinition
implements TypeDefinitionCharacter, Serializable, XMLSerializable, MAJCommon

Implements the definition of a property type that has a value of a single 2-byte character.

THE COMMENTS FOR THIS CLASS ARE INCOMPLETE.

Author:
Richard Cartwright
See Also:
Serialized Form

Nested Class Summary
static class TypeDefinitionCharacter.CharacterValue
           
static class TypeDefinitionCharacter.XMLHandler
           
 
Field Summary
static TypeDefinitionCharacter Character
           
 
Constructor Summary
TypeDefinitionCharacter(AUID identification, String typeName)
          Creates and initializes a new type definition for characters, which defines a property type that has a value of a single 2-byte character like Java's char type.
 
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 createValueFromCharacter(char character)
          Create a new property value of character type from the given single character.
 boolean deepEquals(Object o)
          Check to see if this definition is equal to the given object by comparing each property.
 char getCharacter(PropertyValue characterProperty)
          Returns the character that is the value of the given character property value.
 TypeCategory getTypeCategory()
          Returns the type category to which this type definition belongs, which corresponds to its sub interface.
 void setCharacter(PropertyValue characterProperty, char character)
          Sets the given character as the value of the given character property value.
 void setPropertiesFromInterface(TypeDefinitionCharacter 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

Character

public static final TypeDefinitionCharacter Character
Constructor Detail

TypeDefinitionCharacter

public TypeDefinitionCharacter(AUID identification,
                               @AAFString
                               String typeName)
                        throws NullPointerException

Creates and initializes a new type definition for characters, which defines a property type that has a value of a single 2-byte character like Java's char type.

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 used to identify this type.
typeName - Friendly name used to identify this type.
Throws:
NullPointerException - The identification is null.
Method Detail

setPropertiesFromInterface

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

createValueFromCharacter

public PropertyValue createValueFromCharacter(char character)
Description copied from interface: TypeDefinitionCharacter

Create a new property value of character type from the given single character.

Specified by:
createValueFromCharacter in interface TypeDefinitionCharacter
Parameters:
character - Character to use to create a new property value.
Returns:
New property value with a character value matching the given character.
See Also:
TypeDefinitionCharacter.setCharacter(PropertyValue, char)

getCharacter

public char getCharacter(PropertyValue characterProperty)
                  throws NullPointerException,
                         IllegalPropertyValueException
Description copied from interface: TypeDefinitionCharacter

Returns the character that is the value of the given character property value.

Specified by:
getCharacter in interface TypeDefinitionCharacter
Parameters:
characterProperty - Property value containing the character to return.
Returns:
Value of the given property value.
Throws:
NullPointerException - The given property value is null.
IllegalPropertyValueException - The given property value is not a character property value.
See Also:
PropertyValue.getType()

setCharacter

public void setCharacter(PropertyValue characterProperty,
                         char character)
                  throws NullPointerException,
                         IllegalPropertyValueException
Description copied from interface: TypeDefinitionCharacter

Sets the given character as the value of the given character property value.

Specified by:
setCharacter in interface TypeDefinitionCharacter
Parameters:
characterProperty - Property value of character type to set the character for.
character - Character to set as the value of the given property value.
Throws:
NullPointerException - The given character property value is null.
IllegalPropertyValueException - The given property value is not a a character property value.
See Also:
TypeDefinitionCharacter.createValueFromCharacter(char)

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?

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.

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.

Media Authoring
with Java API

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