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

tv.amwa.maj.industry

## Annotation Type MediaClass

-     @Documented
       @Retention(value=RUNTIME)
       @Target(value=TYPE)
      public @interface MediaClass

  Labels a Java class as one suitable for use as an AAF specified class, extension class or class from another namespace compatible with SMPTE registration. It must be possible to derive the AAF meta-class definition from the annotations provided. A class using the annotation must also have any get methods used to retrieve the value of properties annotated with `MediaProperty`.

  Aspects of the structure of the Java implementation are used to provide the data used to create a class definition. This includes:

  - If the annotated class is a root class in a class hierarchy, the class definition will have a parent that references itself.
  - Otherwise, the class definition will have a parent that is the class definition of its Java parent. As a side effect, the parent Java class must also be labelled with this annotation.
  - If the annotated class is abstract, its class definition will also be abstract.
  - All the `MediaProperty` annotations within the annotated Java class become properties of the class definition.

  This information is collected on the first call to `Warehouse.lookForClass(Class)` for any Java class labelled with this annotation. A lookup table of this data is help statically within the running virtual machine.

  A symbol name must be provided which will be used to name an element when writing the class to an XML file. Normally, the namespace for the element will be the same for the parent class in the class hierarchy. A namespace can be specified to override this if required.

  See Also:
    `ClassDefinition`, `Warehouse.lookForClass(Class)`, `Warehouse.lookForClass(String)`, `InterchangeObject.getObjectClass()`, `AAFSpecifiedClasses`, `TypeDefinitions.ClassDefinitionWeakReference`, `TypeDefinitions.ClassDefinitionStrongReference`

- - ### Required Element Summary

    Required Elements
    Modifier and Type | Required Element and Description
    --- | ---
    `String` | `definedName`
    `String` | `symbol` Provides the registered symbol used for this class when serialized to XML.
    `int` | `uuid1`
    `int` | `uuid2`
    `int` | `uuid3`
    `byte[]` | `uuid4`

  - ### Optional Element Summary

    Optional Elements
    Modifier and Type | Optional Element and Description
    --- | ---
    `String[]` | `aliases` Alternative names that this class may be known by.
    `String` | `description` Provides a description of the class.
    `EmitXMLClassIDAs` | `emitXMLClassID` Determines how the class identifier of an XML element is serialized.
    `boolean` | `isConcrete` Is this class a concrete class? If the Java class is abstract then the class definition record will be set to `false`.
    `String` | `namespace` Provides the XML namespace for this class.
    `String` | `prefix` Provides the XML namespace prefix abbreviation for this class.

- - ### Element Detail

    - #### uuid1

          public abstract int uuid1

  - - #### uuid2

          public abstract int uuid2

  - - #### uuid3

          public abstract int uuid3

  - - #### uuid4

          public abstract byte[] uuid4

  - - #### definedName

          public abstract String definedName

  - - #### symbol

          public abstract String symbol

      Provides the registered symbol used for this class when serialized to XML. The symbol should not include a namespace declaration. Symbols must be unique within a namespace.

      Returns:
        Registered symbol for the class.
      See Also:
        `namespace()`

  - - #### aliases

          public abstract String[] aliases

      Alternative names that this class may be known by. The namespace for class names is flat so take care not to overwrite the definition of another class. A warning will be generated if an alias overwrites a defined class name.

      As an example, the root of the main AAF class hierarchy is defined as InterchangeObject and is known by the alias AAFObject in the C-based reference implementation.

      Returns:
        List of alternative names for this class.
      Default:
        {}

  - - #### description

          public abstract String description

      Provides a description of the class.

      Returns:
        Description of the class.
      See Also:
        `MediaProperty.description()`
      Default:
        ""

  - - #### namespace

          public abstract String namespace

      Provides the XML namespace for this class. If none is defined, the one for the parent class is used. Any member properties or child classes of the annotated class will share the same namespace unless this is overwritten. When serialized to XML, the class will have the following `xmlns:` attribute included in its element name:

      `xmlns:`<namespaceAbbreviation>`="`<namespace>`"`
      Returns:
        Registered XML namespace for an element representing this class.
      See Also:
        `prefix()`, `symbol()`, `ExtensionScheme.getSchemeURI()`, `MetaDefinition.getNamespace()`
      Default:
        ""

  - - #### prefix

          public abstract String prefix

      Provides the XML namespace prefix abbreviation for this class. If none is defined, the one for the parent class is used. Any member properties or child classes of the annotated class will share the same namespace unless this is overwritten. When serialized to XML, the class will have the following `xmlns:` attribute included in its element name:

      `xmlns:`<namespaceAbbreviation>`="`<namespace>`"`
      Returns:
        Registered XML namespace for an element representing this class.
      See Also:
        `namespace()`, `ExtensionScheme.getPreferredPrefix()`, `MetaDefinition.getPrefix()`
      Default:
        ""

  - - #### emitXMLClassID

          public abstract EmitXMLClassIDAs emitXMLClassID

      Determines how the class identifier of an XML element is serialized. For details, see the description of the associated `EmitXMLClassIDAs` enumeration.

      Returns:
        How the class identifier of an XML element is serialized.
      Default:
        tv.amwa.maj.industry.EmitXMLClassIDAs.Parent

  - - #### isConcrete

          public abstract boolean isConcrete

      Is this class a concrete class? If the Java class is abstract then the class definition record will be set to `false`. Otherwise, this annotation field will be used to determine the status of the class.

      Returns:
        Will be `true` if the defined class is concrete, otherwise `false`.
      Default:
        true

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