org.apache.torque.generator.source.stream

## Class CombinedFileSource

- java.lang.Object
- - org.apache.torque.generator.source.SourceImpl
  - - org.apache.torque.generator.source.stream.CombinedFileSource

- All Implemented Interfaces:
    Source

      public class CombinedFileSource
      extends SourceImpl

  A source which uses several files as input and combines them into one file. The source tree will look as follows: <source> <file path="path/to/file1"> <rootOfFile1> ... </rootOfFile1> </file> <file path="path/to/file2"> <rootOfFile2> ... </rootOfFile2> </file> ... </source>

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `FILE_ELEMENT_NAME` The name of the root element's children of the produced source tree.
    `static String` | `PATH_ATTRIBUTE_NAME` The name of the path attribute of the file elements.
    `static String` | `ROOT_ELEMENT_NAME` The name of the root element of the produced source tree.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CombinedFileSource(Collection<FileSource> fileSources)` Constructor.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `SourceElement` | `createRootElement()` Reads and parses the input file and creates the element tree from it.
    `byte[]` | `getContentChecksum()` Returns the checksum of all files.
    `String` | `getDescription()` Returns the path of the files as a description.
    `Date` | `getLastModified()` Returns the earliest date when any of the source files was last modified.
    `File` | `getSourceFile()` Returns the source file, if applicable.
    `String` | `toString()`

    - ### Methods inherited from class org.apache.torque.generator.source.SourceImpl

      `getRootElement`

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

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

- - ### Field Detail

    - #### ROOT_ELEMENT_NAME

          public static final String ROOT_ELEMENT_NAME

      The name of the root element of the produced source tree.
      See Also:
        Constant Field Values

    - #### FILE_ELEMENT_NAME

          public static final String FILE_ELEMENT_NAME

      The name of the root element's children of the produced source tree.
      See Also:
        Constant Field Values

    - #### PATH_ATTRIBUTE_NAME

          public static final String PATH_ATTRIBUTE_NAME

      The name of the path attribute of the file elements.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### CombinedFileSource

          public CombinedFileSource(Collection<FileSource> fileSources)

      Constructor.
      Parameters:
        `fileSources` - the file sources, not null.
      Throws:
        `NullPointerException` - if path or format is null.

  - ### Method Detail

    - #### createRootElement

          public SourceElement createRootElement()
                                          throws SourceException

      Reads and parses the input file and creates the element tree from it.
      Specified by:
        `createRootElement` in class `SourceImpl`
      Returns:
        the root element of the element tree.
      Throws:
        `SourceException` - if the input file cannot be read or parsed.

    - #### getDescription

          public String getDescription()

      Returns the path of the files as a description.
      Returns:
        path of the files,separated by a semicolon, not null.
      See Also:
        `Source.getDescription()`

    - #### getSourceFile

          public File getSourceFile()

      Returns the source file, if applicable. As no single source file exists, the method returns always null.
      Returns:
        null.

    - #### getLastModified

          public Date getLastModified()

      Returns the earliest date when any of the source files was last modified.
      Returns:
        the last modification date, or null when unknown for at least one of the files.

    - #### getContentChecksum

          public byte[] getContentChecksum()

      Returns the checksum of all files. All bytes are added so order of the files does not matter.
      Returns:
        a checksum for all files, or null if one of the checksums of the file sources is null.

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2000–2020 The Apache Software Foundation. All rights reserved.