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

tv.amwa.maj.industry

## Enum EmitXMLClassIDAs

- java.lang.Object
- - java.lang.Enum<EmitXMLClassIDAs>
  - - tv.amwa.maj.industry.EmitXMLClassIDAs

- All Implemented Interfaces:
    Serializable, Comparable<EmitXMLClassIDAs>

      public enum EmitXMLClassIDAs
      extends Enum<EmitXMLClassIDAs>

  Specifies how the class identifier for the type of an object should be included with that object when it is serialized to XML.

  Normally, an `ObjectClass` element is emitted as a child element for every interchange object. In certain cases, such as when the object has not been defined in a namespace that is not derived from the AAF namespace, it is desirable to emit the identifier as an attribute or to suppress it altogether.

  How the object's class identifier is to be emitted is controlled by the setting the emitXMLClassID property of the media class annotation. If the optional annotation property is omitted from a class, the default is `Parent`.

  See Also:
    `MediaClass.emitXMLClassID()`, `MediaEngine.getClassDefinition(MetadataObject)`, `MetaDefinition.getAUID()`

- - ### Enum Constant Summary

    Enum Constants
    Enum Constant and Description
    `Attribute` Emit the identifier of the class as an attribute of the element.
    `Element` Emit the identifier of the class as an child element of its serialization to XML called `ObjectClass`.
    `Parent` Emit the same class identification for this element as for its parent in the class hierarchy.
    `Suppressed` Do not emit the identifier of the class in any form.

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static EmitXMLClassIDAs` | `valueOf(String name)` Returns the enum constant of this type with the specified name.
    `static EmitXMLClassIDAs[]` | `values()` Returns an array containing the constants of this enum type, in the order they are declared.

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

      `compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

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

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

- - ### Enum Constant Detail

    - #### Element

          public static final EmitXMLClassIDAs Element

      Emit the identifier of the class as an child element of its serialization to XML called `ObjectClass`. This is the default approach and results in XML of the form:

             <NetworkLocator>
               <ObjectClass>urn:smpte:ul:060e2b34.02060101.0d010101.01013200</ObjectClass>
               <URL>http://www.portability4media.com/demo</URL>
             </NetworkLocator>

    - #### Attribute

          public static final EmitXMLClassIDAs Attribute

      Emit the identifier of the class as an attribute of the element. The attribute is named `uid`. This results in XML of the form:

             <NetworkLocator uid="urn:smpte:ul:060e2b34.02060101.0d010101.01013200">
               <URL>http://www.portability4media.com/demo</URL>
             </NetworkLocator>

    - #### Suppressed

          public static final EmitXMLClassIDAs Suppressed

      Do not emit the identifier of the class in any form. In this case, it is assumed that an XML schema is providing sufficient identification. This results in XML of the form:

             <NetworkLocator>
               <URL>http://www.portability4media.com/demo</URL>
             </NetworkLocator>

      See Also:
        `CommonConstants.ObjectClassID`

    - #### Parent

          public static final EmitXMLClassIDAs Parent

      Emit the same class identification for this element as for its parent in the class hierarchy. The root of the type hierarchy will default to `Element` if this method is set.

      See Also:
        `ClassDefinition.getParent()`

  - ### Method Detail

    - #### values

          public static EmitXMLClassIDAs[] values()

      Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:

          for (EmitXMLClassIDAs c : EmitXMLClassIDAs.values())
              System.out.println(c);

      Returns:
        an array containing the constants of this enum type, in the order they are declared

    - #### valueOf

          public static EmitXMLClassIDAs valueOf(String name)

      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
        `name` - the name of the enum constant to be returned.
      Returns:
        the enum constant with the specified name
      Throws:
        `IllegalArgumentException` - if this enum type has no constant with the specified name
        `NullPointerException` - if the argument is null

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