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

tv.amwa.maj.model

## Interface TaggedValue

- All Superinterfaces:
    InterchangeObject, MediaEntity, MetadataObject
  All Known Subinterfaces:
    TaggedValue
  All Known Implementing Classes:
    TaggedValueImpl

      public interface TaggedValue
      extends InterchangeObject

  Specifies a user defined tag and value pair.

  The value is of indirect type and the MAJ API provides methods that map values from Java objects to and from indirect type values. These mechanisms are hidden behind the `getIndirectValue()` and `setIndirectValue(PropertyValue)` methods.

  A common type for data values is string and both the package and component interfaces specify shortcut methods to create string comments and attributes. For example, `Package.appendPackageUserComment(String, String)` and `Component.appendComponentAttribute(String, String)`.

  See Also:
    `TaggedValueDefinition`, `Dictionary.getTaggedValueDefinitions()`, `Package.getPackageAttributes()`, `Package.getPackageUserComments()`, `Component.getComponentAttributes()`, `Component.getComponentUserComments()`, `TypeDefinitions.TaggedValueStrongReference`, `TypeDefinitions.TaggedValueStrongReferenceVector`

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `TaggedValue` | `clone()` Create a cloned copy of this tagged value.
    `TypeDefinition` | `getIndirectTypeDefinition()` Returns the type of the user-defined indirect value.
    `PropertyValue` | `getIndirectValue()` Returns the user-defined value of this tagged value as a property value.
    `String` | `getTag()` Returns the tag name property of this tagged value, which is a user-defined tag.
    `void` | `setIndirectValue(PropertyValue indirectValue)` Sets the user-defined indirect value of this tagged value.

    - ### Methods inherited from interface tv.amwa.maj.model.InterchangeObject

      `addApplicationPlugin, clearApplicationPlugins, containsApplicationPlugin, containsApplicationPlugin, countApplicationPlugins, deepEquals, disableGenerationTracking, enableGenerationTracking, equals, getApplicationPlugins, getGeneration, getLinkedGenerationID, getObjectClass, isGenerationTracked, removeApplicationPlugin, removeApplicationPlugin, setLinkedGenerationID, setObjectClass, toString`

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

      `getPersistentID, setPersistentIndex`

- - ### Method Detail

    - #### getTag

          @AAFString
          String getTag()

      Returns the tag name property of this tagged value, which is a user-defined tag.

      Returns:
        Name property of this tagged value.

    - #### getIndirectTypeDefinition

          TypeDefinition getIndirectTypeDefinition()

      Returns the type of the user-defined indirect value.

      Returns:
        Type definition for this tagged value.
      See Also:
        `getIndirectValue()`, `TypeDefinitionIndirect`, `TypeDefinitionIndirect.getActualValue(PropertyValue)`, `PropertyValue.getType()`

    - #### getIndirectValue

          PropertyValue getIndirectValue()

      Returns the user-defined value of this tagged value as a property value.

      The type of the returned value can be found be calling `PropertyValue.getType()`. Methods of the type definition returned can be used to access the value. Alternatively, you can access the value directly by calling `PropertyValue.getValue()`.

      Returns:
        Indirect value of this tagged value.
      See Also:
        `getIndirectTypeDefinition()`, `TypeDefinitionIndirect`, `TypeDefinitionIndirect.getActualValue(PropertyValue)`, `PropertyValue.getValue()`

    - #### setIndirectValue

          void setIndirectValue(PropertyValue indirectValue)
                         throws NullPointerException

      Sets the user-defined indirect value of this tagged value.

      To create an indirect value, use the `createValue()` method of any type definition. Alternatively, you can retrieve the value of any other property using its property definition. To retrieve the property value of a property called foo from an instance called bar:

                ClassDefinition barClassDef =
                    ClassDefinitionWarehouse.forClass(bar.getClass());
                PropertyDefinition fooDefinition =
                    barClassDef.lookupPropertyDefinition("foo");
                PropertyValue fooValue =
                   fooDefinition.getPropertyValue(bar);

      Parameters:
        `indirectValue` - Indirect value of this tagged value.
      Throws:
        `NullPointerException` - The given user-defined value is `null`.
      See Also:
        `TypeDefinitionIndirect`, `TypeDefinition.createValue(Object)`, `Warehouse.lookForType(String)`, `PropertyDefinition.getPropertyValue(MetadataObject)`

    - #### clone

          TaggedValue clone()

      Create a cloned copy of this tagged value.

      Specified by:
        `clone` in interface `InterchangeObject`
      Specified by:
        `clone` in interface `MediaEntity`
      Returns:
        Cloned copy of this tagged value.

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