Media Authoring
with Java API

tv.amwa.maj.iface
Interface TypeDefinition

All Superinterfaces:
MetaDefinition
All Known Subinterfaces:
TypeDefinitionCharacter, TypeDefinitionEnumeration, TypeDefinitionExtendibleEnumeration, TypeDefinitionFixedArray, TypeDefinitionIndirect, TypeDefinitionInteger, TypeDefinitionObjectReference, TypeDefinitionOpaque, TypeDefinitionRecord, TypeDefinitionRename, TypeDefinitionSet, TypeDefinitionStream, TypeDefinitionString, TypeDefinitionStrongObjectReference, TypeDefinitionVariableArray, TypeDefinitionWeakObjectReference
All Known Implementing Classes:
TypeDefinition, TypeDefinitionCharacter, TypeDefinitionEnumeration, TypeDefinitionExtendibleEnumeration, TypeDefinitionFixedArray, TypeDefinitionIndirect, TypeDefinitionInteger, TypeDefinitionObjectReference, TypeDefinitionObjectReference.TypeDefinitionObjectReferenceUnresolved, TypeDefinitionOpaque, TypeDefinitionRecord, TypeDefinitionRename, TypeDefinitionSet, TypeDefinitionStream, TypeDefinitionString, TypeDefinitionStrongObjectReference, TypeDefinitionVariableArray, TypeDefinitionWeakObjectReference

public interface TypeDefinition
extends MetaDefinition

Specifies the definition of a property type.

The methods of type definitions allow property values of the given type to be manipulated. The interfaces provided in the MAJ API allow property values to be converted to and from equivalent Java types. Taking the character type definition as an example:

All other data types have similar methods.

Author:
Richard Cartwright
See Also:
Property, PropertyDefinition.getTypeDefinition(), PropertyValue.getType(), Parameter.getTypeDefinition(), InterchangeObject.getProperties(), AAFFactory.typeDefinitionForIdentification(tv.amwa.maj.record.AUID), AAFFactory.typeDefinitionForName(String)

Method Summary
 PropertyValue createValue(Object javaValue)
          Create a property value of this type from the given Java value.
 TypeCategory getTypeCategory()
          Returns the type category to which this type definition belongs, which corresponds to its sub interface.
 
Methods inherited from interface tv.amwa.maj.iface.MetaDefinition
getAUID, getDescription, getName, setDescription, setName
 

Method Detail

getTypeCategory

TypeCategory getTypeCategory()

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.

Returns:
Type category to which the type definition belongs.
See Also:
TypeCategory

createValue

PropertyValue createValue(Object javaValue)
                          throws ClassCastException

Create a property value of this type from the given Java value. Each kind of type definition will do its best to convert the given value to a property value of its type.

Parameters:
javaValue - Java value to use to create a new property value from.
Returns:
New property value of this type with a value corresponding to the given Java value.
Throws:
ClassCastException - The given java value could not be cast to a property value of this type.

Media Authoring
with Java API

(c) 2007-2008 Richard Cartwright, all rights reserved. Subject to the terms of the AAF SDK Public Source License.