net.nand.util.i18n
Class PropsFileParser.KeyPairLine

java.lang.Object
  extended by net.nand.util.i18n.PropsFileParser.KeyPairLine
Enclosing class:
PropsFileParser

public static final class PropsFileParser.KeyPairLine
extends java.lang.Object

Parsed key-pair line from one properties file; includes its preceding comment lines, if any.


Field Summary
 java.util.List<java.lang.String> comment
          comment lines, if any, or null; each one contains leading "# "
 java.lang.String key
          key, or null for any comment at the end of the file
 boolean spacedEquals
          If true, the key and value are separated by " = " instead of "=".
 java.lang.String value
          value, if key != null.
 
Constructor Summary
PropsFileParser.KeyPairLine(java.util.List<java.lang.String> comment)
          Line with a comment, or blank line; key and value are null.
PropsFileParser.KeyPairLine(java.lang.String key, java.lang.String value, java.util.List<java.lang.String> comment, boolean spacedEquals)
          Line with a key and value, and optionally a comment.
 
Method Summary
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

key

public java.lang.String key
key, or null for any comment at the end of the file


value

public java.lang.String value
value, if key != null. If the value is empty or is only whitespace, will be null.


comment

public java.util.List<java.lang.String> comment
comment lines, if any, or null; each one contains leading "# "


spacedEquals

public boolean spacedEquals
If true, the key and value are separated by " = " instead of "=". This is tracked to minimize whitespace changes when editing a properties file.

Constructor Detail

PropsFileParser.KeyPairLine

public PropsFileParser.KeyPairLine(java.lang.String key,
                                   java.lang.String value,
                                   java.util.List<java.lang.String> comment,
                                   boolean spacedEquals)
Line with a key and value, and optionally a comment.

Parameters:
key - Key, or null for any comment at the end of the file. If null, the #PropsFileParser(List) constructor might be more convenient.
value - Value, if key != null
comment - Comment line(s), or null for a blank line. For efficiency the contents aren't copied, an object reference is stored in the KeyPairLine; be sure to not change the comment list contents after calling this.
spacedEquals - spacedEquals: If true, the key and value are separated by " = " instead of "=".

PropsFileParser.KeyPairLine

public PropsFileParser.KeyPairLine(java.util.List<java.lang.String> comment)
Line with a comment, or blank line; key and value are null.

Parameters:
comment - Comment line(s), or null for a blank line. For efficiency the contents aren't copied, an object reference is stored in the KeyPairLine; be sure to not change the comment list contents after calling this.
Method Detail

toString

public final java.lang.String toString()
Overrides:
toString in class java.lang.Object