@MediaClass(uuid1=218169601, uuid2=526, uuid3=0, uuid4={6,14,43,52,2,6,1,1}, definedName="TypeDefinitionRename", description="The TypeDefinitionRename class defines a property type that has the same structure and representation as its underlying type but has a different meaning.", symbol="TypeDefinitionRename") public final class TypeDefinitionRenameImpl extends SingletonTypeDefinitionImpl implements TypeDefinitionRename, Serializable, Cloneable
Implements the definition of a property type that has the same structure and representation as its underlying type but has a different meaning.
| Modifier and Type | Class and Description |
|---|---|
static class |
TypeDefinitionRenameImpl.RenamedValue |
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 |
|---|
TypeDefinitionRenameImpl(AUID identification,
String typeName,
TypeDefinition baseType)
Creates and initializes a renamed type definition, which defines a property
type that has the same structure and representation as its underlying type but has
a different meaning.
|
| 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.
|
TypeDefinitionRename |
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 |
createValueFromBaseValue(PropertyValue propertyValue)
Returns a property value defined by this rename type definition
containing, wrapping the given property value.
|
TypeDefinition |
getBaseType()
Returns the type definition of the base type for which
this rename type definition is an alias.
|
PropertyValue |
getBaseValue(PropertyValue propertyValue)
Returns a property value of the base type, unwrapping the the given
property value that is defined by this rename type definition.
|
TypeCategory |
getTypeCategory()
Returns the type category to which this type definition belongs, which
corresponds to its sub interface.
|
static TypeDefinition |
initializeRenamedType() |
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) |
void |
setRenamedType(TypeDefinition renamedType) |
List<PropertyValue> |
writeAsBytes(PropertyValue value,
ByteBuffer buffer)
Write the given property value of this type to the given byte stream.
|
setPropertyValuegetNamespace, getPrefix, getPropertyValue, initalizeTypeNameMap, resolveReferences, writeAsStructuredStorageBytesaafNameToName, 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, setPropertyValue, writeAsStructuredStorageBytesdeepEquals, equals, getAAFNamesInUse, getAliases, getAUID, getDescription, getName, getNamespace, getPrefix, getSymbol, hashCode, setAAFNamesInUse, setDescription, setName, setNamespace, setPrefix, setSymbol, toStringgetWeakTargetReferencepublic TypeDefinitionRenameImpl(AUID identification, @AAFString String typeName, TypeDefinition baseType) throws NullPointerException
Creates and initializes a renamed type definition, which defines a property type that has the same structure and representation as its underlying type but has a different meaning.
identification - AUID to be used to identify this type.typeName - Friendly name of the rename type definition.baseType - Underlying base type this rename type definition is an
alias for.NullPointerException - The identification and/or the base type arguments
is/are null.public PropertyValue createValueFromBaseValue(PropertyValue propertyValue) throws NullPointerException, IllegalPropertyValueException
TypeDefinitionRenameReturns a property value defined by this rename type definition
containing, wrapping the given property value. The given
property value shall be of the same type as the underlying base
type of the rename type definition, as returned by
TypeDefinitionRename.getBaseType().
Note that the value returned may contain a reference to the same internal value as the given property value and this data is not necessarily a new copy.
createValueFromBaseValue in interface TypeDefinitionRenamepropertyValue - Property value of the base type to create a
new property value of this rename type from.NullPointerException - The given property value is null.IllegalPropertyValueException - The given property value is not compatible
with the base type of this rename type definition.@MediaProperty(uuid1=100729095, uuid2=4608, uuid3=0, uuid4={6,14,43,52,1,1,1,2}, definedName="RenamedType", typeName="TypeDefinitionWeakReference", optional=false, uniqueIdentifier=false, pid=30, symbol="RenamedType") public TypeDefinition getBaseType()
TypeDefinitionRenameReturns the type definition of the base type for which this rename type definition is an alias. The base type is also known as the renamed type.
getBaseType in interface TypeDefinitionRename@MediaPropertySetter(value="RenamedType") public void setRenamedType(TypeDefinition renamedType) throws NullPointerException
NullPointerExceptionpublic static final TypeDefinition initializeRenamedType()
public PropertyValue getBaseValue(PropertyValue propertyValue) throws NullPointerException, IllegalPropertyValueException
TypeDefinitionRenameReturns a property value of the base type, unwrapping the the given property value that is defined by this rename type definition.
Note that the value returned may contain a reference to the same internal value as the given property value and this data is not necessarily a new copy.
getBaseValue in interface TypeDefinitionRenamepropertyValue - Property value defined by the rename type
definition.NullPointerException - The given property value is null.IllegalPropertyValueException - The given property value is not
compatible with this rename type definition.TypeDefinitionRename.getBaseType()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.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 TypeDefinitionImplTypeCategorypublic PropertyValue createFromBytes(ByteBuffer buffer) throws 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.EndOfDataException - Insufficient bytes remaining in the given buffer to create
a value of this type.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 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 String nameToAAFName(String name)
nameToAAFName in class TypeDefinitionImplpublic 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 TypeDefinitionRename clone()
MetaDefinitionCreate a cloned copy of this meta definition.
clone in interface MetaDefinitionclone in interface TypeDefinitionclone in interface TypeDefinitionRenameclone in class TypeDefinitionImpl(c)2007-2016 Richard Cartwright, all rights reserved. Licensed under Apache 2 license and subject to the AMWA IPR policy.