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

Quick Search    Search Deep

com.sun.syndication.io.impl
Class PropertiesLoader  view PropertiesLoader download PropertiesLoader.java

java.lang.Object
  extended bycom.sun.syndication.io.impl.PropertiesLoader

public class PropertiesLoader
extends java.lang.Object

Properties loader that aggregates a master properties file and several extra properties files, all from the current classpath.

The master properties file has to be in a distinct location than the extra properties files. First the master properties file is loaded, then all the extra properties files in their order of appearance in the classpath.

Current use cases (plugin manager for parsers/converters/generators for feeds and modules and date formats) assume properties are list of tokens, that why the only method to get property values is the getTokenizedProperty().


Field Summary
private  java.util.Properties[] _properties
           
private static java.lang.String EXTRA_PLUGIN_FILE
           
private static java.lang.String MASTER_PLUGIN_FILE
           
private static PropertiesLoader PROPERTIES_LOADER
           
 
Constructor Summary
private PropertiesLoader(java.lang.String masterFileLocation, java.lang.String extraFileLocation)
          Creates a PropertiesLoader.
 
Method Summary
static PropertiesLoader getPropertiesLoader()
          Returns the PropertiesLoader singleton used by ROME to load plugin components.
 java.lang.String[] getProperty(java.lang.String key)
          Returns an array of values stored under a property key in all properties files.
 java.lang.String[] getTokenizedProperty(java.lang.String key, java.lang.String separator)
          Returns an array of tokenized values stored under a property key in all properties files.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MASTER_PLUGIN_FILE

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

EXTRA_PLUGIN_FILE

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

PROPERTIES_LOADER

private static PropertiesLoader PROPERTIES_LOADER

_properties

private java.util.Properties[] _properties
Constructor Detail

PropertiesLoader

private PropertiesLoader(java.lang.String masterFileLocation,
                         java.lang.String extraFileLocation)
                  throws java.io.IOException
Creates a PropertiesLoader.

Method Detail

getPropertiesLoader

public static PropertiesLoader getPropertiesLoader()
Returns the PropertiesLoader singleton used by ROME to load plugin components.


getTokenizedProperty

public java.lang.String[] getTokenizedProperty(java.lang.String key,
                                               java.lang.String separator)
Returns an array of tokenized values stored under a property key in all properties files. If the master file has this property its tokens will be the first ones in the array.


getProperty

public java.lang.String[] getProperty(java.lang.String key)
Returns an array of values stored under a property key in all properties files. If the master file has this property it will be the first ones in the array.