public class SortedProperties extends Properties
Properties to allow alphabetical order. Encoding could also
be defined but you must use this class only with Java 1.6.| Modifier and Type | Field and Description |
|---|---|
protected String |
defaultEncoding
l'encoding par defaut a utiliser pour lire et ecrire le properties.
|
static String |
ENCODING_ASCII |
static String |
ENCODING_DEFAULT |
static String |
ENCODING_LATIN1 |
protected char[] |
hexDigit |
protected boolean |
removeHeader
un drapeau pour savoir s'il faut enlever l'entete generere
|
protected boolean |
unicodeLower
A flag to write unicode using the a lower letter.
|
defaults| Constructor and Description |
|---|
SortedProperties() |
SortedProperties(Properties defaults) |
SortedProperties(String defaultEncoding) |
SortedProperties(String defaultEncoding,
boolean removeHeader) |
SortedProperties(String defaultEncoding,
boolean removeHeader,
boolean unicodeLower) |
| Modifier and Type | Method and Description |
|---|---|
Enumeration<Object> |
keys() |
SortedProperties |
load(File src)
Load all properties from given
src file using defined defaultEncoding. |
SortedProperties |
load(File src,
String encoding)
Load Properties from
src file using given defaultEncoding. |
protected String |
saveConvert(String theString,
boolean escapeSpace,
boolean escapeUnicode) |
void |
store(File dst)
Save properties in given
dst file using defined defaultEncoding. |
void |
store(File dst,
String encoding)
Store Properties in
output file using given defaultEncoding. |
void |
store(OutputStream dst)
Save properties in given
stream file. |
void |
store(OutputStream out,
String comments) |
void |
store(Writer writer,
String comments) |
protected void |
store0(BufferedWriter bw,
String comments,
boolean escUnicode) |
protected void |
storeEncode(OutputStream stream,
String encoding)
If encoding is not the default Properties one, we will use a writer
to use this custom encoding.
|
protected char |
toHex(int nibble)
Convert a nibble to a hex character
|
void |
writeComments(BufferedWriter bw,
String comments) |
getProperty, getProperty, list, list, load, load, loadFromXML, propertyNames, save, setProperty, storeToXML, storeToXML, stringPropertyNamespublic static final String ENCODING_DEFAULT
public static final String ENCODING_LATIN1
public static final String ENCODING_ASCII
protected String defaultEncoding
protected boolean removeHeader
protected final boolean unicodeLower
é instead of é.protected final char[] hexDigit
public SortedProperties()
public SortedProperties(String defaultEncoding)
public SortedProperties(String defaultEncoding, boolean removeHeader)
public SortedProperties(String defaultEncoding, boolean removeHeader, boolean unicodeLower)
public SortedProperties(Properties defaults)
public SortedProperties load(File src) throws IOException
src file using defined defaultEncoding.src - source fileIOException - if any io pbload(File, String)public SortedProperties load(File src, String encoding) throws IOException
src file using given defaultEncoding.
If this encoding is different from default ones
ENCODING_DEFAULT, ENCODING_LATIN1
and ENCODING_ASCII. A specific Reader will
be used to read the file.src - File where Properties will be loadedencoding - Encoding to useIOException - for any file errorspublic void store(File dst) throws IOException
dst file using defined defaultEncoding.dst - output fileIOException - if any io pbstore(File, String)public void store(File dst, String encoding) throws IOException
output file using given defaultEncoding.
If this encoding is different from default ones
ENCODING_DEFAULT, ENCODING_LATIN1
and ENCODING_ASCII, a specific Writer will
be used to save the file. Otherwise the default Properties behavior
will escape unicode chars with \uxxxx.dst - File to save Propertiesencoding - Encoding to useIOException - for any file errorsprotected void storeEncode(OutputStream stream, String encoding) throws IOException
store(Writer, String) method is used otherwise the
default encoding 8859_1 must be used as superclass define it in
store(OutputStream, String).
Encoding ENCODING_DEFAULT,
ENCODING_LATIN1 and ENCODING_ASCII
are considered as default Properties one, so the old method will be use
escaping unicode chars like \uxxxx.stream - OutputStream to save inencoding - Encoding to useIOException - For any file errorspublic void store(OutputStream dst) throws IOException
stream file. defaultEncoding defined
will be ignored to store the properties file. The default encoding is the
basic Properties one (Latin1 ISO), unicode chars will be escaped
like basic store(OutputStream, String) method.dst - output fileIOException - if any io pbpublic void store(OutputStream out, String comments) throws IOException
store in class PropertiesIOExceptionpublic void store(Writer writer, String comments) throws IOException
store in class PropertiesIOExceptionprotected void store0(BufferedWriter bw, String comments, boolean escUnicode) throws IOException
IOExceptionprotected String saveConvert(String theString, boolean escapeSpace, boolean escapeUnicode)
public void writeComments(BufferedWriter bw, String comments) throws IOException
IOExceptionprotected char toHex(int nibble)
nibble - the nibble to convert.Copyright © 2009–2013 CodeLutin. All rights reserved.