Media Authoring
with Java API

tv.amwa.maj.meta
Class MetaDefinition

java.lang.Object
  extended by tv.amwa.maj.meta.MetaDefinition
All Implemented Interfaces:
Serializable, DefinitionType, MetaDefinition, XMLSerializable, MAJCommon
Direct Known Subclasses:
ClassDefinition, PropertyDefinition, TypeDefinition

@AAFClass(uuid1=218169601,
          uuid2=548,
          uuid3=0,
          uuid4={6,14,43,52,2,6,1,1},
          definedName="MetaDefinition",
          description="The MetaDefinition class is an abstract class that defines a class, type, or property in an AAF file.")
public abstract class MetaDefinition
extends Object
implements MetaDefinition, DefinitionType, Serializable, XMLSerializable, MAJCommon

Implements the definition of a class, type, or property in an AAF file.

Extension of the meta model with external classes is not encouraged. The metamodel can be used to describe extensions in the main AAF object model. Therefore, the registration of classes is restricted to this package only.

THE COMMENTS FOR THIS CLASS ARE INCOMPLETE.

Author:
Richard Cartwright
See Also:
Serialized Form

Constructor Summary
MetaDefinition()
           
 
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.
static MetaDefinition castFromInterface(MetaDefinition alien)
          Casts a class that implements one of the generic meta definition interfaces of the Java AAF object model to a known concrete implementation.
 boolean deepEquals(Object o)
          Check to see if this definition is equal to the given object by comparing each property.
 boolean equals(Object o)
          Tests to see if the given object is equal to this embeddable value.
 AUID getAUID()
          Returns the identification of the definition.
 String getDescription()
          Returns the optional description of the definition.
 AUID getIdentification()
           
 String getName()
          Returns the name of the definition.
 int hashCode()
          Returns a hash code value for this embeddable object.
 void setDescription(String description)
          Sets the description of this meta definition.
 void setName(String name)
          Sets the name of this meta definition.
 void setPropertiesFromInterface(MetaDefinition castFrom)
          Set all the properties of this meta definition from the given class that implements the meta definition interface.
 String toString()
          Create and return a human-readable string representation of this embeddable value.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MetaDefinition

public MetaDefinition()
Method Detail

castFromInterface

public static final MetaDefinition castFromInterface(MetaDefinition alien)
                                              throws NullPointerException,
                                                     ClassCastException

Casts a class that implements one of the generic meta definition interfaces of the Java AAF object model to a known concrete implementation. If the given class matches the known implementation, no casting takes place.

Implementing classes must first be registered using the registerImplementation(Class) method. A maximum of one concrete implementing class per interface is permitted. External classes that implement more than one interface are not supported and the behaviour of this method will not be deterministic in this case.

Parameters:
alien - Class implementing any interface that extends MetaDefinition.
Returns:
A locally-known implementation of the given interface.
Throws:
NullPointerException - Argument is null.
ClassCastException - The given class cannot be cast to a known implementations due to incompatibilities, unknown interfaces, instantiation or invovation exceptions.

setPropertiesFromInterface

public final void setPropertiesFromInterface(MetaDefinition castFrom)
                                      throws NullPointerException

Set all the properties of this meta definition from the given class that implements the meta definition interface.

Parameters:
castFrom - Class to extract property values from.
Throws:
NullPointerException - Cannot set properties using a null value.

getAUID

@AAFProperty(uuid1=100729095,
             uuid2=4864,
             uuid3=0,
             uuid4={6,14,43,52,1,1,1,2},
             definedName="Identification",
             typeName="AUID",
             optional=false,
             uniqueIdentifier=true,
             pid=5)
public final AUID getAUID()
Description copied from interface: DefinitionType

Returns the identification of the definition. This is normally a registered SMPTE universal label.

Specified by:
getAUID in interface DefinitionType
Specified by:
getAUID in interface MetaDefinition
Returns:
Identification of the definition.

getIdentification

public AUID getIdentification()

getDescription

@AAFProperty(uuid1=100729095,
             uuid2=5121,
             uuid3=0,
             uuid4={6,14,43,52,1,1,1,2},
             definedName="Description",
             typeName="String",
             optional=true,
             uniqueIdentifier=false,
             pid=7)
public final String getDescription()
                            throws PropertyNotPresentException
Description copied from interface: DefinitionType

Returns the optional description of the definition.

Specified by:
getDescription in interface DefinitionType
Specified by:
getDescription in interface MetaDefinition
Returns:
Description of the definition.
Throws:
PropertyNotPresentException - The optional name property is not present for the definition.

setDescription

public final void setDescription(String description)
Description copied from interface: MetaDefinition

Sets the description of this meta definition. Set this optional property to null to omit it.

Specified by:
setDescription in interface MetaDefinition
Parameters:
description - Description of this meta definition.

getName

@AAFProperty(uuid1=50463745,
             uuid2=513,
             uuid3=0,
             uuid4={6,14,43,52,1,1,1,2},
             definedName="Name",
             typeName="String",
             optional=true,
             uniqueIdentifier=false,
             pid=6)
public final String getName()
Description copied from interface: DefinitionType

Returns the name of the definition.

Specified by:
getName in interface DefinitionType
Specified by:
getName in interface MetaDefinition
Returns:
Name of the definition.

setName

public final void setName(String name)
                   throws NullPointerException
Description copied from interface: MetaDefinition

Sets the name of this meta definition.

Specified by:
setName in interface MetaDefinition
Parameters:
name - Name to set for this meta definition.
Throws:
NullPointerException - The given meta definition name is null.

equals

public final boolean equals(Object o)
Description copied from interface: MAJCommon

Tests to see if the given object is equal to this embeddable value. To be equal, the given value must be not null, share the same interface to its value and each of the properties of the value must each be equal.

Specified by:
equals in interface MAJCommon
Overrides:
equals in class Object
Parameters:
o - Object to test for equality with.
Returns:
Is the given object equals to this value?
See Also:
Object.equals(Object)

deepEquals

public boolean deepEquals(Object o)

Check to see if this definition is equal to the given object by comparing each property. The 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.

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?

hashCode

public final int hashCode()
Description copied from interface: MAJCommon

Returns a hash code value for this embeddable object.

Specified by:
hashCode in interface MAJCommon
Overrides:
hashCode in class Object
Returns:
Hash code value for this embeddable object.
See Also:
Object.hashCode()

toString

public String toString()
Description copied from interface: MAJCommon

Create and return a human-readable string representation of this embeddable value.

Specified by:
toString in interface MAJCommon
Overrides:
toString in class Object
Returns:
String representation of this embeddable value.
See Also:
Object.toString()

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