@MediaClass(uuid1=218169601, uuid2=515, uuid3=0, uuid4={6,14,43,52,2,6,1,1}, definedName="TypeDefinition", description="The TypeDefinition class defines a property type.", symbol="TypeDefinition") public abstract class TypeDefinitionImpl extends MetaDefinitionImpl implements TypeDefinition, Serializable, Cloneable
Implements the definition of a property type.
tv.amwa.maj.industry.TypeDefinitionWarehouse,
TypeDefinitions.TypeDefinitionWeakReference,
TypeDefinitions.TypeDefinitionStrongReference,
TypeDefinitions.TypeDefinitionStrongReferenceSet,
TypeDefinitions.TypeDefinitionWeakReferenceVector,
Serialized Form| Modifier and Type | Class and Description |
|---|---|
static class |
TypeDefinitionImpl.PropertyValueImpl |
AAF_METADICT_NAMESPACE, AAF_METADICT_PREFIX, AAF_XML_NAMESPACE, AAF_XML_PREFIX, ApplicationPluginObjectID, ApplicationPluginsID, MAX_NUM_RGBA_COMPS, MemberOfID, ObjectClassID, ParentClassID, PropertiesID, XMLClassIDAsAttributeName| Constructor and Description |
|---|
TypeDefinitionImpl() |
| Modifier and Type | Method and Description |
|---|---|
TypeDefinition |
clone()
Create a cloned copy of this meta definition.
|
PropertyValue |
createFromBytes(ByteBuffer buffer)
Create a value of this type by reading the bytes in the given byte buffer.
|
abstract PropertyValue |
createValue(Object javaValue)
Create a property value from the given Java object.
|
String |
getNamespace()
Returns the namespace in which the subject of this meta definition is defined.
|
String |
getPrefix()
Returns the namespace prefix to use when serializing a value of the subject of this meta
definition to XML.
|
PropertyValue |
getPropertyValue(MetadataObject metadataObject,
PropertyDefinition property)
Get the specified property's value from the given object.
|
abstract TypeCategory |
getTypeCategory()
Returns the type category to which this type definition belongs, which
corresponds to its sub interface.
|
static void |
initalizeTypeNameMap() |
long |
lengthAsBytes(PropertyValue value)
Returns the number of bytes that the given value of this type is serialized as a
sequence of bytes.
|
String |
nameToAAFName(String name) |
boolean |
resolveReferences(PropertyValue value,
Map<AUID,MetadataObject> referenceMap)
Resolve any unresolved object references using the given reference map.
|
abstract void |
setPropertyValue(MetadataObject metadataObject,
PropertyDefinition property,
PropertyValue value)
On the given metadata object, set the specified property to the given value.
|
List<PropertyValue> |
writeAsBytes(PropertyValue value,
ByteBuffer buffer)
Write the given property value of this type to the given byte stream.
|
List<PropertyValue> |
writeAsStructuredStorageBytes(PropertyValue value,
ByteBuffer buffer)
Write the given property value of this type to the given byte stream that is to be written to a
structured storage format file.
|
aafNameToName, appendMetadictXML, appendXMLChildren, deepEquals, equals, getAAFNamesInUse, getAliases, getAUID, getComment, getDescription, getIdentification, getName, getSymbol, getWeakTargetReference, hashCode, initializeMetaDefinitionIdentification, initializeMetaDefinitionName, setAAFNamesInUse, setAliases, setDescription, setIdentification, setName, setNamespace, setPrefix, setSymbol, toStringappendMetadictXML, deepEquals, equals, getAAFNamesInUse, getAliases, getAUID, getDescription, getName, getSymbol, hashCode, setAAFNamesInUse, setDescription, setName, setNamespace, setPrefix, setSymbol, toStringgetWeakTargetReferencepublic static final void initalizeTypeNameMap()
public abstract TypeCategory getTypeCategory()
TypeDefinitionReturns the type category to which this type definition belongs, which
corresponds to its sub interface. For example, TypeCategory.Int
is returned for a TypeDefinitionInteger.
getTypeCategory in interface TypeDefinitionTypeCategorypublic abstract PropertyValue createValue(Object javaValue) throws ClassCastException
Create a property value from the given Java object. If the type of
the object is not compatible with this type definition, a ClassCastException
is thrown.
createValue in interface TypeDefinitionjavaValue - Java object to use to create a property value of this type.ClassCastException - The given object cannot be cast to a property value with
this type definition.public abstract void setPropertyValue(MetadataObject metadataObject, PropertyDefinition property, PropertyValue value) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException
TypeDefinitionOn the given metadata object, set the specified property to the given value. The property must be of this type.
setPropertyValue in interface TypeDefinitionmetadataObject - Object to set the value on.property - Property of the object to set.value - Value of this type to set the property value to.IllegalArgumentException - The given property value is not of this type.IllegalAccessException - Insufficient privileges to set properties on the given
metadata object.InvocationTargetException - Problem encountered while calling the set method
associated with the property for the given object.TypeDefinition.getPropertyValue(MetadataObject, PropertyDefinition)public PropertyValue getPropertyValue(MetadataObject metadataObject, PropertyDefinition property) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException
TypeDefinitionGet the specified property's value from the given object. The property must be of this type.
getPropertyValue in interface TypeDefinitionmetadataObject - Object to retrieve the property value from.property - Property of this type to extract the value for.IllegalArgumentException - The given property value is not of this type.IllegalAccessException - Insufficient privileges to get properties on the given
metadata object.InvocationTargetException - Problem encountered while calling the get method
associated with the property for the given object.TypeDefinition.setPropertyValue(MetadataObject, PropertyDefinition, PropertyValue)public PropertyValue createFromBytes(ByteBuffer buffer) throws NullPointerException, EndOfDataException
TypeDefinitionCreate a value of this type by reading the bytes in the given byte buffer. The buffer is assumed to have exactly the number of bytes that represent the value. For example, the length of a string value will be determined by the length (remaining bytes) in the buffer and not by reading a length value from the buffer.
This method is able to read values written by the
TypeDefinition.writeAsBytes(PropertyValue, ByteBuffer) method.
createFromBytes in interface TypeDefinitionbuffer - Buffer to create a value from.NullPointerException - Cannot read values from a null buffer.EndOfDataException - Insufficient bytes remaining in the given buffer to create
a value of this type.TypeDefinition.writeAsBytes(PropertyValue, ByteBuffer),
TypeDefinition.lengthAsBytes(PropertyValue)public List<PropertyValue> writeAsBytes(PropertyValue value, ByteBuffer buffer) throws NullPointerException, IllegalPropertyValueException, InsufficientSpaceException
TypeDefinitionWrite the given property value of this type to the given byte stream. This version is most appropriate for writing KLV streams (MXF files).
The format used to serialize the value with be compatible with the
TypeDefinition.createFromBytes(ByteBuffer) method. The number of bytes written to
the byte buffer will be the same as returned by TypeDefinition.lengthAsBytes(PropertyValue).
writeAsBytes in interface TypeDefinitionvalue - Value to write to the given buffer.buffer - Buffer to write the value to.NullPointerException - Cannot write from a null property value and/or
to a null value.IllegalPropertyValueException - The given property value is not of this type.InsufficientSpaceException - Insufficient space to write the given value into the
given buffer.TypeDefinition.writeAsStructuredStorageBytes(PropertyValue, ByteBuffer),
TypeDefinition.createFromBytes(ByteBuffer),
TypeDefinition.lengthAsBytes(PropertyValue)public List<PropertyValue> writeAsStructuredStorageBytes(PropertyValue value, ByteBuffer buffer) throws NullPointerException, IllegalPropertyValueException, InsufficientSpaceException
TypeDefinitionWrite the given property value of this type to the given byte stream that is to be written to a structured storage format file.
The number of bytes written to
the byte buffer will be the same as returned by TypeDefinition.lengthAsBytes(PropertyValue).
writeAsStructuredStorageBytes in interface TypeDefinitionvalue - Value to write to the given buffer.buffer - Buffer to write the value to.NullPointerException - Cannot write from a null property value and/or
to a null value.IllegalPropertyValueException - The given property value is not of this type.InsufficientSpaceException - Insufficient space to write the given value into the
given buffer.TypeDefinition.writeAsBytes(PropertyValue, ByteBuffer),
TypeDefinition.lengthAsBytes(PropertyValue)public long lengthAsBytes(PropertyValue value) throws NullPointerException, IllegalPropertyValueException
TypeDefinitionReturns the number of bytes that the given value of this type is serialized as a sequence of bytes.
The number returned by this method is the same as the number of bytes written
to a byte buffer by the TypeDefinition.writeAsBytes(PropertyValue, ByteBuffer) method.
lengthAsBytes in interface TypeDefinitionvalue - Value to find the length of when serialized to bytes.NullPointerException - Cannot compute the serialized length of a null value.IllegalPropertyValueException - The given property value is not of this type.TypeDefinition.writeAsBytes(PropertyValue, ByteBuffer),
TypeDefinition.createFromBytes(ByteBuffer)public boolean resolveReferences(PropertyValue value, Map<AUID,MetadataObject> referenceMap) throws NullPointerException, IllegalPropertyValueException
TypeDefinitionResolve any unresolved object references using the given reference map. Unresolved object references occur when a value has been read from a file but not linked to its strong or weak values. This method only effects types that are references or contain references in collections, which are:
TypeDefinitionWeakObjectReference;TypeDefinitionStrongObjectReference;TypeDefinitionVariableArray with elements of one of the object reference types;TypeDefinitionSet with elements of one of the object reference types.resolveReferences in interface TypeDefinitionvalue - Value to resolve references for.referenceMap - Map of local identifications to values to be used for resolution.NullPointerException - The value or reference map is/are null.IllegalPropertyValueException - The given property value is not of this type.public String nameToAAFName(String name)
nameToAAFName in class MetaDefinitionImplpublic String getPrefix()
MetaDefinitionReturns the namespace prefix to use when serializing a value of the subject of this meta definition to XML.
getPrefix in interface MetaDefinitiongetPrefix in class MetaDefinitionImplMediaProperty.prefix(),
MediaClass.prefix()public String getNamespace()
MetaDefinitionReturns the namespace in which the subject of this meta definition is defined.
getNamespace in interface MetaDefinitiongetNamespace in class MetaDefinitionImplMediaProperty.namespace(),
MediaClass.namespace(),
ExtensionScheme.getSchemeURI()public TypeDefinition clone()
MetaDefinitionCreate a cloned copy of this meta definition.
clone in interface MetaDefinitionclone in interface TypeDefinitionclone in class MetaDefinitionImpl(c)2007-2016 Richard Cartwright, all rights reserved. Licensed under Apache 2 license and subject to the AMWA IPR policy.