|
Media Authoring with Java API |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttv.amwa.maj.meta.MetaDefinition
tv.amwa.maj.meta.PropertyDefinition
@AAFClass(uuid1=218169601, uuid2=514, uuid3=0, uuid4={6,14,43,52,2,6,1,1}, definedName="PropertyDefinition", description="The PropertyDefinition class describes properties allowed for a class.") public final class PropertyDefinition
Implementation of a AAF property definition, which describes properties allowed for a class.
The preferred method of creating and managing property definitions in this Java
implementation is by annotating get methods on class implementations with the
AAFProperty
annotation. Property definitions are then created and attached
to their appropriate class definition using ClassDefinition.forClass(Class)
.
PropertyDefinition
,
AAFProperty
,
InterchangeObject.getProperties()
,
PropertyValue
,
Serialized FormNested Class Summary | |
---|---|
static class |
PropertyDefinition.XMLHandler
|
Constructor Summary | |
---|---|
PropertyDefinition(AUID identification,
String name,
TypeDefinition type,
ClassDefinition memberOf,
boolean isOptional)
Creates and initializes a new property definition, which describes an allowed property of a class definition . |
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. |
boolean |
deepEquals(Object o)
Tests if all the properties of this property definition are equals to all the properties of the given object. |
Method |
getAnnotatedMethod()
|
boolean |
getIsOptional()
Returns true for a property that is optional and
false for a mandatory property. |
boolean |
getIsUniqueIdentifier()
Returns true for a property that provides a unique
identifier for its associated object; otherwise false . |
short |
getLocalIdentification()
Returns the local identification associated with this property definition, which is used to identify the property within the scope of its associated class, as returned by PropertyDefinition.getMemberOf() . |
ClassDefinition |
getMemberOf()
Returns the class definition for the class that this property definition defines a property for. |
TypeDefinition |
getTypeDefinition()
Returns the property type of the defined property. |
void |
setAnnotatedMethod(Method annotatedMethod)
|
void |
setPropertiesFromInterface(PropertyDefinition castFrom)
Set the value of the properties of this property definition using any class that implements PropertyDefinition . |
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 |
Constructor Detail |
---|
public PropertyDefinition(AUID identification, @AAFString String name, TypeDefinition type, ClassDefinition memberOf, @Bool boolean isOptional) throws NullPointerException
Creates and initializes a new property definition, which describes an allowed property of a
class definition
.
It is not normally necessary to create property definitions directly as they are
available through methods of
ClassDefinition
. To extend the
AAF object model with user defined classes, the AAFProperty
annotation can be
used to automatically generate property definitions.
identification
- Unique identifier for the new property definition.name
- Display name of the new property definition.type
- Property type for the new property definition.memberOf
- Reference to the class this property is a member of, or null
if this property is not associated with a class.isOptional
- Can an object omit a value for this property?
NullPointerException
- One of the identification, name or type arguments is/are
null
and they are all required in this implementation.Method Detail |
---|
public final void setPropertiesFromInterface(PropertyDefinition castFrom)
Set the value of the properties of this property definition using any class that
implements PropertyDefinition
.
castFrom
- Object to use to set property values from.MetaDefinition.setPropertiesFromInterface(tv.amwa.maj.iface.MetaDefinition)
@AAFProperty(uuid1=50397698, uuid2=256, uuid3=0, uuid4={6,14,43,52,1,1,1,2}, definedName="IsOptional", typeName="Boolean", optional=false, uniqueIdentifier=false, pid=12) public boolean getIsOptional()
PropertyDefinition
Returns true
for a property that is optional and
false
for a mandatory property. Optional properties can
be omitted from an objects persistent representation.
getIsOptional
in interface PropertyDefinition
@AAFProperty(uuid1=100729095, uuid2=1536, uuid3=0, uuid4={6,14,43,52,1,1,1,2}, definedName="IsUniqueIdentifier", typeName="Boolean", optional=true, uniqueIdentifier=false, pid=14) public boolean getIsUniqueIdentifier() throws PropertyNotPresentException
PropertyDefinition
Returns true
for a property that provides a unique
identifier for its associated object; otherwise false
.
getIsUniqueIdentifier
in interface PropertyDefinition
PropertyNotPresentException
- The optional is unique identifier property
is not present in this property definition.@AAFProperty(uuid1=100729095, uuid2=1024, uuid3=0, uuid4={6,14,43,52,1,1,1,2}, definedName="Type", typeName="WeakReference to TypeDefinition", optional=false, uniqueIdentifier=false, pid=11) public TypeDefinition getTypeDefinition()
PropertyDefinition
Returns the property type of the defined property.
getTypeDefinition
in interface PropertyDefinition
@AAFProperty(uuid1=100729095, uuid2=1280, uuid3=0, uuid4={6,14,43,52,1,1,1,2}, definedName="LocalIdentification", typeName="UInt16", optional=false, uniqueIdentifier=false, pid=13) public short getLocalIdentification() throws PropertyNotPresentException
PropertyDefinition
Returns the local identification associated with this property definition,
which is used to identify the property within the scope of its associated class,
as returned by PropertyDefinition.getMemberOf()
. This property is optional in the MAJ API as
this API may not use an AAF-file based persistent representation of data.
getLocalIdentification
in interface PropertyDefinition
PropertyNotPresentException
- The optional local identification property is
not present in this property definition.public ClassDefinition getMemberOf() throws PropertyNotPresentException
PropertyDefinition
Returns the class definition for the class that this property definition defines a property for. This property is optional in the MAJ API but is almost always available in the implementation.
getMemberOf
in interface PropertyDefinition
PropertyNotPresentException
- The optional member of a class property is not present
in this property definition.ClassDefinition.getPropertyDefinitions()
public boolean deepEquals(Object o)
Tests if all the properties of this property definition are equals to all the properties of the given object.
deepEquals
in class MetaDefinition
o
- Object to compare to this definition.
MetaDefinition.deepEquals(java.lang.Object)
public void appendXMLChildren(Node parent)
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.
appendXMLChildren
in interface XMLSerializable
appendXMLChildren
in class MetaDefinition
parent
- XML parent element to append child nodes to.public void setAnnotatedMethod(Method annotatedMethod) throws NullPointerException
NullPointerException
public Method getAnnotatedMethod()
|
Media Authoring with Java API |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |