Media Authoring
with Java API

tv.amwa.maj.iface
Interface InterchangeObject

All Known Subinterfaces:
AAFFileDescriptor, AES3PCMDescriptor, AIFCDescriptor, AuxiliaryDescriptor, BWFImportDescriptor, CDCIDescriptor, CodecDefinition, CommentMarker, Component, CompositionMob, ConstantValue, ContainerDefinition, ContentStorage, ControlPoint, DataDefinition, DataEssenceDescriptor, DefinitionObject, DescriptiveClip, DescriptiveFramework, DescriptiveMarker, DescriptiveObject, Dictionary, DigitalImageDescriptor, EdgecodeSegment, EssenceData, EssenceDescriptor, EssenceGroup, Event, EventMobSlot, Filler, FilmDescriptor, GPITrigger, Header, HTMLClip, HTMLDescriptor, Identification, ImportDescriptor, InterpolationDefinition, KLVData, KLVDataDefinition, Locator, MasterMob, Mob, MobSlot, MPEGVideoDescriptor, MultipleDescriptor, NestedScope, NetworkLocator, OperationDefinition, OperationGroup, Parameter, ParameterDefinition, PCMDescriptor, PhysicalDescriptor, PluginDefinition, Pulldown, RecordingDescriptor, RGBADescriptor, RIFFChunk, ScopeReference, Segment, Selector, Sequence, SoundDescriptor, SourceClip, SourceMob, SourceReferenceSegment, StaticMobSlot, SubDescriptor, TaggedValue, TaggedValueDefinition, TapeDescriptor, TextClip, TextLocator, TIFFDescriptor, TimecodeSegment, TimecodeStream, TimecodeStream12M, TimelineMobSlot, Transition, VaryingValue, WAVEDescriptor
All Known Implementing Classes:
AAFFileDescriptor, AES3PCMDescriptor, AIFCDescriptor, AuxiliaryDescriptor, BWFImportDescriptor, CDCIDescriptor, CodecDefinition, CommentMarker, Component, CompositionMob, ConstantValue, ContainerDefinition, ContentStorage, ControlPoint, DataDefinition, DataEssenceDescriptor, DefinitionObject, DescriptiveClip, DescriptiveFramework, DescriptiveMarker, DescriptiveObject, Dictionary, DigitalImageDescriptor, EdgecodeSegment, EssenceData, EssenceDescriptor, EssenceGroup, Event, EventMobSlot, Filler, FilmDescriptor, GPITrigger, Header, HTMLClip, HTMLDescriptor, Identification, ImportDescriptor, InterchangeObject, InterpolationDefinition, KLVData, KLVDataDefinition, Locator, MasterMob, Mob, MobSlot, MPEGVideoDescriptor, MultipleDescriptor, NestedScope, NetworkLocator, OperationDefinition, OperationGroup, Parameter, ParameterDefinition, PCMDescriptor, PhysicalDescriptor, PluginDefinition, Pulldown, RecordingDescriptor, RGBADescriptor, RIFFChunk, ScopeReference, Segment, Selector, Sequence, SoundDescriptor, SourceClip, SourceMob, SourceReferenceSegment, StaticMobSlot, SubDescriptor, TaggedValue, TaggedValueDefinition, TapeDescriptor, TextClip, TextLocator, TIFFDescriptor, TimecodeSegment, TimecodeStream, TimecodeStream12M, TimelineMobSlot, Transition, VaryingValue, WAVEDescriptor

public interface InterchangeObject

Specifies the root class for all AAF persistent classes. All classes defined in an AAF file shall be sub-classes of interchange object with the exception of the meta definition classes.

In addition to methods which all clients can use, it provides methods for direct property access which should not be used unless the client programmer is aware of the liabilities. Note that extending the set of optional properties of a class is not fully supported in the current implementation of the MAJ API.

Note that generation tracking is not currently supported by the MAJ API.

Author:
Richard Cartwright

Method Summary
 int countProperties()
          Returns the number of properties currently present in this interchange object.
 PropertyValue createOptionalPropertyValue(PropertyDefinition propertyDefinition, Object initialValue)
          Creates and returns a property value according to the given property definition and sets it for this interchange object.
 void disableGenerationTracking()
          Calling this method will cause generation tracking to be disabled for the object.
 void enableGenerationTracking()
          Calling this method will cause generation tracking to be enabled for the object.
 ClassDefinition getDefinition()
          Returns the class definition that identifies the class of this interchange object.
 Identification getGeneration()
          Gets the generation of this object, which identifies when this object was created or last modified.
 AUID getGenerationAUID()
          Shortcut to get the AUID of the identification representing this object's generation.
 Iterator<Property> getProperties()
          Returns the set of properties of this interchange object, where each property contains its property definition and current value.
 PropertyValue getPropertyValue(PropertyDefinition propertyDefinition)
          Returns the requested property value of the object.
 boolean isGenerationTracked()
          Returns true if generations are being tracked by the object.
 boolean isPropertyPresent(PropertyDefinition propertyDefinition)
          Returns true if the property identified by the given property definition is legal and present; otherwise returns false.
 void omitOpionalProperty(PropertyDefinition propertyDefinition)
          Omits the given optional property from this interchange object if the property definition is legal, optional and is present.
 void setPropertyValue(PropertyDefinition propertyDefinition, PropertyValue propertyValue)
          Sets the value of the given property of this interchange object to the given value.
 

Method Detail

getGeneration

Identification getGeneration()
                             throws InvalidParameterException,
                                    ObjectNotAttachedException

Gets the generation of this object, which identifies when this object was created or last modified.

This method will succeed if generation tracking is enabled for this object. Call enableGenerationTracking() and disableGenerationTracking() to control generation tracking for this object. Call isGenerationTracked() to determine if generation tracking is currently enabled for this object.

Returns:
Identification for when this object was last modified.
Throws:
InvalidParameterException - Generation tracking is not enabled for this object.
ObjectNotAttachedException - This object is not attached to a file from which generation information can be obtained.

getGenerationAUID

AUID getGenerationAUID()
                       throws InvalidParameterException,
                              ObjectNotAttachedException

Shortcut to get the AUID of the identification representing this object's generation.

This method will succeed if generation tracking is enabled for this object. Call enableGenerationTracking() and disableGenerationTracking() to control generation tracking for this object. Call isGenerationTracked() to determine if generation tracking is currently enabled for this object.

Returns:
AUID of the identification representing this object's generation.
Throws:
InvalidParameterException - Generation tracking is not enabled for this object.
ObjectNotAttachedException - This object is not attached to a file from which generation information can be obtained.
See Also:
getGeneration(), Identification.getGenerationAUID()

getDefinition

ClassDefinition getDefinition()

Returns the class definition that identifies the class of this interchange object.

Returns:
Class definition that describes this object instance.

getProperties

Iterator<Property> getProperties()

Returns the set of properties of this interchange object, where each property contains its property definition and current value. The set contains both optional and required properties and any extended properties if present.

Important note: This is a low-level method that allows direct access to properties. If such access takes place, any semantic checking provided in named property get/set methods of the object is bypassed at the user's own risk.

Returns:
Iterator over the set of properties of this interchange object.

countProperties

@UInt32
int countProperties()

Returns the number of properties currently present in this interchange object.

Returns:
Number of properties present for this interchange object.

getPropertyValue

PropertyValue getPropertyValue(PropertyDefinition propertyDefinition)
                               throws NullPointerException,
                                      IllegalPropertyException,
                                      PropertyNotPresentException

Returns the requested property value of the object. The desired property data is identified by the given property definition.

Important note: This is a low-level method that allows direct access to properties. If such access takes place, any semantic checking provided in named property get/set methods of the object is bypassed at the user's own risk.

Parameters:
propertyDefinition - Property definition identifying the requested property.
Returns:
Corresponding property value.
Throws:
NullPointerException - The given property definition is null.
IllegalPropertyException - The given property is illegal for this interchange object's class.
PropertyNotPresentException - The given property is optional, but not currently present in this instance of the class.

setPropertyValue

void setPropertyValue(PropertyDefinition propertyDefinition,
                      PropertyValue propertyValue)
                      throws NullPointerException,
                             IllegalPropertyException

Sets the value of the given property of this interchange object to the given value. If the selected property is optional but not yet present, this method will make the property present before setting its value.

Important note: This is a low-level method that allows direct access to properties. If such access takes place, any semantic checking such as that which is performed in all other named property get/set methods, is at the user's own risk.

Parameters:
propertyDefinition - Property definition identifying the property to set.
propertyValue - Value to set for the property.
Throws:
NullPointerException - One or both of the arguments is null.
IllegalPropertyException - The given property definition defines a property that is illegal for this object's class.
See Also:
getProperties(), getPropertyValue(PropertyDefinition), PropertyDefinition.getTypeDefinition(), TypeDefinition.createValue(Object)

isPropertyPresent

@Bool
boolean isPropertyPresent(PropertyDefinition propertyDefinition)
                          throws NullPointerException,
                                 IllegalPropertyException

Returns true if the property identified by the given property definition is legal and present; otherwise returns false.

Important note: This is a low-level method that allows direct access to properties. If such access takes place, any semantic checking provided in named property get/set methods of the object is bypassed at the user's own risk.

Parameters:
propertyDefinition - Property definition identifying an optional property of this interchange object to test for.
Returns:
Is the given property present for this interchange object?
Throws:
NullPointerException - The given property definition is null.
IllegalPropertyException - The given property is illegal for this interchange object's class.
See Also:
getDefinition(), ClassDefinition.getPropertyDefinitions(), getProperties()

omitOpionalProperty

void omitOpionalProperty(PropertyDefinition propertyDefinition)
                         throws NullPointerException,
                                IllegalPropertyException

Omits the given optional property from this interchange object if the property definition is legal, optional and is present.

Important note: This is a low-level method that allows direct access to properties. If such access takes place, any semantic checking provided in named property get/set methods of the object is bypassed at the user's own risk.

Parameters:
propertyDefinition - Property definition identifying the optional property to omit from this interchange object.
Throws:
NullPointerException - The given property definition is null.
IllegalPropertyException - The given property definition is illegal for the class defining this interchange object.
See Also:
getDefinition(), ClassDefinition.getPropertyDefinitions(), getProperties()

createOptionalPropertyValue

PropertyValue createOptionalPropertyValue(PropertyDefinition propertyDefinition,
                                          Object initialValue)
                                          throws NullPointerException,
                                                 IllegalPropertyException,
                                                 PropertyAlreadyPresentException

Creates and returns a property value according to the given property definition and sets it for this interchange object. The property must be legal for this class and not currently present.

Important note: This is a low-level method that allows direct access to properties. If such access takes place, any semantic checking provided in named property get/set methods of the object is bypassed at the user's own risk.

Parameters:
propertyDefinition - Property definition identifying the property value to create.
initialValue - Initial value for the optional property.
Returns:
Newly created property value for this interchange object.
Throws:
NullPointerException - The given property definition and/or value is/are null.
IllegalPropertyException - The given property definition is illegal for this interchange object's class.
PropertyAlreadyPresentException - The given property is optional, but already present in this class.
See Also:
TypeDefinition.createValue(Object), setPropertyValue(PropertyDefinition, PropertyValue)

enableGenerationTracking

void enableGenerationTracking()

Calling this method will cause generation tracking to be enabled for the object. Generation information will then be available through the getGeneration() and getGenerationAUID() methods.

Calling the disableGenerationTracking() method will disable generation tracking for this object.

Generation tracking is disabled by default.


disableGenerationTracking

void disableGenerationTracking()

Calling this method will cause generation tracking to be disabled for the object. Generation information will then not be available through the getGeneration() and getGenerationAUID() methods.

Calling the enableGenerationTracking() method will enable generation tracking for this object.

Generation tracking is disabled by default.


isGenerationTracked

@Bool
boolean isGenerationTracked()

Returns true if generations are being tracked by the object. A value of true indicates that generation information will be available through the getGeneration() and getGenerationAUID() methods.

Calling the enableGenerationTracking() method will enable generation tracking for this object; calling the disableGenerationTracking() method will disable generation tracking for this object.

Generation tracking is disabled by default.

See Also:
enableGenerationTracking(), disableGenerationTracking()

Media Authoring
with Java API

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