lv.pasts.eme.edoc

## Class EDOCBuilder

- java.lang.Object
- - lv.pasts.eme.edoc.EDOCBuilder

-     public final class EDOCBuilder
      extends Object

  `EDOCBuilder` class provides functionality to obtain `EDOC` objects.

  New `EDOC` objects as well as existing `EDOC` objects can be obtained using this class.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static interface` | `EDOCBuilder.EDOCBuilderCallback` `EDOCBuilderCallback` class is used to get user input during EDOC loading.
    `static interface` | `EDOCBuilder.EDOCLoadParameter` A marker interface for EDOC load parameters.

  - ### Method Summary

    All Methods Static Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `static String` | `getFormatVersionDefault()` Returns the current EDoc format version used by EDOCBuilder.
    `static EDOCTemplate` | `newDefaultTemplate()` Creates a new default `EDOCTemplate` object.
    `static EDOC` | `newEDOC()` Deprecated. obsolete as of EDOC 2.0 document format.
    `static EDOC` | `newEDOC(EDOCTemplate edocTemplate)` Deprecated. obsolete as of EDOC 2.0 document format.
    `static EDOC` | `newEDOC(File templateFile)` Deprecated. obsolete as of EDOC 2.0 document format.
    `static EDOC` | `newEDOC(String formatVersion)` Deprecated. obsolete as of EDOC 2.0 document format.
    `static EDOC` | `newEDOC(URL templateURL)` Deprecated. obsolete as of EDOC 2.0 document format.
    `static EDOCTemplate` | `newTemplate(File templateFile)` Creates a new `EDOCTemplate` object using the given file.
    `static EDOCTemplate` | `newTemplate(URL templateURL)` Creates a new `EDOCTemplate` object using the given URL.
    `static EDoc2` | `openAsEDoc2(File file, String name)` Supports EDOC 1.0 format documents using the EDOC 2.0 API.
    `static EDOC` | `openEDOC(File edocFile, EDOCBuilder.EDOCLoadParameter edocLoadParameter)` Reads the contents from the given file, and creates a new `EDOC` object.
    `static EDOC` | `openEDOC(InputStream edocInputStream, String edocName, EDOCBuilder.EDOCLoadParameter edocLoadParameter)` Reads the contents from the given InputStream, and creates a new `EDOC` object.
    `static EDOC` | `openEDOC(URL edocURL, EDOCBuilder.EDOCLoadParameter edocLoadParameter)` Reads the contents from the given URL, and creates a new `EDOC` object.
    `static void` | `setFormatVersionDefault(String formatVersion)` Sets the current EDoc format version to be used by EDOCBuilder.

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

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

- - ### Method Detail

    - #### getFormatVersionDefault

          public static String getFormatVersionDefault()
                                                throws EDOCException

      Returns the current EDoc format version used by EDOCBuilder.
      Returns:
        the current EDoc format version, e.g. 1.02.
      Throws:
        `EDOCException`

    - #### setFormatVersionDefault

          public static void setFormatVersionDefault(String formatVersion)
                                              throws EDOCException

      Sets the current EDoc format version to be used by EDOCBuilder. Use this method to override the default and actual EDoc format version.
      Parameters:
        `formatVersion` - EDoc format version, e.g. 1.02.
      Throws:
        `EDOCException` - if the given EDoc format is invalid.

    - #### newDefaultTemplate

          public static EDOCTemplate newDefaultTemplate()
                                                 throws EDOCException

      Creates a new default `EDOCTemplate` object.
      Returns:
        a new `EDOCTemplate` object.
      Throws:
        `EDOCException` - if the default EDOC template cannot be loaded.
      Since:
        2.1.0

    - #### newTemplate

          public static EDOCTemplate newTemplate(File templateFile)
                                          throws EDOCException

      Creates a new `EDOCTemplate` object using the given file.
      Parameters:
        `templateFile` - the File object from which to read template contents.
      Returns:
        a new `EDOCTemplate` object.
      Throws:
        `EDOCException` - if the given EDOC template cannot be loaded.
      Since:
        2.1.0

    - #### newTemplate

          public static EDOCTemplate newTemplate(URL templateURL)
                                          throws EDOCException

      Creates a new `EDOCTemplate` object using the given URL.
      Parameters:
        `templateURL` - the URL object from which to read template contents.
      Returns:
        a new `EDOCTemplate` object.
      Throws:
        `EDOCException` - EDOCException if the given EDOC template cannot be loaded.
      Since:
        2.1.0

    - #### newEDOC

          @Deprecated
          public static EDOC newEDOC()
                                           throws EDOCException

      Deprecated. obsolete as of EDOC 2.0 document format.
      Creates a new `EDOC` object using the default template.
      Returns:
        a new `EDOC` object.
      Throws:
        `EDOCException` - if the default EDOC template cannot be loaded.

    - #### newEDOC

          @Deprecated
          public static EDOC newEDOC(String formatVersion)
                                           throws EDOCException

      Deprecated. obsolete as of EDOC 2.0 document format.
      Creates a new `EDOC` object using the default template.
      Parameters:
        `formatVersion` - EDoc format version, e.g. 1.02.
      Returns:
        a new `EDOC` object.
      Throws:
        `EDOCException` - if the default EDOC template cannot be loaded.

    - #### newEDOC

          @Deprecated
          public static EDOC newEDOC(File templateFile)
                                           throws EDOCException

      Deprecated. obsolete as of EDOC 2.0 document format.
      Creates a new `EDOC` object using the given template.
      Parameters:
        `templateFile` - the File object from which to read `EDOC` template contents.
      Returns:
        a new `EDOC` object.
      Throws:
        `EDOCException` - if the given EDOC template cannot be loaded.

    - #### newEDOC

          @Deprecated
          public static EDOC newEDOC(URL templateURL)
                                           throws EDOCException

      Deprecated. obsolete as of EDOC 2.0 document format.
      Creates a new `EDOC` object using the given template.
      Parameters:
        `templateURL` - the URL object from which to read `EDOC` template contents.
      Returns:
        a new `EDOC` object.
      Throws:
        `EDOCException` - if the given EDOC template cannot be loaded.

    - #### newEDOC

          @Deprecated
          public static EDOC newEDOC(EDOCTemplate edocTemplate)
                                           throws EDOCException

      Deprecated. obsolete as of EDOC 2.0 document format.
      Creates a new `EDOC` object using the given template.
      Parameters:
        `edocTemplate` - `EDOC` template.
      Returns:
        a new `EDOC` object.
      Throws:
        `EDOCException` - if the given EDOC template cannot be loaded.

    - #### openEDOC

          public static EDOC openEDOC(File edocFile,
                                      EDOCBuilder.EDOCLoadParameter edocLoadParameter)
                               throws EDOCException

      Reads the contents from the given file, and creates a new `EDOC` object.
      Parameters:
        `edocFile` - the File object from which to read `EDOC` contents.
        `edocLoadParameter` - the `LoadParameter` that specifies how to load the EDOC, which may be null.
      Returns:
        created `EDOC` object.
      Throws:
        `EDOCException` - if EDOC cannot be created.

    - #### openEDOC

          public static EDOC openEDOC(URL edocURL,
                                      EDOCBuilder.EDOCLoadParameter edocLoadParameter)
                               throws EDOCException

      Reads the contents from the given URL, and creates a new `EDOC` object.
      Parameters:
        `edocURL` - the URL object from which to read `EDOC` contents.
        `edocLoadParameter` - the `LoadParameter` that specifies how to load the EDOC, which may be null.
      Returns:
        created `EDOC` object.
      Throws:
        `EDOCException` - if EDOC cannot be created.

    - #### openEDOC

          public static EDOC openEDOC(InputStream edocInputStream,
                                      String edocName,
                                      EDOCBuilder.EDOCLoadParameter edocLoadParameter)
                               throws EDOCException

      Reads the contents from the given InputStream, and creates a new `EDOC` object.
      Parameters:
        `edocInputStream` - the InputStream object from which to read `EDOC` contents.
        `edocName` - the name of the EDOC file, or `null` if the name is unknown.
        `edocLoadParameter` - the `LoadParameter` that specifies how to load the EDOC, which may be null.
      Returns:
        created `EDOC` object.
      Throws:
        `EDOCException` - if EDOC cannot be created.

    - #### openAsEDoc2

          public static EDoc2 openAsEDoc2(File file,
                                          String name)
                                   throws EDoc2Exception

      Supports EDOC 1.0 format documents using the EDOC 2.0 API. This method is intended only for internal use and should not be invoked directly!
      Throws:
        `EDoc2Exception`
      See Also:
        `EDoc2Builder.openEDoc(File)`

Copyright VAS Latvijas Valsts radio un televizijas centrs / Developed by SIA EUSO