JAC project
AOPSYS
CEDRIC & LIP6 labs

org.objectweb.jac.core
Class JacPropTools

java.lang.Object
  |
  +--org.objectweb.jac.core.JacPropTools
Direct Known Subclasses:
JacPropLoader

public abstract class JacPropTools
extends Object

This class provides useful primitives to parse Java property files.


Constructor Summary
JacPropTools()
           
 
Method Summary
static void fillListStringProps(List vector, Properties pList, String propertyName, boolean force)
          Extract a specific vector (ordered) property from a property list.
static void fillMapProps(Map hashTable, Properties pList, String propertyName, int nElements, boolean force)
          Extract a specific hashTable property from a property list.
static void fillSetProps(Set set, Properties pList, String propertyName, boolean trim)
          Extract a specific hash set property from a property list.
static String fillStringProp(Properties pList, String propertyName)
          Extract a specific String properpy from a property list.
static Properties getPropsFrom(String directory, String name)
          Try to load the property file (propFileName) from the specified directory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JacPropTools

public JacPropTools()
Method Detail

fillListStringProps

public static void fillListStringProps(List vector,
                                       Properties pList,
                                       String propertyName,
                                       boolean force)
Extract a specific vector (ordered) property from a property list. Then parse it and split it into tokens that will be added to the "vector".

Parameters:
vector - the vetor where all extracted tokens will be stored
pList - the list of all properties from where we will search the property
propertyName - the name of the property to parse

fillSetProps

public static void fillSetProps(Set set,
                                Properties pList,
                                String propertyName,
                                boolean trim)
Extract a specific hash set property from a property list. Then parse it and split it into tokens that will be added to the "hashSet".

Parameters:
pList - the list of all properties from where we will search the property
propertyName - the name of the property to parse
trim - wether to trim ending ".*"

fillMapProps

public static void fillMapProps(Map hashTable,
                                Properties pList,
                                String propertyName,
                                int nElements,
                                boolean force)
Extract a specific hashTable property from a property list. Then parse it and split it into tokens that will be added to the "hashTable".

Parameters:
hashTable - the hash table where all extracted tokens will be stored
pList - the list of all properties from where we will search the property
propertyName - the name of the property to parse
nElements - the number of elements attached to a key (the key is the first element). If nElements==0, the number of elements attached to the key is variant and must be ending with a '.'.

fillStringProp

public static String fillStringProp(Properties pList,
                                    String propertyName)
Extract a specific String properpy from a property list.

Parameters:
pList - the list of all properties from where we will search the property
propertyName - the name of the property to parse

getPropsFrom

public static Properties getPropsFrom(String directory,
                                      String name)
Try to load the property file (propFileName) from the specified directory.

Parameters:
directory - the directory where we should, in theory, found the property file
name - the name of the property file
Returns:
true if the file was found and loaded, false otherwise

Contact JAC development team:
Renaud Pawlak
Lionel Seinturier
Laurent Martelli