|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.util.Dictionary | +--java.util.Hashtable | +--java.util.Properties | +--jade.util.leap.Properties | +--jade.util.BasicProperties | +--jade.util.ImportableProperties
This class serves as a basis for supporting the ability to import properties from files. Those files may also contain further import dirrectives. It is also usable in the restrictive J2ME CLDC environment. Since file support will be handled differently in different environments, it contains one abstract method fileReader which given the name of a file (its URL) must return a Reader object. Extending classes will provide that method in a suitable fashion. For example, in the desktop world this would be:
return new InputStreamReader(new FileInputStream(aFileName));whereas in the CLDC environment it would be:
return new InputStreamReader(Connector.openInputStream(aFileName));This class relates to four others as follows:
Field Summary |
Fields inherited from class java.util.Properties |
defaults |
Constructor Summary | |
ImportableProperties()
Construct empty property collection. |
|
ImportableProperties(java.lang.String[] theArgs)
Construct properties from arguments. |
Method Summary | |
void |
addFromFile(java.lang.String aFileName)
Add properties from named file. |
protected abstract java.io.Reader |
fileReader(java.lang.String aFileName)
Construct a Reader for the specified file name. |
java.lang.String |
getImportKey()
Get the string used to trigger import activity. |
void |
setImportKey(java.lang.String aKey)
Change value of import directive. |
protected boolean |
storableProperty(java.lang.String key,
java.lang.String value)
Detect import dirrective and import file. |
Methods inherited from class jade.util.leap.Properties |
load, store |
Methods inherited from class java.util.Properties |
list, propertyNames, save |
Methods inherited from class java.util.Hashtable |
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, rehash, remove, size, toString, values |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public ImportableProperties()
public ImportableProperties(java.lang.String[] theArgs)
theArgs
- The applications original arguments.Method Detail |
protected abstract java.io.Reader fileReader(java.lang.String aFileName) throws java.io.IOException
aFileName
- The name of the file.
java.io.IOException
- if anything goes wrong.public java.lang.String getImportKey()
public void setImportKey(java.lang.String aKey)
aKey
- New value to change default "import".public void addFromFile(java.lang.String aFileName) throws java.io.IOException
java.io.IOException
- if anything goes wrong.
PropertiesException
- if circular import.protected boolean storableProperty(java.lang.String key, java.lang.String value)
storableProperty
in class BasicProperties
key
- The key value string - check if equal to "import".value
- The value string - if import then this is file name.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |