org.nuiton.io
Class SortedProperties

java.lang.Object
  extended by java.util.Dictionary<K,V>
      extended by java.util.Hashtable<Object,Object>
          extended by java.util.Properties
              extended by org.nuiton.io.SortedProperties
All Implemented Interfaces:
Serializable, Cloneable, Map<Object,Object>

public class SortedProperties
extends Properties

Permet d'avoir les fichiers de proprietes tries.

Author:
ruchaud , tchemit
See Also:
Serialized Form

Field Summary
protected  String encoding
          l'encoding a utiliser pour lire et ecrire le properties.
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.
 
Fields inherited from class java.util.Properties
defaults
 
Constructor Summary
SortedProperties(Properties defaults)
           
SortedProperties(String encoding)
           
SortedProperties(String encoding, boolean removeHeader)
           
SortedProperties(String encoding, boolean removeHeader, boolean unicodeLower)
           
 
Method Summary
 Enumeration<Object> keys()
           
 SortedProperties load(File src)
          Charge le properties a partir d'un fichier.
protected  String saveConvert(String theString, boolean escapeSpace, boolean escapeUnicode)
           
 void store(File dst)
          Sauvegarde le properties dans un fichier, sans commentaire et en utilisant l'encoding declare.
 void store(OutputStream dst)
          Sauvegarde le properties dans un fichier, sans commentaire en laissant java encode en unicode.
 void store(OutputStream out, String comments)
           
protected  void store0(BufferedWriter bw, String comments, boolean escUnicode)
           
protected  char toHex(int nibble)
          Convert a nibble to a hex character
 void writeComments(BufferedWriter bw, String comments)
           
 
Methods inherited from class java.util.Properties
getProperty, getProperty, list, list, load, load, loadFromXML, propertyNames, save, setProperty, store, storeToXML, storeToXML, stringPropertyNames
 
Methods inherited from class java.util.Hashtable
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, rehash, remove, size, toString, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

encoding

protected String encoding
l'encoding a utiliser pour lire et ecrire le properties.


removeHeader

protected boolean removeHeader
un drapeau pour savoir s'il faut enlever l'entete generere


unicodeLower

protected final boolean unicodeLower
A flag to write unicode using the a lower letter.

Example : é instead of é.


hexDigit

protected final char[] hexDigit
Constructor Detail

SortedProperties

public SortedProperties(String encoding)

SortedProperties

public SortedProperties(String encoding,
                        boolean removeHeader)

SortedProperties

public SortedProperties(String encoding,
                        boolean removeHeader,
                        boolean unicodeLower)

SortedProperties

public SortedProperties(Properties defaults)
Method Detail

keys

public Enumeration<Object> keys()
Overrides:
keys in class Hashtable<Object,Object>

load

public SortedProperties load(File src)
                      throws IOException
Charge le properties a partir d'un fichier.

Parameters:
src - le fichier src a charger en utilisant l'encoding declare
Returns:
l'instance du properties
Throws:
IOException - if any io pb

store

public void store(File dst)
           throws IOException
Sauvegarde le properties dans un fichier, sans commentaire et en utilisant l'encoding declare.

Parameters:
dst - the fichier de destination
Throws:
IOException - if any io pb

store

public void store(OutputStream dst)
           throws IOException
Sauvegarde le properties dans un fichier, sans commentaire en laissant java encode en unicode.

Parameters:
dst - le fichier de destination
Throws:
IOException - if any io pb

store

public void store(OutputStream out,
                  String comments)
           throws IOException
Overrides:
store in class Properties
Throws:
IOException

store0

protected void store0(BufferedWriter bw,
                      String comments,
                      boolean escUnicode)
               throws IOException
Throws:
IOException

saveConvert

protected String saveConvert(String theString,
                             boolean escapeSpace,
                             boolean escapeUnicode)

writeComments

public void writeComments(BufferedWriter bw,
                          String comments)
                   throws IOException
Throws:
IOException

toHex

protected char toHex(int nibble)
Convert a nibble to a hex character

Parameters:
nibble - the nibble to convert.


Copyright © 2009-2010 CodeLutin. All Rights Reserved.