@MediaClass(uuid1=218169601, uuid2=545, uuid3=0, uuid4={6,14,43,52,2,6,1,1}, definedName="TypeDefinitionIndirect", description="The TypeDefinitionIndirect class defines a property type that has a value whose type is specified in each instance.", symbol="TypeDefinitionIndirect") public class TypeDefinitionIndirectImpl extends SingletonTypeDefinitionImpl implements TypeDefinitionIndirect, Serializable
Implementation of property values whose type is specified in each instance.
| Modifier and Type | Class and Description |
|---|---|
static class |
TypeDefinitionIndirectImpl.IndirectValue |
SingletonTypeDefinitionImpl.SingletonMethodBagTypeDefinitionImpl.PropertyValueImplAAF_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 |
|---|
TypeDefinitionIndirectImpl(AUID identification,
String typeName)
Creates and initializes a new indirect type definition, which defines a property type
that has a value whose type is specified in each instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
appendMetadictXML(Node metadict,
String namespace,
String prefix)
Append an XML representation of this meta definition to the given XML node.
|
TypeDefinitionIndirect |
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.
|
PropertyValue |
createValue(Object javaValue)
Create a property value from the given Java object.
|
PropertyValue |
createValueFromActualData(TypeDefinition actualType,
byte[] initData)
Creates and returns an indirect property value from the given
type definition and serialized data.
|
PropertyValue |
createValueFromActualValue(PropertyValue indirectProperty)
Creates and returns an indirect property value that contains
the given actual property value.
|
byte[] |
getActualData(PropertyValue indirectProperty)
Returns a copy of the actual data contained in the indirect
property value.
|
int |
getActualSize(PropertyValue indirectProperty)
Returns the size of the data held by the actual property value
embedded within the given indirect property value.
|
TypeDefinition |
getActualType(PropertyValue indirectProperty)
Returns the type definition of the property value embedded within
the given property value.
|
PropertyValue |
getActualValue(PropertyValue indirectProperty)
Returns the actual property value embedded within the given indirect
property value.
|
TypeCategory |
getTypeCategory()
Returns the type category to which this type definition belongs, which
corresponds to its sub interface.
|
long |
lengthAsBytes(PropertyValue value)
Returns the number of bytes that the given value of this type is serialized as a
sequence of bytes.
|
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.
|
setPropertyValuegetNamespace, getPrefix, getPropertyValue, initalizeTypeNameMap, nameToAAFName, resolveReferencesaafNameToName, appendXMLChildren, deepEquals, equals, getAAFNamesInUse, getAliases, getAUID, getComment, getDescription, getIdentification, getName, getSymbol, getWeakTargetReference, hashCode, initializeMetaDefinitionIdentification, initializeMetaDefinitionName, setAAFNamesInUse, setAliases, setDescription, setIdentification, setName, setNamespace, setPrefix, setSymbol, toStringgetPropertyValue, resolveReferences, setPropertyValuedeepEquals, equals, getAAFNamesInUse, getAliases, getAUID, getDescription, getName, getNamespace, getPrefix, getSymbol, hashCode, setAAFNamesInUse, setDescription, setName, setNamespace, setPrefix, setSymbol, toStringgetWeakTargetReferencepublic TypeDefinitionIndirectImpl(AUID identification, @AAFString String typeName) throws NullPointerException
Creates and initializes a new indirect type definition, which defines a property type that has a value whose type is specified in each instance.
Creating new and unregistered type definitions is not recommended as this may cause
interoperability issues with other systems. The official registry of type definitions
is available from SMPTE at SMPTE Metadata Registries
And Related Items. The full range of data types documented in the AAF 1.1 object
specification can be accessed by name and identification using either
Warehouse.lookForType(String) or
Warehouse.lookForType(tv.amwa.maj.record.AUID)
respectively.
identification - AUID to be used to identify this type.typeName - Friendly name of the new indirect type definition.NullPointerException - The identification argument is null.public PropertyValue createValueFromActualData(TypeDefinition actualType, byte[] initData) throws NullPointerException, EndOfDataException, ClassCastException
TypeDefinitionIndirectCreates and returns an indirect property value from the given type definition and serialized data.
createValueFromActualData in interface TypeDefinitionIndirectactualType - Type of the actual data to embed within the
new indirect property value.initData - Data to use to create the new indirect property
value of the given type.NullPointerException - One or more of the arguments is null.EndOfDataException - Insufficient data in the given array.ClassCastException - The type of the data does not match the
given type definition.TypeDefinitionIndirect.createValueFromActualData(tv.amwa.maj.meta.TypeDefinition, byte[])public PropertyValue createValueFromActualValue(PropertyValue indirectProperty) throws NullPointerException, NotSerializableException
TypeDefinitionIndirectCreates and returns an indirect property value that contains the given actual property value.
createValueFromActualValue in interface TypeDefinitionIndirectindirectProperty - Actual value to embed into the new indirect
property value.NullPointerException - The given original property value is null.NotSerializableException - For creating opaque type values, the
given property value cannot be serialized to a stream of opaque bytes.TypeDefinitionIndirect.createValueFromActualValue(tv.amwa.maj.industry.PropertyValue)public byte[] getActualData(PropertyValue indirectProperty) throws NullPointerException, IllegalPropertyValueException
TypeDefinitionIndirectReturns a copy of the actual data contained in the indirect property value.
getActualData in interface TypeDefinitionIndirectindirectProperty - Property value containing an actual value.NullPointerException - The given indirect property value is null.IllegalPropertyValueException - The given property value is not
defined by an indirect type definition.TypeDefinitionIndirect.getActualData(tv.amwa.maj.industry.PropertyValue)public int getActualSize(PropertyValue indirectProperty) throws NullPointerException, IllegalPropertyValueException
TypeDefinitionIndirectReturns the size of the data held by the actual property value embedded within the given indirect property value.
getActualSize in interface TypeDefinitionIndirectindirectProperty - Property value containing an actual value.NullPointerException - The given indirect property value is null.IllegalPropertyValueException - The given property value is not
defined by an indirect type definition.TypeDefinitionIndirect.getActualSize(tv.amwa.maj.industry.PropertyValue)public TypeDefinition getActualType(PropertyValue indirectProperty) throws NullPointerException, IllegalPropertyValueException
TypeDefinitionIndirectReturns the type definition of the property value embedded within
the given property value. This is effectively TypeDefinitionIndirect.getActualValue(PropertyValue)
followed by PropertyValue.getType().
getActualType in interface TypeDefinitionIndirectindirectProperty - Property value containing an actual property
value to determine the type of.NullPointerException - The given indirect property value is null.IllegalPropertyValueException - The given property value is not
defined by an indirect type definition.TypeDefinitionIndirect.getActualType(tv.amwa.maj.industry.PropertyValue)public PropertyValue getActualValue(PropertyValue indirectProperty) throws NullPointerException, IllegalPropertyValueException
TypeDefinitionIndirectReturns the actual property value embedded within the given indirect property value.
getActualValue in interface TypeDefinitionIndirectindirectProperty - Property value containing the embedded actual
value to return.NullPointerException - The given indirect property value is null.IllegalPropertyValueException - The given property value is not
defined by an indirect type definition.TypeDefinitionIndirect.getActualValue(tv.amwa.maj.industry.PropertyValue)public PropertyValue createValue(Object javaValue) throws ClassCastException
TypeDefinitionImplCreate 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 TypeDefinitioncreateValue in class TypeDefinitionImpljavaValue - 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.TypeDefinitionImpl.createValue(java.lang.Object)public 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 TypeDefinitiongetTypeCategory in class TypeDefinitionImplTypeDefinitionImpl.getTypeCategory()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 TypeDefinitioncreateFromBytes in class TypeDefinitionImplbuffer - 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 TypeDefinitionwriteAsBytes in class TypeDefinitionImplvalue - 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 TypeDefinitionwriteAsStructuredStorageBytes in class TypeDefinitionImplvalue - 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 TypeDefinitionlengthAsBytes in class TypeDefinitionImplvalue - 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 void appendMetadictXML(Node metadict, String namespace, String prefix)
MetaDefinitionAppend an XML representation of this meta definition to the given XML node.
appendMetadictXML in interface MetaDefinitionappendMetadictXML in class MetaDefinitionImplmetadict - Meta dictionary node to append a description of this node to.CommonConstants.AAF_METADICT_NAMESPACEpublic TypeDefinitionIndirect clone()
MetaDefinitionCreate a cloned copy of this meta definition.
clone in interface MetaDefinitionclone in interface TypeDefinitionclone in interface TypeDefinitionIndirectclone in class TypeDefinitionImpl(c)2007-2016 Richard Cartwright, all rights reserved. Licensed under Apache 2 license and subject to the AMWA IPR policy.