public interface PropertyDefinition extends MetaDefinition, Comparable<PropertyDefinition>
Specifies the description of a property allowed for a class.
A property definition is used to indicate a particular property
within a class. It defines the name and type of a property that is
used to set the value of an object of the class. Property definitions should be created through
registerNewPropertyDefinition()
or registerOptionalPropertyDefinition().
ClassDefinition.registerNewPropertyDefinition(AUID, String, String[], String, String, boolean, boolean, Short),
ClassDefinition.registerOptionalPropertyDefinition(AUID, String, String[], String, String),
ClassDefinition.getPropertyDefinitions(),
ClassDefinition.getAllPropertyDefinitions(),
Warehouse.lookForClass(String),
MediaProperty,
PropertyValue,
TypeDefinitions.PropertyDefinitionWeakReference,
TypeDefinitions.PropertyDefinitionWeakReferenceSet,
TypeDefinitions.PropertyDefinitionStrongReference,
TypeDefinitions.PropertyDefinitionStrongReferenceSet| Modifier and Type | Method and Description |
|---|---|
PropertyDefinition |
clone()
Create a cloned copy of this property definition.
|
boolean |
getFlattenXML()
Determines whether an XML serialization of referenced values or collections of
values should appear as a replacement for this element rather than contained within it.
|
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. |
boolean |
getIsXMLAttribute()
Determines whether the content of this property should be sereialized to XML
as an XML attribute of the owning class rather than
as a separate element.
|
boolean |
getIsXMLCDATA()
Determines whether the content of this property should be serialized to XML
as the CDATA content of the owning class rather than
as a separate element.
|
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
getMemberOf(). |
ClassDefinition |
getMemberOf()
Returns the class definition for the class that this property definition defines
a property for.
|
AUID |
getPropertyType()
Returns the identifier for the type of this property.
|
PropertyValue |
getPropertyValue(MetadataObject metadataObject)
Returns the requested property value of the given object.
|
String |
getSymbol()
Returns the symbol name for this property, which is the same as its tag name
in registered data XML.
|
TypeDefinition |
getTypeDefinition()
Returns the property type of the defined property.
|
int |
getWeight()
Returns the relative weight of this property definition, which is used when
generating a list of properties for a class or ordering elements when serializing
to XML.
|
boolean |
isPropertyPresent(MetadataObject metadataObject)
|
void |
omitOptionalProperty(MetadataObject metadataObject)
Omits this property from the given object if it is legal,
optional and is present.
|
void |
setMemberOf(ClassDefinition memberOf)
Sets the class definition of the the class that this property definition is
associated with.
|
void |
setPropertyValue(MetadataObject metadataObject,
PropertyValue propertyValue)
Sets the value of this property on the given object.
|
appendMetadictXML, deepEquals, equals, getAAFNamesInUse, getAliases, getAUID, getDescription, getName, getNamespace, getPrefix, hashCode, setAAFNamesInUse, setDescription, setName, setNamespace, setPrefix, setSymbol, toStringgetWeakTargetReferencecompareToTypeDefinition getTypeDefinition()
Returns the property type of the defined property.
getPropertyType()AUID getPropertyType()
Returns the identifier for the type of this property.
getTypeDefinition()@Bool boolean getIsOptional()
Returns true for a property that is optional and
false for a mandatory property. Optional properties can
be omitted from an objects persistent representation.
@Bool boolean getIsUniqueIdentifier() throws PropertyNotPresentException
Returns true for a property that provides a unique
identifier for its associated object; otherwise false.
PropertyNotPresentException - The optional is unique identifier property
is not present in this property definition.@UInt16 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 getMemberOf(). A value of zero indicates that no specified
value is available and a unique tag should be generated dynamically on serialization.
PrimerPack.lookupLocalTag(AUID)ClassDefinition getMemberOf() throws PropertyNotPresentException
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.
PropertyNotPresentException - The optional member of a class property is not present
in this property definition.ClassDefinition.getPropertyDefinitions()void setMemberOf(ClassDefinition memberOf)
Sets the class definition of the the class that this property definition is associated with.
memberOf - Class definition of the class that this property definition is associated
with.PropertyValue getPropertyValue(MetadataObject metadataObject) throws NullPointerException, IllegalPropertyException, PropertyNotPresentException, IllegalArgumentException
Returns the requested property value of the given object. The desired property data is identified by this property definition.
metadataObject - Object with this property to retrieve the value from.NullPointerException - The given metadata object is null.IllegalPropertyException - The given object does not have this property.PropertyNotPresentException - The given property is optional, but not
currently present in this instance of the class.IllegalArgumentException - An error occurred when trying to invoke
the underlying class' method.setPropertyValue(MetadataObject, PropertyValue),
MediaEngine.getPropertyValue(MetadataObject, String)void setPropertyValue(MetadataObject metadataObject, PropertyValue propertyValue) throws NullPointerException, IllegalPropertyException, IllegalArgumentException
Sets the value of this property on the given object. If the selected property is optional but not yet present, this method will make the property present before setting its value.
metadataObject - Object to set this property for.propertyValue - Value to set for the property.NullPointerException - One or both of the arguments is null.IllegalPropertyException - The given property is not defined on the given
metadata object.IllegalArgumentException - An error occurred when trying to invole the
underlying class' method.getPropertyValue(MetadataObject),
getTypeDefinition(),
TypeDefinition.createValue(Object)@Bool boolean isPropertyPresent(MetadataObject metadataObject) throws NullPointerException, IllegalPropertyException
Returns true if this is legal and
present for the given object; otherwise returns
false.
metadataObject - Object to use to check for the presence of this property.NullPointerException - The given metadata object is null.IllegalPropertyException - The given property is illegal for this
interchange object's class.ClassDefinition.getPropertyDefinitions(),
PropertyNotPresentException,
omitOptionalProperty(MetadataObject),
MediaEngine.isPropertyPresent(MetadataObject, String)void omitOptionalProperty(MetadataObject metadataObject) throws NullPointerException, IllegalPropertyException, IllegalArgumentException
Omits this property from the given object if it is legal, optional and is present.
metadataObject - Object to request that this property is omitted.NullPointerException - The given metadata object is null.IllegalPropertyException - The given metadata object does not have this
property or the property is not optional.IllegalArgumentException - An error occurred when trying to omit the
optional property on the underlying class.ClassDefinition.getPropertyDefinitions(),
ClassDefinition.getProperties(MetadataObject),
isPropertyPresent(MetadataObject)@AAFString String getSymbol()
Returns the symbol name for this property, which is the same as its tag name in registered data XML. Symbol names provide a namespace with unique names for all SMPTE registered class names and property names.
getSymbol in interface MetaDefinitionMediaProperty.symbol()@Int32 int getWeight()
Returns the relative weight of this property definition, which is used when generating a list of properties for a class or ordering elements when serializing to XML. The lowest weight value appears first. The default value is 0.
The weight value is MAJ API specific and has been introduced to support XML formats that require elements to be in a sequential order, such as the Broadcast Exchange Format (BXF, SMPTE 2021-2008).
MediaProperty.weight()boolean getIsXMLCDATA()
Determines whether the content of this property should be serialized to XML as the CDATA content of the owning class rather than as a separate element.
MediaProperty.isXMLCDATA()boolean getIsXMLAttribute()
Determines whether the content of this property should be sereialized to XML as an XML attribute of the owning class rather than as a separate element.
MediaProperty.isXMLAttribute()boolean getFlattenXML()
Determines whether an XML serialization of referenced values or collections of values should appear as a replacement for this element rather than contained within it. The replaced elements will have their symbol changed to match the symbol of this element.
Values are normally serialized to an element as follows:
<Parent>
<ThisProperty>
<Child attribute1="atval1">value1</Child>
<Child>value2</Child>
...
</ThisProperty>
...
</Parent>
When this flag is set to true, the values of the children of this
property to be inserted into this property's parent directly with the same symbol as this
property:
<Parent> <ThisProperty attribute1="atval1">value1</ThisProperty> <ThisProperty>value2</ThisProperty> ... </Parent>
Attributes are also carried to the higher level.
MediaProperty.flattenXML()PropertyDefinition clone()
Create a cloned copy of this property definition.
clone in interface MetaDefinition(c)2007-2016 Richard Cartwright, all rights reserved. Licensed under Apache 2 license and subject to the AMWA IPR policy.