Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.eireneh.util
Class PropertiesUtil  view PropertiesUtil download PropertiesUtil.java

java.lang.Object
  extended bycom.eireneh.util.PropertiesUtil

public class PropertiesUtil
extends java.lang.Object

A generic class of Properties utils. It would be good if we could put this stuff in java.lang ...
Distribution Licence:
Project B is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
The License is available on the internet here, by writing to Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA, Or locally at the Licence link below.
The copyright to this program is held by it's authors.


Field Summary
private static java.lang.String DONE
          The end marker text
private static char[] hexDigit
          A table of hex digits
private static java.lang.String keyValueSeparators
           
private static java.lang.String SEPARATOR
          Cache of line separator
private static java.lang.String specialSaveChars
           
private static java.lang.String strictKeyValueSeparators
           
private static java.lang.String whiteSpaceChars
           
 
Constructor Summary
PropertiesUtil()
           
 
Method Summary
private static boolean continueLine(java.lang.String line)
          Returns true if the given line is a line that must be appended to the next line
static void load(java.util.Properties prop, java.io.InputStream in)
          Write a Properties to a Stream an leave the stream in tact
private static java.lang.String loadConvert(java.lang.String theString)
          Converts encoded \\uxxxx to unicode chars and changes special saved chars to their original forms
private static void loadInternal(java.io.InputStream inStream, java.util.Properties prop)
          Reads a property list (key and element pairs) from the input stream.
static void save(java.util.Properties prop, java.io.OutputStream out, java.lang.String title)
          Write a Properties to a Stream an leave the stream in tact
private static java.lang.String saveConvert(java.lang.String theString)
          Converts unicodes to encoded \\uxxxx and writes out any of the characters in specialSaveChars with a preceding slash
private static void saveInternal(java.util.Properties prop, java.io.OutputStream out, java.lang.String header)
          Writes this property list (key and element pairs) in this Properties table to the output stream in a format suitable for loading into a Properties table using the load method.
private static char toHex(int nibble)
          Convert a nibble to a hex character
private static void writeln(java.io.BufferedWriter bw, java.lang.String s)
          Write a line to a file
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

hexDigit

private static final char[] hexDigit
A table of hex digits


SEPARATOR

private static final java.lang.String SEPARATOR
Cache of line separator


DONE

private static final java.lang.String DONE
The end marker text

See Also:
Constant Field Values

keyValueSeparators

private static final java.lang.String keyValueSeparators
See Also:
Constant Field Values

strictKeyValueSeparators

private static final java.lang.String strictKeyValueSeparators
See Also:
Constant Field Values

specialSaveChars

private static final java.lang.String specialSaveChars
See Also:
Constant Field Values

whiteSpaceChars

private static final java.lang.String whiteSpaceChars
See Also:
Constant Field Values
Constructor Detail

PropertiesUtil

public PropertiesUtil()
Method Detail

save

public static void save(java.util.Properties prop,
                        java.io.OutputStream out,
                        java.lang.String title)
                 throws java.io.IOException
Write a Properties to a Stream an leave the stream in tact


saveInternal

private static void saveInternal(java.util.Properties prop,
                                 java.io.OutputStream out,
                                 java.lang.String header)
                          throws java.io.IOException
Writes this property list (key and element pairs) in this Properties table to the output stream in a format suitable for loading into a Properties table using the load method.


writeln

private static void writeln(java.io.BufferedWriter bw,
                            java.lang.String s)
                     throws java.io.IOException
Write a line to a file


saveConvert

private static java.lang.String saveConvert(java.lang.String theString)
Converts unicodes to encoded \\uxxxx and writes out any of the characters in specialSaveChars with a preceding slash


load

public static void load(java.util.Properties prop,
                        java.io.InputStream in)
                 throws java.io.IOException
Write a Properties to a Stream an leave the stream in tact


loadInternal

private static void loadInternal(java.io.InputStream inStream,
                                 java.util.Properties prop)
                          throws java.io.IOException
Reads a property list (key and element pairs) from the input stream.


continueLine

private static boolean continueLine(java.lang.String line)
Returns true if the given line is a line that must be appended to the next line


loadConvert

private static java.lang.String loadConvert(java.lang.String theString)
Converts encoded \\uxxxx to unicode chars and changes special saved chars to their original forms


toHex

private static char toHex(int nibble)
Convert a nibble to a hex character