Skip navigation links
Media Authoring with Java API (MAJ)

Package tv.amwa.maj.extensions.example

Example code demonstrating an extension built with the auto generator.

See: Description

Package tv.amwa.maj.extensions.example Description

Example code demonstrating an extension built with the auto generator.

The input to the auto generator was the "SimpleExtension.xml" file. The "Main.java" class produces the output in "MainOut.xml". These are both shown below:

Cut down Main.java:

public static void main(String[] args) {

    EgFactory.initialize();
    SimpleDescription description = EgFactory.make("SimpleDescription",
            "Title", "Test Description",
            "Identifier", "123/456/789/000",
            "DateAccepted", "2011-01-13",
            "Creator", EgFactory.make("Person",
                    "Name", "Richard Rogers",
                    "DOB", Forge.makeDate((byte) 11, (byte) 10, (short) 2003)));
    System.out.println(description.toString());
}

Running the above produces:

<?xml version="1.0" encoding="UTF-8"?>
<eg:SimpleDescription xmlns:eg="http://amwa.tv/maj/extensions/example">
  <eg:Identifier>123/456/789/000</eg:Identifier>
  <eg:Title>Test Description</eg:Title>
  <eg:Creator>
    <eg:Person>
      <eg:Name>Richard Rogers</eg:Name>
      <eg:DOB>2003-10-11+0000</eg:DOB>
    </eg:Person>
  </eg:Creator>
  <eg:DateAccepted>2011-01-13+0000</eg:DateAccepted>
</eg:SimpleDescription>
See Also:
AutoGeneration
Skip navigation links
Media Authoring with Java API (MAJ)

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