org.apache.torque.generator.source.stream

## Class PropertiesSourceFormat

- java.lang.Object
- - org.apache.torque.generator.source.stream.PropertiesSourceFormat

- All Implemented Interfaces:
    StreamSourceFormat

      public final class PropertiesSourceFormat
      extends Object
      implements StreamSourceFormat

  The source type representing an properties source. $Id: PropertiesSourceFormat.java 1855923 2019-03-20 16:19:39Z gk $

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `ENTRY_ELEMENT_NAME` The name of the entry element.
    `static String` | `KEY_ATTRIBUTE_NAME` The name of the key attribute of the entry element.
    `static String` | `ROOT_ELEMENT_NAME` The name of the root element.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PropertiesSourceFormat()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object other)` Checks whether other is equal to this instance.
    `String` | `getFilenameExtension()` Gets the filename extension this source type typically has.
    `String` | `getKey()` Returns an unique key for the source type.
    `int` | `hashCode()` Returns a hash code of this instance consistent with equals.
    `SourceElement` | `parse(InputStream inputStream, ControllerState controllerState)` Parses a Stream in Properties format and returns the root element of the created element tree.
    `String` | `toString()`

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

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

- - ### Field Detail

    - #### ROOT_ELEMENT_NAME

          public static final String ROOT_ELEMENT_NAME

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

    - #### ENTRY_ELEMENT_NAME

          public static final String ENTRY_ELEMENT_NAME

      The name of the entry element.
      See Also:
        Constant Field Values

    - #### KEY_ATTRIBUTE_NAME

          public static final String KEY_ATTRIBUTE_NAME

      The name of the key attribute of the entry element.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### PropertiesSourceFormat

          public PropertiesSourceFormat()

  - ### Method Detail

    - #### getKey

          public String getKey()

      Returns an unique key for the source type.
      Specified by:
        `getKey` in interface `StreamSourceFormat`
      Returns:
        "properties".

    - #### getFilenameExtension

          public String getFilenameExtension()

      Gets the filename extension this source type typically has.
      Specified by:
        `getFilenameExtension` in interface `StreamSourceFormat`
      Returns:
        "properties".

    - #### parse

          public SourceElement parse(InputStream inputStream,
                                     ControllerState controllerState)
                              throws SourceException

      Parses a Stream in Properties format and returns the root element of the created element tree.
      Specified by:
        `parse` in interface `StreamSourceFormat`
      Parameters:
        `inputStream` - the input stream to parse, not null.
        `controllerState` - the controller state.
      Returns:
        the root element of the created tree, not null.
      Throws:
        `SourceException` - if an error occurred when reading from the input stream.
        `IllegalArgumentException` - if the input stream contains a malformed unicode escape sequence.
        `NullPointerException` - if inputStream is null.

    - #### hashCode

          public int hashCode()

      Returns a hash code of this instance consistent with equals. As all instances of this class are equal to each other, the hash code is always the same.
      Overrides:
        `hashCode` in class `Object`
      Returns:
        1.

    - #### equals

          public boolean equals(Object other)

      Checks whether other is equal to this instance. All instances of this class are equal to each other.
      Overrides:
        `equals` in class `Object`
      Returns:
        true if `other` is a PropertiesSourceType, false otherwise.

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

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