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

tv.amwa.maj.meta.impl

## Class TypeDefinitionStringImpl

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

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

      @MediaClass(uuid1=218169601,
                  uuid2=523,
                  uuid3=0,
                  uuid4={6,14,43,52,2,6,1,1},
                  definedName="TypeDefinitionString",
                  description="The TypeDefinitionString class defines a property type that consists of a zero-terminated array of the underlying character or integer type.",
                  symbol="TypeDefinitionString")
      public final class TypeDefinitionStringImpl
      extends SingletonTypeDefinitionImpl
      implements TypeDefinitionString, Serializable, Cloneable

  Implements the definition of a property type that consists, effectively, of an array of the underlying character or integer type. In the MAJ API, all strings are represented as Java strings.

  See Also:
    Serialized Form

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `TypeDefinitionStringImpl.BaseStringValue` Base representation for all property values representing string values.
    `static class` | `TypeDefinitionStringImpl.ByteArrayStringValue` Property value for strings with an underlying element type of `TypeDefinitionIntegerImpl`.
    `static class` | `TypeDefinitionStringImpl.CharacterStringValue` Property value for strings with an underlying element type of `TypeDefinitionCharacterImpl`.

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

      `SingletonTypeDefinitionImpl.SingletonMethodBag`

    - ### 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
    `TypeDefinitionStringImpl(AUID identification, String typeName, TypeDefinition typeDefinition)` Creates and initializes the string type definition with its identity and the underlying data representation.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `appendElements(PropertyValue stringProperty, Buffer elements)` Append to the string value of the given property value using a data buffer.
    `void` | `appendElements(PropertyValue stringProperty, PropertyValue[] elements)` Append to the string value of the given property value using the array of property value elements.
    `void` | `appendMetadictXML(Node metadict, String namespace, String prefix)` Append an XML representation of this meta definition to the given XML node.
    `void` | `appendString(PropertyValue stringProperty, Buffer extension)` Appends the given data buffer to the string of the given property value.
    `void` | `appendString(PropertyValue stringProperty, String extension)` Appends the given Java String to the string of the given property value.
    `TypeDefinitionString` | `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` | `createValueFromString(Buffer initData)` Create a new string type property value consistent with this type definition from the given data buffer.
    `PropertyValue` | `createValueFromString(String initData)` Create a new string type property value consistent with this type definition from the given Java string.
    `String` | `getCharacterSet()` Returns the character set that will be used for conversion between a Java string and this string type definition.
    `int` | `getCount(PropertyValue stringProperty)` Returns the length of the string contained in the given string property value, measured in the number of characters.
    `Buffer` | `getElements(PropertyValue stringProperty)` Returns the value of the given string property as a data buffer consistent with the element type of this string type definition.
    `TypeDefinition` | `getElementType()` Returns the underlying AAF type used to represent characters of a string of this string type definition.
    `PropertyValue[]` | `getPropertyValues(PropertyValue stringProperty)` Returns the value of the given string property as an array of property values of a compatible type to the string type definition, as returned by `TypeDefinitionString.getElementType()`.
    `String` | `getString(PropertyValue stringProperty)` Returns the value of the given string property as a Java string.
    `TypeCategory` | `getTypeCategory()` Returns the type category to which this type definition belongs, which corresponds to its sub interface.
    `static TypeDefinition` | `initializeStringElementType()`
    `long` | `lengthAsBytes(PropertyValue value)` Returns the number of bytes that the given value of this type is serialized as a sequence of bytes.
    `void` | `setCharacterSet(String charSet)` Set the character set that will be used for conversion between a Java string and this string type definition.
    `void` | `setElementType(TypeDefinition type)` Set the underlying array element type of this string type definition.
    `void` | `setString(PropertyValue stringProperty, Buffer data)` Set the value of the string contained in the given string property value to the given data buffer.
    `void` | `setString(PropertyValue stringProperty, String data)` Set the value of the string contained in the given string property value to the given Java string 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.SingletonTypeDefinitionImpl

      `setPropertyValue`

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

      `getNamespace, getPrefix, getPropertyValue, initalizeTypeNameMap, nameToAAFName, resolveReferences, 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, resolveReferences, setPropertyValue, 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`

- - ### Constructor Detail

    - #### TypeDefinitionStringImpl

          public TypeDefinitionStringImpl(AUID identification,
                                          @AAFString
                                          String typeName,
                                          TypeDefinition typeDefinition)
                                   throws NullPointerException,
                                          IllegalArgumentException

      Creates and initializes the string type definition with its identity and the underlying data representation. Acceptable underlying type definitions are:

      - `TypeDefinitionInteger`
      - `TypeDefinitionCharacter`

      It is anticipated that most Java versions of this interface will be choose `TypeDefinitionCharacterImpl` and will use Java string handling in their implementation. However, by using a call to `setCharacterSet(String)` it is possible to define mappings between different character sets to and from Java strings.

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

      Parameters:
        `identification` - AUID to be used to identify this type.
        `typeName` - Friendly name for the string data type.
        `typeDefinition` - Type of each element to be contained in the array.
      Throws:
        `NullPointerException` - The identification and/or type definition arguments is/are `null`.
        `IllegalArgumentException` - The given type is not an acceptable underlying type for a string type definition.

  - ### Method Detail

    - #### appendElements

          public void appendElements(PropertyValue stringProperty,
                                     PropertyValue[] elements)
                              throws NullPointerException,
                                     IllegalPropertyValueException,
                                     BadTypeException,
                                     BadSizeException

      Description copied from interface: `TypeDefinitionString`

      Append to the string value of the given property value using the array of property value elements. Each element of the given array must match the type definition returned by `TypeDefinitionString.getElementType()`.

      Specified by:
        `appendElements` in interface `TypeDefinitionString`
      Parameters:
        `stringProperty` - Property value containing a string to be extended.
        `elements` - Array of property value elements to use to extend the given string.
      Throws:
        `NullPointerException` - One or both of the arguments is/are `null`, or one or more of the values of the given array is `null`.
        `IllegalPropertyValueException` - The given string property value is not of this string type definition.
        `BadTypeException` - One or more of the elements of the given array of property values is of an incompatible type.
        `BadSizeException` - The number of bytes per integer of the underlying element type of this string type definition is not supported by this implementation.
      See Also:
        `TypeDefinitionString.appendElements(PropertyValue, Buffer)`, `TypeDefinitionString.appendString(PropertyValue, String)`

    - #### appendElements

          public void appendElements(PropertyValue stringProperty,
                                     Buffer elements)
                              throws NullPointerException,
                                     IllegalArgumentException,
                                     IllegalPropertyValueException

      Description copied from interface: `TypeDefinitionString`

      Append to the string value of the given property value using a data buffer. Any character set conversion required takes place using the character set returned by `TypeDefinitionString.getCharacterSet()`. An attempt to pass in a `null` buffer will result in no change to the property value and no error.

      The buffer of data must be one of the following types:

      - `ByteBuffer`
      - `ShortBuffer`
      - `IntBuffer`
      - `LongBuffer`
      - `CharBuffer`

      Any other buffer types will result in an `IllegalArgumentException`.

      This method has the same behaviour as `TypeDefinitionString.appendString(PropertyValue, Buffer)`.

      Specified by:
        `appendElements` in interface `TypeDefinitionString`
      Parameters:
        `stringProperty` - Property value containing a string value to append the given elements to.
        `elements` - Buffer containing values to be appended to to the given property value.
      Throws:
        `NullPointerException` - The given string property argument is `null`.
        `IllegalArgumentException` - The given buffer must be of an appropriate type for conversion to the underlying element type for this string type definition.
        `IllegalPropertyValueException` - The given string property type does not match this type definition.
      See Also:
        `TypeDefinitionString.appendElements(PropertyValue, PropertyValue[])`, `TypeDefinitionString.appendString(PropertyValue, String)`

    - #### getCount

          public int getCount(PropertyValue stringProperty)
                       throws NullPointerException,
                              IllegalPropertyValueException

      Description copied from interface: `TypeDefinitionString`

      Returns the length of the string contained in the given string property value, measured in the number of characters.

      Specified by:
        `getCount` in interface `TypeDefinitionString`
      Parameters:
        `stringProperty` - Property value containing a string to determine the length of.
      Returns:
        Number of characters in the given string.
      Throws:
        `NullPointerException` - The given string property value is `null`.
        `IllegalPropertyValueException` - The given string property value type does not match this string type definition.
      See Also:
        `String.length()`

    - #### getElements

          public Buffer getElements(PropertyValue stringProperty)
                             throws NullPointerException,
                                    IllegalPropertyValueException,
                                    BadSizeException

      Description copied from interface: `TypeDefinitionString`

      Returns the value of the given string property as a data buffer consistent with the element type of this string type definition. Any character set conversion required takes place using the character set returned by `TypeDefinitionString.getCharacterSet()`. If the internal representation of the string property value is `null` then this method will return `null`.

      Note that a `null` character will not be inserted as the last byte of the buffer.

      Specified by:
        `getElements` in interface `TypeDefinitionString`
      Parameters:
        `stringProperty` - Property value containing the string to convert.
      Returns:
        Data buffer representation of the given value.
      Throws:
        `NullPointerException` - The given string property value is `null`.
        `IllegalPropertyValueException` - The given string property type does not match this string property value.
        `BadSizeException` - The number of bytes per integer of the underlying element type of this string type definition is not supported by this implementation.
      See Also:
        `TypeDefinitionString.setString(PropertyValue, Buffer)`, `TypeDefinitionString.getString(PropertyValue)`

    - #### getString

          public String getString(PropertyValue stringProperty)
                           throws NullPointerException,
                                  IllegalPropertyValueException

      Description copied from interface: `TypeDefinitionString`

      Returns the value of the given string property as a Java string.

      Specified by:
        `getString` in interface `TypeDefinitionString`
      Parameters:
        `stringProperty` - Property value containing the string to convert.
      Returns:
        Java String representation of the given value, which could be a `null` string.
      Throws:
        `NullPointerException` - The given string property value is `null`.
        `IllegalPropertyValueException` - The given string property is not of this string type definition.

    - #### getPropertyValues

          public PropertyValue[] getPropertyValues(PropertyValue stringProperty)
                                            throws NullPointerException,
                                                   IllegalPropertyValueException,
                                                   BadSizeException

      Description copied from interface: `TypeDefinitionString`

      Returns the value of the given string property as an array of property values of a compatible type to the string type definition, as returned by `TypeDefinitionString.getElementType()`.

      Specified by:
        `getPropertyValues` in interface `TypeDefinitionString`
      Parameters:
        `stringProperty` - Property value containing the string to convert.
      Returns:
        Java String representation of the given value.
      Throws:
        `NullPointerException` - The given string property value is `null`.
        `IllegalPropertyValueException` - The type of the given string property value does not match this string type definition.
        `BadSizeException` - The number of bytes per integer of the underlying element type of this string type definition is not supported by this implementation.
      See Also:
        `TypeDefinitionString.appendElements(PropertyValue, PropertyValue[])`

    - #### getElementType

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

      Description copied from interface: `TypeDefinitionString`

      Returns the underlying AAF type used to represent characters of a string of this string type definition.

      Specified by:
        `getElementType` in interface `TypeDefinitionString`
      Returns:
        Underlying type used to represent characters of a string of this string type definition.

    - #### setElementType

          @MediaPropertySetter(value="StringElementType")
          public void setElementType(TypeDefinition type)
                                                                              throws NullPointerException,
                                                                                     IllegalArgumentException

      Set the underlying array element type of this string type definition. The element type must either be a `integer type definition` or a `character type definition`, otherwise a `IllegalArgumentException` will be thrown.

      Parameters:
        `type` - Underlying array element type of this string type definition.
      Throws:
        `NullPointerException` - Argument is null.
        `IllegalArgumentException` - The given type definition is not of integer or character type.

    - #### initializeStringElementType

          public static final TypeDefinition initializeStringElementType()

    - #### appendString

          public void appendString(PropertyValue stringProperty,
                                   String extension)
                            throws NullPointerException,
                                   IllegalPropertyValueException

      Description copied from interface: `TypeDefinitionString`

      Appends the given Java String to the string of the given property value. Any character set conversion required takes place using the character set returned by `TypeDefinitionString.getCharacterSet()`. An attempt to pass a `null` string will result in no change to the property value and no error.

      Specified by:
        `appendString` in interface `TypeDefinitionString`
      Parameters:
        `stringProperty` - Property value containing the string to extend.
        `extension` - String to append to the end of the given property value.
      Throws:
        `NullPointerException` - The given string property argument is `null`.
        `IllegalPropertyValueException` - The given string property value type does not match this string type definition.
      See Also:
        `TypeDefinitionString.appendString(PropertyValue, Buffer)`, `TypeDefinitionString.appendElements(PropertyValue, PropertyValue[])`

    - #### createValueFromString

          public PropertyValue createValueFromString(String initData)

      Description copied from interface: `TypeDefinitionString`

      Create a new string type property value consistent with this type definition from the given Java string. Conversion to the underlying character type takes place according to the character set returned by `TypeDefinitionString.getCharacterSet()`. Setting a `null` value will result in the return of a property value with its internal string representation set to `null`.

      Specified by:
        `createValueFromString` in interface `TypeDefinitionString`
      Parameters:
        `initData` - Initial string data to create a new string property value.
      Returns:
        Newly created string property value from the given Java string.
      See Also:
        `TypeDefinitionString.createValueFromString(Buffer)`

    - #### createValueFromString

          public PropertyValue createValueFromString(Buffer initData)
                                              throws IllegalArgumentException

      Description copied from interface: `TypeDefinitionString`

      Create a new string type property value consistent with this type definition from the given data buffer. Any character set conversion required takes place using the character set returned by `TypeDefinitionString.getCharacterSet()`. Setting a `null` value will result in the return of a property value with its internal string representation set to `null`.

      The buffer of data must be one of the following types:

      - `ByteBuffer`
      - `ShortBuffer`
      - `IntBuffer`
      - `LongBuffer`
      - `CharBuffer`

      Any other buffer types will result in an `IllegalArgumentException`.

      Specified by:
        `createValueFromString` in interface `TypeDefinitionString`
      Parameters:
        `initData` - Initial string data to use to create a new string property value.
      Returns:
        Newly created string property value from the given buffer.
      Throws:
        `IllegalArgumentException` - The given buffer must be of an appropriate type for conversion to the underlying element type for this string type definition.
      See Also:
        `TypeDefinitionString.createValueFromString(Buffer)`

    - #### getCharacterSet

          public String getCharacterSet()

      Description copied from interface: `TypeDefinitionString`

      Returns the character set that will be used for conversion between a Java string and this string type definition. If a character set has not been provided by a user then the value returned will be the default Java character set of "`UTF-16`".

      Specified by:
        `getCharacterSet` in interface `TypeDefinitionString`
      Returns:
        Character set used for conversion between this string type and Java strings.
      See Also:
        `Charset`

    - #### setCharacterSet

          public void setCharacterSet(String charSet)
                               throws NullPointerException,
                                      IllegalCharsetNameException

      Description copied from interface: `TypeDefinitionString`

      Set the character set that will be used for conversion between a Java string and this string type definition. For information on valid character set names, see the relevant Java API documentation.

      Specified by:
        `setCharacterSet` in interface `TypeDefinitionString`
      Parameters:
        `charSet` - Character set used for conversion between this string type and Java strings.
      Throws:
        `NullPointerException` - The given character set name is `null`.
        `IllegalCharsetNameException`
      See Also:
        `Charset`

    - #### setString

          public void setString(PropertyValue stringProperty,
                                String data)
                         throws NullPointerException,
                                IllegalPropertyValueException

      Description copied from interface: `TypeDefinitionString`

      Set the value of the string contained in the given string property value to the given Java string value. Any character set conversion required takes place using the character set returned by `TypeDefinitionString.getCharacterSet()`. Setting a `null` value will result in the return of a property value with its internal string representation set to `null`.

      Specified by:
        `setString` in interface `TypeDefinitionString`
      Parameters:
        `stringProperty` - Property value to have its string value set.
        `data` - Value to set for the string type property value, represented as a Java String.
      Throws:
        `NullPointerException` - The given string property value is `null`.
        `IllegalPropertyValueException` - The given string property type does not match this string type definition.
      See Also:
        `TypeDefinitionString.getString(PropertyValue)`, `TypeDefinitionString.setString(PropertyValue, Buffer)`

    - #### setString

          public void setString(PropertyValue stringProperty,
                                Buffer data)
                         throws NullPointerException,
                                IllegalPropertyValueException,
                                IllegalArgumentException

      Description copied from interface: `TypeDefinitionString`

      Set the value of the string contained in the given string property value to the given data buffer. Any character set conversion required takes place using the character set returned by `TypeDefinitionString.getCharacterSet()`. Setting a `null` value will result in the return of a property value with its internal string representation set to `null`.

      The buffer of data must be one of the following types:

      - `ByteBuffer`
      - `ShortBuffer`
      - `IntBuffer`
      - `LongBuffer`
      - `CharBuffer`

      Any other buffer types will result in an `IllegalArgumentException`.

      Specified by:
        `setString` in interface `TypeDefinitionString`
      Parameters:
        `stringProperty` - Property value to have its string value set.
        `data` - Value to set for the string type property value, represented as a data buffer.
      Throws:
        `NullPointerException` - The given string property is `null`.
        `IllegalPropertyValueException` - The given string property type does not match this string type definition.
        `IllegalArgumentException` - The given buffer must be of an appropriate type for conversion to the underlying element type for this string type definition.
      See Also:
        `TypeDefinitionString.getElements(PropertyValue)`, `TypeDefinitionString.setString(PropertyValue, String)`

    - #### appendString

          public void appendString(PropertyValue stringProperty,
                                   Buffer extension)
                            throws NullPointerException,
                                   IllegalArgumentException,
                                   IllegalPropertyValueException

      Description copied from interface: `TypeDefinitionString`

      Appends the given data buffer to the string of the given property value. Any character set conversion required takes place using the character set returned by `TypeDefinitionString.getCharacterSet()`. An attempt to pass a `null` buffer will result in no change to the property value and no error.

      The buffer of data must be one of the following types:

      - `ByteBuffer`
      - `ShortBuffer`
      - `IntBuffer`
      - `LongBuffer`
      - `CharBuffer`

      Any other buffer types will result in an `IllegalArgumentException`.

      This method has the same behaviour as `TypeDefinitionString.appendElements(PropertyValue, Buffer)`.

      Specified by:
        `appendString` in interface `TypeDefinitionString`
      Parameters:
        `stringProperty` - Property value containing the string to extend.
        `extension` - Buffer of string data to use to extend the given property value.
      Throws:
        `NullPointerException` - The given string property value is `null`.
        `IllegalArgumentException` - The given buffer must be of an appropriate type for conversion to the underlying element type for this string type definition.
        `IllegalPropertyValueException` - The given string property value type does not match this string type definition.
      See Also:
        `TypeDefinitionString.appendElements(PropertyValue, PropertyValue[])`, `TypeDefinitionString.appendString(PropertyValue, String)`

    - #### 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`

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

    - #### createFromBytes

          public PropertyValue createFromBytes(ByteBuffer buffer)

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

    - #### 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 TypeDefinitionString 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 `TypeDefinitionString`
      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.