lv.eparaksts.edoc

## Class EDoc2Builder

- java.lang.Object
- - lv.eparaksts.edoc.EDoc2Builder

-     public class EDoc2Builder
      extends Object

  An `EDoc2Builder` represents simple builder utility for EDOC 2.0 format document.
  See Also:
    `EDoc2`

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `EDOC_FORMAT_2_0` Current EDoc format constant - 2.0.

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static String` | `getFormatVersionDefault()` Returns default value of the format version
    `static boolean` | `isEDoc2(File file, String name)` Validate given file whether it is EDOC 2.0 document.
    `static EDoc2` | `newEDoc()` Creates a new EDOC 2.0 document.
    `static EDoc2` | `newEDoc(String formatVersion)` Creates a new EDOC document with the defined format version.
    `static EDoc2` | `openEDoc(File file)` Creates EDOC 2.0 document from `File`
    `static EDoc2` | `openEDoc(InputStream inputStream)` Creates EDOC 2.0 document from `InputStream`

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

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

- - ### Field Detail

    - #### EDOC_FORMAT_2_0

          public static final String EDOC_FORMAT_2_0

      Current EDoc format constant - 2.0.
      See Also:
        Constant Field Values

  - ### Method Detail

    - #### getFormatVersionDefault

          public static String getFormatVersionDefault()
                                                throws EDoc2Exception

      Returns default value of the format version
      Returns:
        format version
      Throws:
        `EDoc2Exception`

    - #### newEDoc

          public static EDoc2 newEDoc()
                               throws EDoc2Exception

      Creates a new EDOC 2.0 document.
      Returns:
        new EDOC document
      Throws:
        `EDoc2Exception`

    - #### newEDoc

          public static EDoc2 newEDoc(String formatVersion)
                               throws EDoc2Exception

      Creates a new EDOC document with the defined format version.
      Returns:
        new EDOC document
      Throws:
        `EDoc2Exception`

    - #### openEDoc

          public static EDoc2 openEDoc(InputStream inputStream)
                                throws EDoc2Exception

      Creates EDOC 2.0 document from `InputStream`
      Parameters:
        `inputStream` - Input stream of EDOC 2.0 document
      Returns:
        EDOC 2.0 document
      Throws:
        `EDoc2Exception`

    - #### openEDoc

          public static EDoc2 openEDoc(File file)
                                throws EDoc2Exception

      Creates EDOC 2.0 document from `File`
      Parameters:
        `file` - File reference of EDOC 2.0 document
      Returns:
        EDOC 2.0 document
      Throws:
        `EDoc2Exception`

    - #### isEDoc2

          public static boolean isEDoc2(File file,
                                        String name)

      Validate given file whether it is EDOC 2.0 document. Reads only first bytes of the document to detect EDOC version according to ETSI TS 102 918 V1.3.1 (2013-06) - A.1 Mimetype
      Parameters:
        `file` - EDOC document
        `name` -
      Returns:
        `true` if file is EDOC 2.0 document

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