TypeDefinitionVariableArrayImpl (Media Authoring with Java API)
Date: 2016-02-05

tv.amwa.maj.meta.impl

## Class TypeDefinitionVariableArrayImpl

- java.lang.Object
- - tv.amwa.maj.meta.impl.MetaDefinitionImpl
  - - tv.amwa.maj.meta.impl.TypeDefinitionImpl
    - - tv.amwa.maj.meta.impl.TypeDefinitionVariableArrayImpl

- All Implemented Interfaces:
    Serializable, Cloneable, CommonConstants, MetadataObject, WeakReferenceTarget, XMLSerializable, MetaDefinition, TypeDefinition, TypeDefinitionVariableArray, DefinitionType

      @MediaClass(uuid1=218169601,
                  uuid2=521,
                  uuid3=0,
                  uuid4={6,14,43,52,2,6,1,1},
                  definedName="TypeDefinitionVariableArray",
                  description="The TypeDefinitionVariableArray class defines a property type that has a varying number of values of the underlying type. The order of the values is meaningful.",
                  symbol="TypeDefinitionVariableArray")
      public final class TypeDefinitionVariableArrayImpl
      extends TypeDefinitionImpl
      implements TypeDefinitionVariableArray, Serializable, XMLSerializable, Cloneable

  Implements the definition of a property type that has a varying number of values of the underlying type. The order of the values is meaningful.

  See Also:
    Serialized Form

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `TypeDefinitionVariableArrayImpl.VariableArrayMethodBag`
    `static class` | `TypeDefinitionVariableArrayImpl.VariableArrayValue`

    - ### Nested classes/interfaces inherited from class tv.amwa.maj.meta.impl.TypeDefinitionImpl

      `TypeDefinitionImpl.PropertyValueImpl`

  - ### Field Summary

    - ### Fields inherited from interface tv.amwa.maj.constant.CommonConstants

      `AAF_METADICT_NAMESPACE, AAF_METADICT_PREFIX, AAF_XML_NAMESPACE, AAF_XML_PREFIX, ApplicationPluginObjectID, ApplicationPluginsID, MAX_NUM_RGBA_COMPS, MemberOfID, ObjectClassID, ParentClassID, PropertiesID, XMLClassIDAsAttributeName`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TypeDefinitionVariableArrayImpl(AUID identification, String typeName, TypeDefinition elementType)` Creates and initializes the varying size array type definition, defines a property type that has a varying number of values of the underlying type.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `appendElement(PropertyValue arrayProperty, PropertyValue element)` Append the given element to the end of the given array, which is of a type defined by this variable array type definition.
    `void` | `appendMetadictXML(Node metadict, String namespace, String prefix)` Append an XML representation of this meta definition to the given XML node.
    `TypeDefinitionVariableArray` | `clone()` Create a cloned copy of this meta definition.
    `PropertyValue` | `createEmptyValue()` Creates a property value containing an empty variable size array, which is an array with no elements in it yet.
    `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` | `createValueFromArray(Object[] initialData)` Create a property value containing a variable size array from the given array of Java objects.
    `PropertyValue` | `createValueFromList(List<Object> initialData)` Creates a property value containing a variable size array from the given list of Java objects.
    `PropertyValue` | `createValueFromValues(PropertyValue[] elementValues)` Creates a property value containing a variable size array from the given array of property values.
    `Object[]` | `getArray(PropertyValue arrayProperty)` Returns an array of Java objects containing the values of the given array.
    `int` | `getCount(PropertyValue arrayProperty)` Returns the number of elements in the given array, which is of a type defined by this variable size type definition.
    `List<PropertyValue>` | `getElements(PropertyValue arrayProperty)` Returns a copy of the internal list of all the elements in the given array.
    `PropertyValue` | `getElementValue(PropertyValue arrayProperty, int index)` Returns the property value from the given array at the given index.
    `TypeDefinition` | `getType()` Returns the type of elements of this variable size array type definition.
    `TypeCategory` | `getTypeCategory()` Returns the type category to which this type definition belongs, which corresponds to its sub interface.
    `static TypeDefinition` | `initializeVariableArrayElementType()`
    `void` | `insertElement(PropertyValue arrayProperty, int index, PropertyValue element)` Inserts the value of the given element into the given array property.
    `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` | `prependElement(PropertyValue arrayProperty, PropertyValue element)` Prepends a given element to the beginning of the given array.
    `void` | `removeElement(PropertyValue arrayProperty, int index)` Removes an element from the given array at the given zero-based index.
    `boolean` | `resolveReferences(PropertyValue value, Map<AUID,MetadataObject> referenceMap)` Resolve any unresolved object references using the given reference map.
    `void` | `setArray(PropertyValue arrayProperty, List<Object> data)` Sets the elements of a given array from the given list of Java objects.
    `void` | `setArray(PropertyValue arrayProperty, Object[] data)` Sets the elements of a given array from the given array of Java objects.
    `void` | `setElementAt(PropertyValue arrayProperty, int index, PropertyValue element)` Sets an element of the given array at the given index with the given value, replacing the value that is currently stored.
    `void` | `setElementType(TypeDefinition elementType)` Set the underlying element type for this variable size array type definition.
    `void` | `setPropertyValue(MetadataObject metadataObject, PropertyDefinition property, PropertyValue value)` On the given metadata object, set the specified property to the given value.
    `List<PropertyValue>` | `writeAsBytes(PropertyValue value, ByteBuffer buffer)` Write the given property value of this type to the given byte stream.

    - ### Methods inherited from class tv.amwa.maj.meta.impl.TypeDefinitionImpl

      `getNamespace, getPrefix, getPropertyValue, initalizeTypeNameMap, writeAsStructuredStorageBytes`

    - ### Methods inherited from class tv.amwa.maj.meta.impl.MetaDefinitionImpl

      `aafNameToName, appendXMLChildren, deepEquals, equals, getAAFNamesInUse, getAliases, getAUID, getComment, getDescription, getIdentification, getName, getSymbol, getWeakTargetReference, hashCode, initializeMetaDefinitionIdentification, initializeMetaDefinitionName, setAAFNamesInUse, setAliases, setDescription, setIdentification, setName, setNamespace, setPrefix, setSymbol, toString`

    - ### Methods inherited from class java.lang.Object

      `getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface tv.amwa.maj.meta.TypeDefinition

      `getPropertyValue, writeAsStructuredStorageBytes`

    - ### Methods inherited from interface tv.amwa.maj.meta.MetaDefinition

      `deepEquals, equals, getAAFNamesInUse, getAliases, getAUID, getDescription, getName, getNamespace, getPrefix, getSymbol, hashCode, setAAFNamesInUse, setDescription, setName, setNamespace, setPrefix, setSymbol, toString`

    - ### Methods inherited from interface tv.amwa.maj.industry.WeakReferenceTarget

      `getWeakTargetReference`

    - ### Methods inherited from interface tv.amwa.maj.io.xml.XMLSerializable

      `appendXMLChildren, getComment`

- - ### Constructor Detail

    - #### TypeDefinitionVariableArrayImpl

          public TypeDefinitionVariableArrayImpl(AUID identification,
                                                 @AAFString
                                                 String typeName,
                                                 TypeDefinition elementType)
                                          throws NullPointerException,
                                                 IllegalArgumentException

      Creates and initializes the varying size array type definition, defines a property type that has a varying number of values of the underlying type. The order of the values is meaningful.

      Note that it is only possible to use certain types as the element type and an `IllegalArgumentException` is thrown if the given type is not permitted. The permissible types are:

      - `TypeDefinitionInteger`
      - `TypeDefinitionRecord`
      - `TypeDefinitionEnumeration`
      - `TypeDefinitionExtendibleEnumeration`
      - `TypeDefinitionFixedArray`
      - `TypeDefinitionObjectReference`
      - `TypeDefinitionString`

      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 `tv.amwa.maj.industry.Warehouse#lookForTypeString)` or `Warehouse.lookForType(tv.amwa.maj.record.AUID)` respectively.

      Parameters:
        `identification` - AUID to be used to identify this type.
        `typeName` - Friendly name of the type definition.
        `elementType` - Type of each element to be contained in the array.
      Throws:
        `NullPointerException` - The identification and/or element type arguments is/are `null`.
        `IllegalArgumentException` - The given element type is not permitted for elements of a varying size array.

  - ### Method Detail

    - #### appendElement

          public void appendElement(PropertyValue arrayProperty,
                                    PropertyValue element)
                             throws NullPointerException,
                                    IllegalPropertyValueException,
                                    BadTypeException

      Description copied from interface: `TypeDefinitionVariableArray`

      Append the given element to the end of the given array, which is of a type defined by this variable array type definition.

      Specified by:
        `appendElement` in interface `TypeDefinitionVariableArray`
      Parameters:
        `arrayProperty` - Array to extend with the given element.
        `element` - Element to use to extend the given array.
      Throws:
        `NullPointerException` - One or both of the arguments is/are `null`.
        `IllegalPropertyValueException` - The given property value type does not match this variable size array property definition.
        `BadTypeException` - The given element is not of a type that is compatible with this type of array.
      See Also:
        `TypeDefinitionVariableArray.prependElement(PropertyValue, PropertyValue)`, `TypeDefinitionVariableArray.insertElement(PropertyValue, int, PropertyValue)`

    - #### createEmptyValue

          public PropertyValue createEmptyValue()

      Description copied from interface: `TypeDefinitionVariableArray`

      Creates a property value containing an empty variable size array, which is an array with no elements in it yet.

      Specified by:
        `createEmptyValue` in interface `TypeDefinitionVariableArray`
      Returns:
        Property value containing an empty variable size array.
      See Also:
        `TypeDefinitionVariableArray.createValueFromArray(Object[])`, `TypeDefinitionVariableArray.createValueFromList(List)`, `TypeDefinitionVariableArray.createValueFromValues(PropertyValue[])`

    - #### createValueFromArray

          public PropertyValue createValueFromArray(Object[] initialData)
                                             throws ClassCastException

      Description copied from interface: `TypeDefinitionVariableArray`

      Create a property value containing a variable size array from the given array of Java objects. Passing a `null` value to this method will create a variable size array property of this type containing a `null` value, which may be used to indicate that a property is not present.

      Specified by:
        `createValueFromArray` in interface `TypeDefinitionVariableArray`
      Parameters:
        `initialData` - Array of Java objects to use as the initial data for the variable size array.
      Returns:
        Property value containing a variable size array created from the given array of Java objects.
      Throws:
        `ClassCastException` - It is not possible to cast one or more of the given elements of the Java array to the underlying element type of this type definition.
      See Also:
        `TypeDefinitionVariableArray.createEmptyValue()`, `TypeDefinitionVariableArray.createValueFromList(List)`, `TypeDefinitionVariableArray.createValueFromValues(PropertyValue[])`, `TypeDefinitionVariableArray.setArray(PropertyValue, Object[])`

    - #### createValueFromList

          public PropertyValue createValueFromList(List<Object> initialData)

      Description copied from interface: `TypeDefinitionVariableArray`

      Creates a property value containing a variable size array from the given list of Java objects. Passing a `null` value to this method will create a variable size array property of this type containing a `null` value, which may be used to indicate that a property is not present.

      Specified by:
        `createValueFromList` in interface `TypeDefinitionVariableArray`
      Parameters:
        `initialData` - List of Java objects to use as the initial data for the variable size array.
      Returns:
        Property value containing a variable size array created from the given array of Java objects.
      See Also:
        `TypeDefinitionVariableArray.createValueFromArray(Object[])`, `TypeDefinitionVariableArray.setArray(PropertyValue, List)`

    - #### createValueFromValues

          public PropertyValue createValueFromValues(PropertyValue[] elementValues)
                                              throws BadTypeException

      Description copied from interface: `TypeDefinitionVariableArray`

      Creates a property value containing a variable size array from the given array of property values.

      Specified by:
        `createValueFromValues` in interface `TypeDefinitionVariableArray`
      Parameters:
        `elementValues` - Array of property values to use to create a variable size array.
      Returns:
        Property value containing the newly created variable size array.
      Throws:
        `BadTypeException` - One of more of the elements of the given array of property values has a type that is not compatible with this array type.
      See Also:
        `TypeDefinitionVariableArray.createEmptyValue()`, `TypeDefinitionVariableArray.createValueFromList(List)`, `TypeDefinitionVariableArray.createValueFromArray(Object[])`

    - #### getCount

          public int getCount(PropertyValue arrayProperty)
                       throws NullPointerException,
                              IllegalPropertyValueException

      Description copied from interface: `TypeDefinitionVariableArray`

      Returns the number of elements in the given array, which is of a type defined by this variable size type definition. This method will return 0 if the array is `null` or empty.

      Specified by:
        `getCount` in interface `TypeDefinitionVariableArray`
      Parameters:
        `arrayProperty` - Property value containing the array to find the size of.
      Returns:
        Number of elements in the given array.
      Throws:
        `NullPointerException` - The given array property is `null`.
        `IllegalPropertyValueException` - The given property value type does not match this variable size array property definition.

    - #### getElementValue

          public PropertyValue getElementValue(PropertyValue arrayProperty,
                                               int index)
                                        throws NullPointerException,
                                               IllegalPropertyValueException,
                                               IndexOutOfBoundsException,
                                               ClassCastException

      Description copied from interface: `TypeDefinitionVariableArray`

      Returns the property value from the given array at the given index.

      Specified by:
        `getElementValue` in interface `TypeDefinitionVariableArray`
      Parameters:
        `arrayProperty` - Property containing an array to return a value from.
        `index` - Index into the given array for the value to return.
      Returns:
        Property value from the given array at the given index.
      Throws:
        `NullPointerException` - The given array property value is `null`.
        `IllegalPropertyValueException` - The given property value type does not match this variable size array property definition.
        `IndexOutOfBoundsException` - The given index is outside the acceptable range for the current size of the given array.
        `ClassCastException`
      See Also:
        `TypeDefinitionVariableArray.getArray(PropertyValue)`, `PropertyValue.getValue()`

    - #### getElements

          public List<PropertyValue> getElements(PropertyValue arrayProperty)
                                          throws NullPointerException,
                                                 IllegalPropertyValueException

      Description copied from interface: `TypeDefinitionVariableArray`

      Returns a copy of the internal list of all the elements in the given array.

      Specified by:
        `getElements` in interface `TypeDefinitionVariableArray`
      Parameters:
        `arrayProperty` - Property containing the array to create an iterator for.
      Returns:
        List containing the elements of the given variable size array.
      Throws:
        `NullPointerException` - The given array property value is `null`.
        `IllegalPropertyValueException` - The given property value type does not match this variable size array property definition.
      See Also:
        `TypeDefinitionVariableArray.getArray(PropertyValue)`

    - #### getArray

          public Object[] getArray(PropertyValue arrayProperty)
                            throws NullPointerException,
                                   IllegalPropertyValueException

      Description copied from interface: `TypeDefinitionVariableArray`

      Returns an array of Java objects containing the values of the given array.

      Specified by:
        `getArray` in interface `TypeDefinitionVariableArray`
      Parameters:
        `arrayProperty` - Property containing the array to convert to an array of Java objects.
      Returns:
        Array of Java objects created from the values of the given array.
      Throws:
        `NullPointerException` - The given array property value is `null`.
        `IllegalPropertyValueException` - The given property value type does not match this variable size array property definition.
      See Also:
        `TypeDefinitionVariableArray.getElements(PropertyValue)`, `TypeDefinitionVariableArray.getElementValue(PropertyValue, int)`

    - #### getType

          @MediaProperty(uuid1=100729095,
                         uuid2=3328,
                         uuid3=0,
                         uuid4={6,14,43,52,1,1,1,2},
                         definedName="VariableArrayElementType",
                         aliases="ElementType",
                         typeName="TypeDefinitionWeakReference",
                         optional=false,
                         uniqueIdentifier=false,
                         pid=25,
                         symbol="VariableArrayElementType")
          public TypeDefinition getType()

      Description copied from interface: `TypeDefinitionVariableArray`

      Returns the type of elements of this variable size array type definition.

      Specified by:
        `getType` in interface `TypeDefinitionVariableArray`
      Returns:
        Type of elements of this variable size array type definition.

    - #### setElementType

          @MediaPropertySetter(value="VariableArrayElementType")
          public void setElementType(TypeDefinition elementType)
                                                                                     throws NullPointerException,
                                                                                            IllegalArgumentException

      Set the underlying element type for this variable size array type definition. All elements of a value of this type must be of the given element type.

      - `TypeDefinitionInteger`
      - `TypeDefinitionRecord`
      - `TypeDefinitionEnumeration`
      - `TypeDefinitionExtendibleEnumeration`
      - `TypeDefinitionFixedArray`
      - `TypeDefinitionObjectReference`
      - `TypeDefinitionString`
      Parameters:
        `elementType` - Underlying element type for this variable size array type definition.
      Throws:
        `NullPointerException` - Argument is null.
        `IllegalArgumentException` - Cannot set the element type of this variable size array type definition to the given element type.

    - #### initializeVariableArrayElementType

          public static final TypeDefinition initializeVariableArrayElementType()

    - #### insertElement

          public void insertElement(PropertyValue arrayProperty,
                                    int index,
                                    PropertyValue element)
                             throws NullPointerException,
                                    IllegalPropertyValueException,
                                    IndexOutOfBoundsException,
                                    BadTypeException

      Description copied from interface: `TypeDefinitionVariableArray`

      Inserts the value of the given element into the given array property. The index is zero-based and must be less than the value returned by `TypeDefinitionVariableArray.getCount(PropertyValue)`. The property value must be of the same type as returned by `TypeDefinitionVariableArray.getType()`. Elements at the given index and above will have their indices increased by one to accommodate the new element.

      Specified by:
        `insertElement` in interface `TypeDefinitionVariableArray`
      Parameters:
        `arrayProperty` - Property value corresponding to an array.
        `index` - 0-based index at which to insert the given element into the given array.
        `element` - Element to insert into the given array at the given index.
      Throws:
        `NullPointerException` - The given array property value and/or the given element is/are `null`.
        `IllegalPropertyValueException` - The given property value type does not match this variable size array property definition.
        `IndexOutOfBoundsException` - The given index is outside the acceptable range for the current size of the given array.
        `BadTypeException` - The given element is of the wrong type to be inserted into the array.
      See Also:
        `TypeDefinitionVariableArray.appendElement(PropertyValue, PropertyValue)`, `TypeDefinitionVariableArray.prependElement(PropertyValue, PropertyValue)`, `TypeDefinitionVariableArray.setElementAt(PropertyValue, int, PropertyValue)`

    - #### prependElement

          public void prependElement(PropertyValue arrayProperty,
                                     PropertyValue element)
                              throws NullPointerException,
                                     IllegalPropertyValueException,
                                     BadTypeException

      Description copied from interface: `TypeDefinitionVariableArray`

      Prepends a given element to the beginning of the given array.

      Specified by:
        `prependElement` in interface `TypeDefinitionVariableArray`
      Parameters:
        `arrayProperty` - Property value of the array to be extended.
        `element` - Element to add to the beginning of the given array.
      Throws:
        `NullPointerException` - The given array property value and/or the given element value is/are `null`.
        `IllegalPropertyValueException` - The given property value type does not match this variable size array property definition.
        `BadTypeException` - The given element is not of the correct type to be inserted into this array.
      See Also:
        `TypeDefinitionVariableArray.appendElement(PropertyValue, PropertyValue)`, `TypeDefinitionVariableArray.insertElement(PropertyValue, int, PropertyValue)`

    - #### removeElement

          public void removeElement(PropertyValue arrayProperty,
                                    int index)
                             throws NullPointerException,
                                    IllegalPropertyValueException,
                                    IndexOutOfBoundsException

      Description copied from interface: `TypeDefinitionVariableArray`

      Removes an element from the given array at the given zero-based index. On successful element removal, the indices elements beyond the given index will reduced by one.

      Specified by:
        `removeElement` in interface `TypeDefinitionVariableArray`
      Parameters:
        `arrayProperty` - Property value of the array to be modified.
        `index` - 0-based index of the element to be removed from the given array.
      Throws:
        `NullPointerException` - The given array property value is `null`.
        `IllegalPropertyValueException` - The given property value type does not match this variable size array property definition.
        `IndexOutOfBoundsException` - The given index is outside the acceptable range for the current size of the given array.

    - #### setElementAt

          public void setElementAt(PropertyValue arrayProperty,
                                   int index,
                                   PropertyValue element)
                            throws NullPointerException,
                                   IllegalPropertyValueException,
                                   IndexOutOfBoundsException,
                                   BadTypeException

      Description copied from interface: `TypeDefinitionVariableArray`

      Sets an element of the given array at the given index with the given value, replacing the value that is currently stored.

      Specified by:
        `setElementAt` in interface `TypeDefinitionVariableArray`
      Parameters:
        `arrayProperty` - Property value containing the array to be modified.
        `index` - Index into the given array of the element to be replaced by the given value.
        `element` - Value to set at the given index in the given array.
      Throws:
        `NullPointerException` - The given array property value and/or the given element is/are `null`.
        `IllegalPropertyValueException` - The given property value type does not match this variable size array property definition.
        `IndexOutOfBoundsException` - The given index is outside the acceptable range for the current size of the given array.
        `BadTypeException` - The given element type is not compatible with the element type of this array.
      See Also:
        `TypeDefinitionVariableArray.insertElement(PropertyValue, int, PropertyValue)`

    - #### setArray

          public void setArray(PropertyValue arrayProperty,
                               Object[] data)
                        throws NullPointerException,
                               IllegalPropertyValueException,
                               ClassCastException

      Description copied from interface: `TypeDefinitionVariableArray`

      Sets the elements of a given array from the given array of Java objects. The type definition returned by `TypeDefinitionVariableArray.getType()` must be able to transform each of the objects in the given Java array into the appropriate type, otherwise a `IllegalPropertyValueException` will be thrown.

      Specified by:
        `setArray` in interface `TypeDefinitionVariableArray`
      Parameters:
        `arrayProperty` - Property containing the array to have its data set.
        `data` - List of Java objects to set as the elements of the given array.
      Throws:
        `NullPointerException` - The given array property argument is `null`.
        `IllegalPropertyValueException` - The given property value type does not match this variable size array property definition.
        `ClassCastException` - It is not possible to cast one or more of the given Java objects to a type compatible with this type definition.
      See Also:
        `TypeDefinition.createValue(Object)`, `TypeDefinitionVariableArray.setArray(PropertyValue, List)`

    - #### setArray

          public void setArray(PropertyValue arrayProperty,
                               List<Object> data)
                        throws NullPointerException,
                               IllegalPropertyValueException,
                               ClassCastException

      Description copied from interface: `TypeDefinitionVariableArray`

      Sets the elements of a given array from the given list of Java objects. The type definition returned by `TypeDefinitionVariableArray.getType()` must be able to transform each of the objects in the given Java array into the appropriate type, otherwise a `IllegalPropertyValueException` will be thrown.

      Specified by:
        `setArray` in interface `TypeDefinitionVariableArray`
      Parameters:
        `arrayProperty` - Property containing the array to have its data set.
        `data` - Array of Java objects to set as the elements of the given array.
      Throws:
        `NullPointerException` - The given array property value is `null`.
        `IllegalPropertyValueException` - The given property value type does not match this variable size array property definition.
        `ClassCastException` - It is not possible to cast one or more of the given Java objects to a type compatible with this type definition.
      See Also:
        `TypeDefinition.createValue(Object)`, `TypeDefinitionVariableArray.setArray(PropertyValue, Object[])`

    - #### createValue

          public PropertyValue createValue(Object javaValue)
                                    throws ClassCastException

      Description copied from class: `TypeDefinitionImpl`

      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.

      Specified by:
        `createValue` in interface `TypeDefinition`
      Specified by:
        `createValue` in class `TypeDefinitionImpl`
      Parameters:
        `javaValue` - Java object to use to create a property value of this type.
      Returns:
        Property value representing the given value.
      Throws:
        `ClassCastException` - The given object cannot be cast to a property value with this type definition.

    - #### getTypeCategory

          public TypeCategory getTypeCategory()

      Description copied from interface: `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`.

      Specified by:
        `getTypeCategory` in interface `TypeDefinition`
      Specified by:
        `getTypeCategory` in class `TypeDefinitionImpl`
      Returns:
        Type category to which the type definition belongs.
      See Also:
        `TypeCategory`

    - #### setPropertyValue

          public void setPropertyValue(MetadataObject metadataObject,
                                       PropertyDefinition property,
                                       PropertyValue value)
                                throws IllegalArgumentException,
                                       IllegalAccessException,
                                       InvocationTargetException

      Description copied from interface: `TypeDefinition`

      On the given metadata object, set the specified property to the given value. The property must be of this type.

      Specified by:
        `setPropertyValue` in interface `TypeDefinition`
      Specified by:
        `setPropertyValue` in class `TypeDefinitionImpl`
      Parameters:
        `metadataObject` - Object to set the value on.
        `property` - Property of the object to set.
        `value` - Value of this type to set the property value to.
      Throws:
        `IllegalArgumentException` - The given property value is not of this type.
        `IllegalAccessException` - Insufficient privileges to set properties on the given metadata object.
        `InvocationTargetException` - Problem encountered while calling the set method associated with the property for the given object.
      See Also:
        `TypeDefinition.getPropertyValue(MetadataObject, PropertyDefinition)`

    - #### createFromBytes

          public PropertyValue createFromBytes(ByteBuffer buffer)
                                        throws EndOfDataException

      Description copied from interface: `TypeDefinition`

      Create 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.

      Specified by:
        `createFromBytes` in interface `TypeDefinition`
      Overrides:
        `createFromBytes` in class `TypeDefinitionImpl`
      Parameters:
        `buffer` - Buffer to create a value from.
      Returns:
        Value of this type created from the given byte array.
      Throws:
        `EndOfDataException` - Insufficient bytes remaining in the given buffer to create a value of this type.
      See Also:
        `TypeDefinition.writeAsBytes(PropertyValue, ByteBuffer)`, `TypeDefinition.lengthAsBytes(PropertyValue)`

    - #### lengthAsBytes

          public long lengthAsBytes(PropertyValue value)
                             throws NullPointerException,
                                    IllegalPropertyValueException

      Description copied from interface: `TypeDefinition`

      Returns 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.

      Specified by:
        `lengthAsBytes` in interface `TypeDefinition`
      Overrides:
        `lengthAsBytes` in class `TypeDefinitionImpl`
      Parameters:
        `value` - Value to find the length of when serialized to bytes.
      Returns:
        Number of bytes used to represent the given value when serialized.
      Throws:
        `NullPointerException` - Cannot compute the serialized length of a `null` value.
        `IllegalPropertyValueException` - The given property value is not of this type.
      See Also:
        `TypeDefinition.writeAsBytes(PropertyValue, ByteBuffer)`, `TypeDefinition.createFromBytes(ByteBuffer)`

    - #### writeAsBytes

          public List<PropertyValue> writeAsBytes(PropertyValue value,
                                                  ByteBuffer buffer)
                                           throws NullPointerException,
                                                  IllegalPropertyValueException,
                                                  InsufficientSpaceException

      Description copied from interface: `TypeDefinition`

      Write 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)`.

      Specified by:
        `writeAsBytes` in interface `TypeDefinition`
      Overrides:
        `writeAsBytes` in class `TypeDefinitionImpl`
      Parameters:
        `value` - Value to write to the given buffer.
        `buffer` - Buffer to write the value to.
      Returns:
        List of any strongly referenced property values referenced from the new structure of bytes. Elements of this list will require separate serialization to the stream if the reference if to be resolved.
      Throws:
        `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.
      See Also:
        `TypeDefinition.writeAsStructuredStorageBytes(PropertyValue, ByteBuffer)`, `TypeDefinition.createFromBytes(ByteBuffer)`, `TypeDefinition.lengthAsBytes(PropertyValue)`

    - #### resolveReferences

          public boolean resolveReferences(PropertyValue value,
                                           Map<AUID,MetadataObject> referenceMap)
                                    throws NullPointerException,
                                           IllegalPropertyValueException

      Description copied from interface: `TypeDefinition`

      Resolve any unresolved object references using the given reference map. Unresolved object references occur when a value has been read from a file but not linked to its strong or weak values. This method only effects types that are references or contain references in collections, which are:

      - `TypeDefinitionWeakObjectReference`;
      - `TypeDefinitionStrongObjectReference`;
      - `TypeDefinitionVariableArray` with elements of one of the object reference types;
      - `TypeDefinitionSet` with elements of one of the object reference types.
      Specified by:
        `resolveReferences` in interface `TypeDefinition`
      Overrides:
        `resolveReferences` in class `TypeDefinitionImpl`
      Parameters:
        `value` - Value to resolve references for.
        `referenceMap` - Map of local identifications to values to be used for resolution.
      Returns:
        Have all references been resolved?
      Throws:
        `NullPointerException` - The value or reference map is/are `null`.
        `IllegalPropertyValueException` - The given property value is not of this type.

    - #### nameToAAFName

          public String nameToAAFName(String name)

      Overrides:
        `nameToAAFName` in class `TypeDefinitionImpl`

    - #### appendMetadictXML

          public void appendMetadictXML(Node metadict,
                                        String namespace,
                                        String prefix)

      Description copied from interface: `MetaDefinition`

      Append an XML representation of this meta definition to the given XML node.

      Specified by:
        `appendMetadictXML` in interface `MetaDefinition`
      Overrides:
        `appendMetadictXML` in class `MetaDefinitionImpl`
      Parameters:
        `metadict` - Meta dictionary node to append a description of this node to.
      See Also:
        `CommonConstants.AAF_METADICT_NAMESPACE`

    - #### clone

          public TypeDefinitionVariableArray clone()

      Description copied from interface: `MetaDefinition`

      Create a cloned copy of this meta definition.

      Specified by:
        `clone` in interface `MetaDefinition`
      Specified by:
        `clone` in interface `TypeDefinition`
      Specified by:
        `clone` in interface `TypeDefinitionVariableArray`
      Overrides:
        `clone` in class `TypeDefinitionImpl`
      Returns:
        Cloned copy of this meta definition.

(c)2007-2016 Richard Cartwright, all rights reserved. Licensed under Apache 2 license and subject to the AMWA IPR policy.