|
Media Authoring with Java API |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ClassDefinition
Specifies the definition of an AAF class. The definition can be used to extend the class hierarchy defined in the AAF object specification v1.1 by specifying a new class or by defining additional optional properties for a defined class. The operations on a class definition include: managing the position of the class within the class hierarchy; accessing property definitions associated with the class.
With the MAJ API, a Java class can be used to specify a class definition by using the AAFClass
and AAFProperty
annotations. In this way, AAF class specification data and
the MAJ API implementation methods can be managed alongside one another.
makeClassDefinition()
,
AAFClass
,
ClassDefinitionWarehouse
Method Summary | |
---|---|
int |
countPropertyDefinitions()
Returns number of property definitions in this class. |
Object |
createInstance()
Creates an instance of this class, and returns it. |
Class<?> |
getJavaImplementation()
Returns the Java class implementation associated with the defined class. |
ClassDefinition |
getParent()
Gets the Parent class for this class definition. |
Set<? extends PropertyDefinition> |
getPropertyDefinitions()
Returns all of the AAF property definitions attached to the current class. |
PropertyDefinition |
getUniqueIdentifier()
Returns the property definition corresponding to this class' unique identifier. |
boolean |
isConcrete()
Returns true if the defined class can be instantiated; returns false
otherwise. |
boolean |
isRoot()
Returns true if the defined class is the base of the inheritance
hierarchy; returns false otherwise. |
boolean |
isUniquelyIdentified()
Returns true if the defined class is uniquely identified, which means that it
has a single property that is a unique identifier for any given instance. |
PropertyDefinition |
lookupPropertyDefinition(AUID propertyId)
Looks up and returns the property definition corresponding to the given AUID in the set of propertise defined for this class. |
PropertyDefinition |
registerNewPropertyDefinition(AUID identification,
String name,
TypeDefinition typeDefinition,
boolean isOptional,
boolean isUniqueIdentifier,
Short pid)
Creates a new property definition and registers it in this class definition. |
PropertyDefinition |
registerOptionalPropertyDefinition(AUID identification,
String name,
TypeDefinition typeDefinition)
Creates a new property definition and registers it in this class definition. |
void |
setJavaImplementation(Class<?> javaImplementation)
Sets the Java class implementation associated with the defined class. |
Methods inherited from interface tv.amwa.maj.iface.MetaDefinition |
---|
getAUID, getDescription, getName, setDescription, setName |
Method Detail |
---|
Set<? extends PropertyDefinition> getPropertyDefinitions()
Returns all of the AAF property definitions attached to the current class.
@UInt32 int countPropertyDefinitions()
Returns number of property definitions in this class.
PropertyDefinition registerNewPropertyDefinition(AUID identification, @AAFString String name, TypeDefinition typeDefinition, boolean isOptional, boolean isUniqueIdentifier, Short pid) throws NullPointerException, ObjectAlreadyAttachedException, AlreadyUniquelyIdentifiedException
Creates a new property definition and registers it in this class definition. The new property definition is returned.
Note that it is illegal to add mandatory properties to an existing
(registered) class. This method will allow adding
either optional or mandatory properties to a class, but they must
be added to a class which has not yet been registered in the
dictionary. If this class has already been registered, it is
possible to add optional properties, but not through this
method. Optional properties added to an existing (registered)
class may be added through the InterchangeObject.createOptionalPropertyValue(PropertyDefinition, Object)
method.
identification
- AUID to be used to identify this property.name
- Name of the new property.typeDefinition
- Type of the new property.isOptional
- True if new property is to be optional.isUniqueIdentifier
- True if new property is to be the unique
identifier of the class.pid
- Short tag used to identify the property, or null
if it is not known.
NullPointerException
- One of the name or type definition arguments is null.
ObjectAlreadyAttachedException
- A property with the given identifier has already been registered.
AlreadyUniquelyIdentifiedException
- This class already has
a unique identifier property.Dictionary.getClassDefinitions()
,
PropertyDefinition
,
InterchangeObject.createOptionalPropertyValue(PropertyDefinition, Object)
PropertyDefinition registerOptionalPropertyDefinition(AUID identification, @AAFString String name, TypeDefinition typeDefinition) throws NullPointerException, ObjectAlreadyAttachedException
Creates a new property definition and registers it in this class definition. The new property definition is returned.
Note that it is illegal to add mandatory properties to an already
existing (registered) class. It is assumed that this property is
being added to a class which is already registered. If so, it
must be optional and this method will declare it so. If it is
wished to add a mandatory property, that may be done through the
registerNewPropertyDef()
method, but that must be called on
a class which is not yet registered.
identification
- AUID to be used to identify this property.name
- Name of the new property.typeDefinition
- Type of the new property.
NullPointerException
- Name or typeDef argument is null.
ObjectAlreadyAttachedException
- The given property identifier has already been registered.PropertyDefinition lookupPropertyDefinition(AUID propertyId) throws NullPointerException, BadParameterException
Looks up and returns the property definition corresponding to the given AUID in the set of propertise defined for this class.
propertyId
- AUID identifying the property to look up.
NullPointerException
- The given property identifier is null
.
BadParameterException
- The given property identifier is not registered as a property definition for
this class.ClassDefinition getParent()
Gets the Parent class for this class definition. If there is no parent then
null
is returned. The only classes which have no parent will
be InterchangeObject
and MetaDefinition
. These classes return
themselves as their own parents to indicate that they are the root of the
type hierarchy.
null
if no parent class has been defined.@Bool boolean isConcrete()
Returns true
if the defined class can be instantiated; returns false
otherwise. If the class is not concrete,
then it is abstract and implemented by an abstract Java class in the MAJ API.
Any object in an AAF file that belongs to an
abstract class shall also belong to a concrete subclass of the
abstract class.
@Bool boolean isRoot()
Returns true
if the defined class is the base of the inheritance
hierarchy; returns false
otherwise.
@Bool boolean isUniquelyIdentified()
Returns true
if the defined class is uniquely identified, which means that it
has a single property that is a unique identifier for any given instance.
getUniqueIdentifier()
,
PropertyDefinition.getIsUniqueIdentifier()
PropertyDefinition getUniqueIdentifier()
Returns the property definition corresponding to this class' unique identifier.
null
if the class does not have a unique identifier
property definition.isUniquelyIdentified()
,
PropertyDefinition.getIsUniqueIdentifier()
Object createInstance() throws NotImplementedException
Creates an instance of this class, and returns it. This method is not supported in the
MAJ API and will always throw a NotImplementedException
. Use implementations of the
AAF factory instead.
NotImplementedException
Class<?> getJavaImplementation() throws PropertyNotPresentException
Returns the Java class implementation associated with the defined class.
PropertyNotPresentException
- The optional java implementation property is not present
in this AAF class definition.AAFClass
,
ClassDefinition.forClass(Class)
void setJavaImplementation(Class<?> javaImplementation)
Sets the Java class implementation associated with the defined class.
javaImplementation
- Java class implementation associated with this AAF class definition.AAFClass
,
ClassDefinition.forClass(Class)
|
Media Authoring with Java API |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |