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

tv.amwa.maj.meta

## Interface TypeDefinitionObjectReference

- All Superinterfaces:
    MetadataObject, MetaDefinition, TypeDefinition, WeakReferenceTarget
  All Known Subinterfaces:
    TypeDefinitionStrongObjectReference, TypeDefinitionWeakObjectReference
  All Known Implementing Classes:
    TypeDefinitionObjectReferenceImpl, TypeDefinitionStrongObjectReferenceImpl, TypeDefinitionWeakObjectReferenceImpl

      public interface TypeDefinitionObjectReference
      extends TypeDefinition

  Specifies the definition of a property type that defines an object relationship.

  THE COMMENTS FOR THIS CLASS ARE INCOMPLETE.

  See Also:
    `TypeDefinitionStrongObjectReference`, `TypeDefinitionWeakObjectReference`

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `TypeDefinitionObjectReference` | `clone()` Create a cloned copy of this object reference type definition.
    `PropertyValue` | `createValue(Object object)` Creates and returns a new object reference property value to reference the given object.
    `Object` | `getObject(PropertyValue propertyValue)` Returns the object referenced by the given object reference property value.
    `ClassDefinition` | `getObjectType()` Returns the class definition representing the class of objects to which this object reference type definition can refer.
    `void` | `setObject(PropertyValue propertyValue, Object object)` Sets the given object as the target of the given object reference property value.

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

      `createFromBytes, getPropertyValue, getTypeCategory, lengthAsBytes, resolveReferences, setPropertyValue, writeAsBytes, writeAsStructuredStorageBytes`

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

      `appendMetadictXML, 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`

- - ### Method Detail

    - #### getObjectType

          ClassDefinition getObjectType()

      Returns the class definition representing the class of objects to which this object reference type definition can refer. The returned definition is the least-derived type that it is permissible to represent, in other words the type definition can represent objects of the given class and any of its sub-classes.

      Returns:
        Class definition representing the class of objects to which property values of the object reference type can refer.

    - #### createValue

          PropertyValue createValue(Object object)
                             throws NullPointerException,
                                    ClassCastException

      Creates and returns a new object reference property value to reference the given object.

      Specified by:
        `createValue` in interface `TypeDefinition`
      Parameters:
        `object` - Object to use to create an object reference property value.
      Returns:
        Newly created object reference property value that references the given object.
      Throws:
        `NullPointerException` - The given object is `null`.
        `ClassCastException` - The given object cannot be cast to one compatible with the permissible classes, as returned by `getObjectType()`.
      See Also:
        `setObject(PropertyValue, Object)`

    - #### getObject

          Object getObject(PropertyValue propertyValue)
                    throws NullPointerException,
                           IllegalPropertyValueException

      Returns the object referenced by the given object reference property value.

      Parameters:
        `propertyValue` - Property value form which the value is to be read.
      Throws:
        `NullPointerException` - The given property value containing a reference is `null`.
        `IllegalPropertyValueException` - The given property value is not defined by this object reference type.

    - #### setObject

          void setObject(PropertyValue propertyValue,
                         Object object)
                  throws NullPointerException,
                         IllegalPropertyValueException,
                         ClassCastException

      Sets the given object as the target of the given object reference property value.

      Parameters:
        `propertyValue` - Property value containing the object reference to be set.
        `object` - Target of the object reference to set for the given property value.
      Throws:
        `NullPointerException` - Argument is null.
        `IllegalPropertyValueException` - The given property value is not defined by this object reference type.
        `ClassCastException` - The given object cannot be cast to one compatible with the permissible classes, as returned by `getObjectType()`.
      See Also:
        `createValue(Object)`

    - #### clone

          TypeDefinitionObjectReference clone()

      Create a cloned copy of this object reference type definition.

      Specified by:
        `clone` in interface `MetaDefinition`
      Specified by:
        `clone` in interface `TypeDefinition`
      Returns:
        Cloned copy of this object reference type definition.

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