|
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.TypeDefinition
tv.amwa.maj.meta.TypeDefinitionIndirect
tv.amwa.maj.meta.TypeDefinitionOpaque
@AAFClass(uuid1=218169601, uuid2=546, uuid3=0, uuid4={6,14,43,52,2,6,1,1}, definedName="TypeDefinitionOpaque", description="The TypeDefinitionOpaque class defines a property type that has a value whose type is specified in each instance.") public final class TypeDefinitionOpaque
Implements the definition of a property type that has a value whose type is specified in each instance.
THE COMMENTS FOR THIS CLASS ARE INCOMPLETE.
Nested Class Summary | |
---|---|
static class |
TypeDefinitionOpaque.OpaqueValue
|
static class |
TypeDefinitionOpaque.XMLHandler
|
Nested classes/interfaces inherited from class tv.amwa.maj.meta.TypeDefinitionIndirect |
---|
TypeDefinitionIndirect.IndirectValue |
Field Summary | |
---|---|
static TypeDefinitionOpaque |
Opaque
|
Fields inherited from class tv.amwa.maj.meta.TypeDefinitionIndirect |
---|
Indirect |
Constructor Summary | |
---|---|
TypeDefinitionOpaque(AUID identification,
String typeName)
Creates and initializes a new opaque type definition, which defines a property type that has a value whose type is specified in each instance. |
Method Summary | |
---|---|
PropertyValue |
createValue(Object javaValue)
Create a property value from the given Java object. |
PropertyValue |
createValueFromActualData(AUID actualTypeId,
byte[] initData)
|
PropertyValue |
createValueFromActualData(TypeDefinition type,
byte[] initData)
Creates and returns an indirect property value from the given type definition and serialized data. |
PropertyValue |
createValueFromActualValue(PropertyValue propertyValue)
Creates and returns an indirect property value that contains the given actual property value. |
PropertyValue |
createValueFromHandle(byte[] initData)
Creates and returns a new opaque property value from the given block of initial data. |
byte[] |
getActualData(PropertyValue opaqueProperty)
Returns a copy of the actual data contained in the indirect property value. |
int |
getActualSize(PropertyValue opaqueProperty)
Returns the size of the data held by the actual property value embedded within the given indirect property value. |
TypeDefinition |
getActualType(PropertyValue opaqueProperty)
Returns the type definition of the property value embedded within the given property value. |
AUID |
getActualTypeID(PropertyValue opaqueProperty)
Returns the type identifier of the actual data within the given opaque property value. |
PropertyValue |
getActualValue(PropertyValue opaqueProperty)
Returns the actual property value embedded within the given indirect property value. |
byte[] |
getHandle(PropertyValue opaqueProperty)
Read and return the given opaque property value without having to know its contents. |
TypeCategory |
getTypeCategory()
Returns the type category to which this type definition belongs, which corresponds to its sub interface. |
void |
setDictionary(Dictionary dictionary)
|
void |
setHandle(PropertyValue opaqueProperty,
byte[] handle)
Sets the value of the given opaque property value to the given unknown data. |
void |
setPropertiesFromInterface(TypeDefinitionOpaque castFrom)
|
Methods inherited from class tv.amwa.maj.meta.TypeDefinitionIndirect |
---|
appendXMLChildren, setPropertiesFromInterface |
Methods inherited from class tv.amwa.maj.meta.TypeDefinition |
---|
setPropertiesFromInterface |
Methods inherited from class tv.amwa.maj.meta.MetaDefinition |
---|
castFromInterface, deepEquals, 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 |
Methods inherited from interface tv.amwa.maj.io.xml.XMLSerializable |
---|
appendXMLChildren |
Methods inherited from interface tv.amwa.maj.meta.MAJCommon |
---|
equals, hashCode, toString |
Field Detail |
---|
public static final TypeDefinitionOpaque Opaque
Constructor Detail |
---|
public TypeDefinitionOpaque(AUID identification, @AAFString String typeName) throws NullPointerException
Creates and initializes a new opaque 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
AAFFactory.typeDefinitionForName(String)
or
AAFFactory.typeDefinitionForIdentification(tv.amwa.maj.record.AUID)
respectively.
identification
- AUID used to identify this type.typeName
- Friendly name for the opaque type definition.
NullPointerException
- The identification argument is null
.Method Detail |
---|
public final void setPropertiesFromInterface(TypeDefinitionOpaque castFrom)
MetaDefinition.setPropertiesFromInterface(tv.amwa.maj.iface.MetaDefinition)
public final PropertyValue createValueFromHandle(byte[] initData) throws NullPointerException, IllegalArgumentException
TypeDefinitionOpaque
Creates and returns a new opaque property value from the given block of initial data.
createValueFromHandle
in interface TypeDefinitionOpaque
initData
- Buffer containing the handle to use.
NullPointerException
- The given initial data handle is null
.
IllegalArgumentException
- A handle must contain at least
16 bytes of data.TypeDefinitionOpaque.setHandle(PropertyValue, byte[])
,
TypeDefinitionOpaque.getHandle(PropertyValue)
,
TypeDefinitionIndirect.createValueFromActualData(TypeDefinition, byte[])
,
TypeDefinitionIndirect.createValueFromActualValue(PropertyValue)
public final AUID getActualTypeID(PropertyValue opaqueProperty) throws NullPointerException, IllegalPropertyValueException
TypeDefinitionOpaque
Returns the type identifier of the actual data within the given opaque property value. This method assumes that the type identifier is stored in the first 16 bytes of the opaque data.
getActualTypeID
in interface TypeDefinitionOpaque
opaqueProperty
- Property value as defined by this opaque type
definition.
NullPointerException
- The given opaque property definition is null
.
IllegalPropertyValueException
- The given property value is not defined
by this opaque type definition.Dictionary.lookupKLVDataDefinition(AUID)
,
Dictionary.lookupOpaqueTypeDefinition(AUID)
,
TypeDefinitionIndirect.getActualType(PropertyValue)
public final byte[] getHandle(PropertyValue opaqueProperty) throws NullPointerException, IllegalPropertyValueException
TypeDefinitionOpaque
Read and return the given opaque property
value without having to know its contents. The returned buffer of
data can be used later by a call to
TypeDefinitionOpaque.setHandle(PropertyValue, byte[])
.
getHandle
in interface TypeDefinitionOpaque
opaqueProperty
- Property value containing unknown data to
be returned.
NullPointerException
- The given opaque property value is null
.
IllegalPropertyValueException
- The given property value is not defined
by this opaque type definition.TypeDefinitionOpaque.setHandle(PropertyValue, byte[])
,
TypeDefinitionIndirect.getActualData(PropertyValue)
,
TypeDefinitionIndirect.getActualValue(PropertyValue)
public final void setHandle(PropertyValue opaqueProperty, byte[] handle) throws NullPointerException, IllegalPropertyValueException, IllegalArgumentException
TypeDefinitionOpaque
Sets the value of the given opaque property value to the given unknown
data. This data may have previously been retrieved by a call to
TypeDefinitionOpaque.getHandle(PropertyValue)
.
setHandle
in interface TypeDefinitionOpaque
opaqueProperty
- Property value to set the unknown data value for.handle
- Data to set as the value of the given opaque property
value.
NullPointerException
- One or more of the arguments is null
.
IllegalPropertyValueException
- The given property value is not defined
by this opaque type definition.
IllegalArgumentException
- A handle must contain at least 16 bytes of
data.TypeDefinitionOpaque.getHandle(PropertyValue)
,
TypeDefinitionOpaque.createValueFromHandle(byte[])
public final PropertyValue createValueFromActualData(AUID actualTypeId, byte[] initData) throws NullPointerException
NullPointerException
public final PropertyValue createValueFromActualData(TypeDefinition type, byte[] initData) throws NullPointerException
TypeDefinitionIndirect
Creates and returns an indirect property value from the given type definition and serialized data.
createValueFromActualData
in interface TypeDefinitionIndirect
createValueFromActualData
in class TypeDefinitionIndirect
type
- 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
.TypeDefinitionIndirect.createValueFromActualData(tv.amwa.maj.iface.TypeDefinition, byte[])
public final byte[] getActualData(PropertyValue opaqueProperty) throws NullPointerException, IllegalPropertyValueException
TypeDefinitionIndirect
Returns a copy of the actual data contained in the indirect property value.
getActualData
in interface TypeDefinitionIndirect
getActualData
in class TypeDefinitionIndirect
opaqueProperty
- 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.iface.PropertyValue)
public final int getActualSize(PropertyValue opaqueProperty) throws NullPointerException, IllegalPropertyValueException
TypeDefinitionIndirect
Returns the size of the data held by the actual property value embedded within the given indirect property value.
getActualSize
in interface TypeDefinitionIndirect
getActualSize
in class TypeDefinitionIndirect
opaqueProperty
- 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.iface.PropertyValue)
public final void setDictionary(Dictionary dictionary) throws NullPointerException
NullPointerException
public final TypeDefinition getActualType(PropertyValue opaqueProperty) throws NullPointerException, IllegalPropertyValueException, TypeNotFoundException
TypeDefinitionIndirect
Returns 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 TypeDefinitionIndirect
getActualType
in class TypeDefinitionIndirect
opaqueProperty
- 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.
TypeNotFoundException
- For opaque type definitions, a type
matching the values key cannot be found.TypeDefinitionIndirect.getActualType(tv.amwa.maj.iface.PropertyValue)
public final PropertyValue getActualValue(PropertyValue opaqueProperty) throws NullPointerException, IllegalPropertyValueException, TypeNotFoundException, ClassCastException
TypeDefinitionIndirect
Returns the actual property value embedded within the given indirect property value.
getActualValue
in interface TypeDefinitionIndirect
getActualValue
in class TypeDefinitionIndirect
opaqueProperty
- 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.
TypeNotFoundException
- For opaque properties, the type attached
to the value cannot be resolved.
ClassCastException
TypeDefinitionIndirect.getActualValue(tv.amwa.maj.iface.PropertyValue)
public final PropertyValue createValueFromActualValue(PropertyValue propertyValue) throws NullPointerException, NotSerializableException
TypeDefinitionIndirect
Creates and returns an indirect property value that contains the given actual property value.
createValueFromActualValue
in interface TypeDefinitionIndirect
createValueFromActualValue
in class TypeDefinitionIndirect
propertyValue
- 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.iface.PropertyValue)
public final PropertyValue createValue(Object javaValue) throws ClassCastException
TypeDefinition
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 TypeDefinition
createValue
in class TypeDefinitionIndirect
javaValue
- 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.TypeDefinition.createValue(java.lang.Object)
public final TypeCategory getTypeCategory()
TypeDefinition
Returns 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 TypeDefinition
getTypeCategory
in class TypeDefinitionIndirect
TypeDefinition.getTypeCategory()
|
Media Authoring with Java API |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |