Media Authoring
with Java API

tv.amwa.maj.entity
Class DataDefinition

java.lang.Object
  extended by tv.amwa.maj.entity.InterchangeObject
      extended by tv.amwa.maj.entity.DefinitionObject
          extended by tv.amwa.maj.entity.DataDefinition
All Implemented Interfaces:
Serializable, Cloneable, DataDefinitionConstant, DefinitionType, MAJCommon, DataDefinition, DefinitionObject, InterchangeObject, XMLSerializable

@AAFClass(uuid1=218169601,
          uuid2=257,
          uuid3=6912,
          uuid4={6,14,43,52,2,6,1,1},
          definedName="DataDefinition",
          description="The DataDefinition class specifies the kind of data that can be stored in a Component.")
public class DataDefinition
extends DefinitionObject
implements DataDefinition, Serializable, Cloneable, DataDefinitionConstant, MAJCommon

Implements a definition for the kind of data that can be stored in a component.

THE COMMENTS FOR THIS CLASS ARE INCOMPLETE.

Author:
Richard Cartwright
See Also:
Serialized Form

Nested Class Summary
static class DataDefinition.XMLHandler
           
 
Nested classes/interfaces inherited from class tv.amwa.maj.entity.DefinitionObject
DefinitionObject.DefinitionObjectXMLHandler
 
Nested classes/interfaces inherited from class tv.amwa.maj.entity.InterchangeObject
InterchangeObject.InterchangeObjectXMLHandler
 
Field Summary
 
Fields inherited from interface tv.amwa.maj.constant.DataDefinitionConstant
Auxiliary, DataEssence, DescriptiveMetadata, Edgecode, LegacyPicture, LegacySound, LegacyTimecode, Matte, ParsedText, Picture, PictureWithMatte, Sound, Timecode, Unknown
 
Constructor Summary
DataDefinition(AUID identification, String name)
          Creates and initializes the required fields of a data definition, which specifies the kind of data that can be stored in a component.
 
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.
 DataDefinition clone()
          Creates a cloned copy of this entity.
 boolean doesDataDefConvertFrom(DataDefinition dataDef)
          Returns true if data represented by this type of data definition can be created by converting from the type represented by the given data definition.
 boolean doesDataDefConvertTo(DataDefinition dataDef)
          Returns true if the data represented by this data definition can be converted to the data definition given as an argument.
static DataDefinition forIdentification(AUID identification)
           
static DataDefinition forName(String dataDefinitionName)
           
 String getLocalizedUID()
           
 boolean isAuxilaryKind()
          Returns true if the data definition represents Auxiliary data; otherwise false.
 boolean isDataDefOf(DataDefinition dataDef)
          Returns true is this data definition matches the data definition provided in the parameter; otherwise false.
 boolean isDescriptiveMetadataKind()
          Returns true if the data definition represents data that is descriptive metadata; otherwise false.
 boolean isEdgecodeKind()
          Returns true if the data definition represents data that is a stream of film edge code values; otherwise false.
 boolean isMatteKind()
          Returns true in the data definition is a matte, in other words a stream of essence that contains an image of alpha values; otherwise false.
 boolean isPictureKind()
          Returns true is the data definition is a picture only; otherwise returns false.
 boolean isPictureWithMatteKind()
          Returns true if the data definition is for a picture with a matte; otherwise returns false.
 boolean isSoundKind()
          Returns true is a data definition corresponds to sound data; otherwise returns false.
 boolean isTimecodeKind()
          Returns true if the data definition represents data that is a stream of tape timecode values; otherwise false.
static boolean registerDataDefinition(DataDefinition definedDataDefinition)
           
static int registerDataDefinitionsFromClass(Class<?> classWithDataDefinitions)
           
 void setPropertiesFromInterface(DataDefinition castFrom)
           
 
Methods inherited from class tv.amwa.maj.entity.DefinitionObject
equals, getAUID, getDescription, getName, hashCode, setDescription, setLocalizedUID, setName
 
Methods inherited from class tv.amwa.maj.entity.InterchangeObject
castFromInterface, countProperties, createOptionalPropertyValue, disableGenerationTracking, enableGenerationTracking, getDefinition, getGeneration, getGenerationAUID, getProperties, getPropertyValue, isGenerationTracked, isPropertyPresent, omitOpionalProperty, registerImplementation, setPropertiesFromInterface, setPropertyValue, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface tv.amwa.maj.iface.DefinitionObject
getAUID, getDescription, getName, setDescription, setName
 
Methods inherited from interface tv.amwa.maj.iface.InterchangeObject
countProperties, createOptionalPropertyValue, disableGenerationTracking, enableGenerationTracking, getDefinition, getGeneration, getGenerationAUID, getProperties, getPropertyValue, isGenerationTracked, isPropertyPresent, omitOpionalProperty, setPropertyValue
 
Methods inherited from interface tv.amwa.maj.entity.MAJCommon
equals, hashCode, toString
 

Constructor Detail

DataDefinition

public DataDefinition(AUID identification,
                      @AAFString
                      String name)
               throws NullPointerException

Creates and initializes the required fields of a data definition, which specifies the kind of data that can be stored in a component.

Parameters:
identification - Unique identifier for the data definition.
name - Name for the data definition.
Throws:
NullPointerException - One or both of the arguments is null.
Method Detail

registerDataDefinitionsFromClass

public static final int registerDataDefinitionsFromClass(Class<?> classWithDataDefinitions)
                                                  throws NullPointerException
Throws:
NullPointerException

registerDataDefinition

public static final boolean registerDataDefinition(DataDefinition definedDataDefinition)
                                            throws NullPointerException
Throws:
NullPointerException

forName

public static final DataDefinition forName(String dataDefinitionName)
                                    throws NullPointerException
Throws:
NullPointerException

forIdentification

public static final DataDefinition forIdentification(AUID identification)
                                              throws NullPointerException
Throws:
NullPointerException

setPropertiesFromInterface

public final void setPropertiesFromInterface(DataDefinition castFrom)
See Also:
InterchangeObject.setPropertiesFromInterface(tv.amwa.maj.iface.InterchangeObject)

doesDataDefConvertFrom

public boolean doesDataDefConvertFrom(DataDefinition dataDef)
                               throws NullPointerException
Description copied from interface: DataDefinition

Returns true if data represented by this type of data definition can be created by converting from the type represented by the given data definition. Matching takes place based on the name property of the given data definition.

Specified by:
doesDataDefConvertFrom in interface DataDefinition
Parameters:
dataDef - Data definition of the type of data to be converted from.
Returns:
Can data of the type represented by the given data definition be converted to data of the type represented by this data definition?
Throws:
NullPointerException - Argument is null.

doesDataDefConvertTo

public boolean doesDataDefConvertTo(DataDefinition dataDef)
                             throws NullPointerException
Description copied from interface: DataDefinition

Returns true if the data represented by this data definition can be converted to the data definition given as an argument. Matching takes place passed on the name property of the data definition.

Specified by:
doesDataDefConvertTo in interface DataDefinition
Parameters:
dataDef - Data definition to compare this data definition with.
Returns:
Can data associated with this data definition be converted into data associated by the given data definition?
Throws:
NullPointerException - The given data definition is null.

isAuxilaryKind

public boolean isAuxilaryKind()
Description copied from interface: DataDefinition

Returns true if the data definition represents Auxiliary data; otherwise false.

Specified by:
isAuxilaryKind in interface DataDefinition
Returns:
Does the data definition represent data of an auxiliary kind?
See Also:
DataDefinitionConstant.Auxiliary

isDataDefOf

public boolean isDataDefOf(DataDefinition dataDef)
                    throws NullPointerException
Description copied from interface: DataDefinition

Returns true is this data definition matches the data definition provided in the parameter; otherwise false. Matching takes place using the name property of the definition.

Specified by:
isDataDefOf in interface DataDefinition
Parameters:
dataDef - Data definition to compare with.
Returns:
Does this data definition match the given one?
Throws:
NullPointerException - The given data definition is null.

isDescriptiveMetadataKind

public boolean isDescriptiveMetadataKind()
Description copied from interface: DataDefinition

Returns true if the data definition represents data that is descriptive metadata; otherwise false.

Specified by:
isDescriptiveMetadataKind in interface DataDefinition
Returns:
Does the data definition represent data that is descriptive metadata?
See Also:
DataDefinitionConstant.DescriptiveMetadata

isEdgecodeKind

public boolean isEdgecodeKind()
Description copied from interface: DataDefinition

Returns true if the data definition represents data that is a stream of film edge code values; otherwise false.

Specified by:
isEdgecodeKind in interface DataDefinition
Returns:
Does this data definition represent data that is a stream of film edgecode values?
See Also:
DataDefinitionConstant.Edgecode

isMatteKind

public boolean isMatteKind()
Description copied from interface: DataDefinition

Returns true in the data definition is a matte, in other words a stream of essence that contains an image of alpha values; otherwise false.

Specified by:
isMatteKind in interface DataDefinition
Returns:
Is the data definition related to a matte?
See Also:
DataDefinitionConstant.Matte

isPictureKind

public boolean isPictureKind()
Description copied from interface: DataDefinition

Returns true is the data definition is a picture only; otherwise returns false.

Specified by:
isPictureKind in interface DataDefinition
Returns:
Does the data definition relate to a picture?
See Also:
DataDefinitionConstant.Picture

isPictureWithMatteKind

public boolean isPictureWithMatteKind()
Description copied from interface: DataDefinition

Returns true if the data definition is for a picture with a matte; otherwise returns false. Pictures like this have both picture data alpha values.

Specified by:
isPictureWithMatteKind in interface DataDefinition
Returns:
Does the data definition represent data with both a picture and a matte?
See Also:
DataDefinitionConstant.PictureWithMatte

isSoundKind

public boolean isSoundKind()
Description copied from interface: DataDefinition

Returns true is a data definition corresponds to sound data; otherwise returns false.

Specified by:
isSoundKind in interface DataDefinition
Returns:
Does the data definition represent sound data?
See Also:
DataDefinitionConstant.Sound

isTimecodeKind

public boolean isTimecodeKind()
Description copied from interface: DataDefinition

Returns true if the data definition represents data that is a stream of tape timecode values; otherwise false.

Specified by:
isTimecodeKind in interface DataDefinition
Returns:
Does the data definition represent data that is a stream of tape timecode values?
See Also:
DataDefinitionConstant.Timecode

clone

public DataDefinition clone()
Description copied from interface: MAJCommon

Creates a cloned copy of this entity. The clone will be initialized to have the same value as this value but exists independently from then on. Changes to this value will not effect the clone and changes to the clone will not effect this. MAJ API clones are true deep clones with no shared references to areas of memory within the original.

This method does not throw a CloneNotSupportedException as all entity values must implement the Cloneable interface. If a cloning error does occur, a null value will be returned but this is very unlikely to happen.

Specified by:
clone in interface MAJCommon
Overrides:
clone in class DefinitionObject
Returns:
Independent clone of this value, which is a deep copy.
See Also:
Object.clone()

getLocalizedUID

public String getLocalizedUID()
Overrides:
getLocalizedUID in class DefinitionObject

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 DefinitionObject
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.