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 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 Description PropertiesSourceFormat()
-
Method Summary
Modifier and Type Method 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()
-
-
-
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
-
-
Method Detail
-
getKey
public String getKey()
Returns an unique key for the source type.- Specified by:
getKey
in interfaceStreamSourceFormat
- Returns:
- "properties".
-
getFilenameExtension
public String getFilenameExtension()
Gets the filename extension this source type typically has.- Specified by:
getFilenameExtension
in interfaceStreamSourceFormat
- 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 interfaceStreamSourceFormat
- 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.
-
equals
public boolean equals(Object other)
Checks whether other is equal to this instance. All instances of this class are equal to each other.
-
-