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

tv.amwa.maj.io.aaf

## Class AAFFactory

- java.lang.Object
- - tv.amwa.maj.io.aaf.AAFFactory

- All Implemented Interfaces:
    CommonConstants, AAFConstants

      public class AAFFactory
      extends Object
      implements AAFConstants

  Read and write AAF structured storage binary files to and from MAJ preface instances. Wherever possible, the methods of this class deal with understanding or constructing any necessary metadata dictionaries or dictionaries.

  Note that MAJ uses an extended version of the Apache POIFS library. MAJ can read big and little endian byte order files but only writes back in big endian.

- - ### Field Summary

    - ### Fields inherited from interface tv.amwa.maj.io.aaf.AAFConstants

      `AAFSignatureSSBin4K, AAFSignatureSSBin4KBytes, AAFSignatureSSBinary, AAFSignatureSSBinaryBytes, ByteOrderPropertyID, classNameAliases, directoryNameAliases, IdentificationGenerationIDProperty, LocalIdentificationProperty, MAP_SS_CLASS_NAMES, MAP_SS_DIRECTORY_NAMES, MAP_SS_PROPERTY_NAMES, MAP_SS_TYPE_NAMES, META_DICTIONARY_DIRNAME, MetaDefinitionIDProperty, ParametersID, PREFACE_DIRNAME, PROPERTIES_STREAMNAME, propertyNameAliases, REFERENCED_PROPERTIES_STREAMNAME, rootEntryClassID, RootMetaDictionaryProperty, RootPrefaceProperty, SF_DATA, SF_DATA_STREAM, SF_STRONG_OBJECT_REFERENCE, SF_STRONG_OBJECT_REFERENCE_SET, SF_STRONG_OBJECT_REFERENCE_VECTOR, SF_WEAK_OBJECT_REFERENCE, SF_WEAK_OBJECT_REFERENCE_SET, SF_WEAK_OBJECT_REFERENCE_VECTOR, STREAM_CHUNK_SIZE, typeNameAliases`

    - ### Fields inherited from interface tv.amwa.maj.constant.CommonConstants

      `AAF_METADICT_NAMESPACE, AAF_METADICT_PREFIX, AAF_XML_NAMESPACE, AAF_XML_PREFIX, ApplicationPluginObjectID, ApplicationPluginsID, MAX_NUM_RGBA_COMPS, MemberOfID, ObjectClassID, ParentClassID, PropertiesID, XMLClassIDAsAttributeName`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AAFFactory()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `main(String[] args)`
    `static Preface` | `readPreface(String filename)` Read a complete preface from an AAF file, including all the content storage objects.
    `static void` | `writePreface(Preface preface, String outputFilename)` Write an AAF file with the given filename that is constructed from the given preface.

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

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### AAFFactory

          public AAFFactory()

  - ### Method Detail

    - #### readPreface

          public static final Preface readPreface(String filename)
                                           throws IOException

      Read a complete preface from an AAF file, including all the content storage objects. This method does not read any essence data apart from embedded streams.

      Parameters:
        `filename` - AAF file to read a preface object from.
      Returns:
        Preface object contained in the AAF file.
      Throws:
        `IOException` - An exception was thrown when trying to read the given AAF file.
      See Also:
        `writePreface(Preface, String)`

    - #### writePreface

          public static final void writePreface(Preface preface,
                                                String outputFilename)
                                         throws IOException

      Write an AAF file with the given filename that is constructed from the given preface.

      Note that this version of MAJ only supports writing metadata-only files.

      Parameters:
        `preface` - Preface to use to construct an AAF file from.
        `outputFilename` - File path specification for the file to write the preface to.
      Throws:
        `IOException` - An error occurred when writing the AAF file.
      See Also:
        `readPreface(String)`

    - #### main

          public static final void main(String[] args)

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