|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractMap<java.lang.String,java.lang.String>
org.apache.karaf.util.Properties
public class Properties
Enhancement of the standard Properties
managing the maintain of comments, etc.
Nested Class Summary | |
---|---|
protected static class |
Properties.Layout
TODO |
static class |
Properties.PropertiesReader
This class is used to read properties lines. |
static class |
Properties.PropertiesWriter
This class is used to write properties lines. |
Nested classes/interfaces inherited from class java.util.AbstractMap |
---|
java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V> |
Nested classes/interfaces inherited from interface java.util.Map |
---|
java.util.Map.Entry<K,V> |
Constructor Summary | |
---|---|
Properties()
|
|
Properties(java.io.File location)
|
Method Summary | |
---|---|
void |
clear()
|
static boolean |
contains(char[] array,
char valueToFind)
Checks if the value is in the given array. |
java.util.Set<java.util.Map.Entry<java.lang.String,java.lang.String>> |
entrySet()
|
java.util.List<java.lang.String> |
getFooter()
Return the comment footer. |
java.util.List<java.lang.String> |
getHeader()
Return the comment header. |
void |
load(java.io.File location)
|
void |
load(java.io.InputStream is)
|
void |
load(java.io.Reader reader)
|
void |
load(java.net.URL location)
|
protected void |
loadLayout(java.io.Reader in)
Reads a properties file and stores its internal structure. |
static void |
performSubstitution(java.util.Map<java.lang.String,java.lang.String> properties)
Perform substitution on a property set |
java.lang.String |
put(java.lang.String key,
java.lang.String value)
|
java.lang.String |
remove(java.lang.Object key)
|
void |
save()
|
void |
save(java.io.File location)
|
void |
save(java.io.OutputStream os)
|
void |
save(java.io.Writer writer)
|
protected void |
saveLayout(java.io.Writer out)
Writes the properties file to the given writer, preserving as much of its structure as possible. |
void |
setFooter(java.util.List<java.lang.String> footer)
Set the comment footer. |
void |
setHeader(java.util.List<java.lang.String> header)
Set the comment header. |
static java.lang.String |
substVars(java.lang.String val,
java.lang.String currentKey,
java.util.Map<java.lang.String,java.lang.String> cycleMap,
java.util.Map<java.lang.String,java.lang.String> configProps)
This method performs property variable substitution on the specified value. |
Methods inherited from class java.util.AbstractMap |
---|
clone, containsKey, containsValue, equals, get, hashCode, isEmpty, keySet, putAll, size, toString, values |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Properties()
public Properties(java.io.File location) throws java.io.IOException
java.io.IOException
Method Detail |
---|
public void load(java.io.File location) throws java.io.IOException
java.io.IOException
public void load(java.net.URL location) throws java.io.IOException
java.io.IOException
public void load(java.io.InputStream is) throws java.io.IOException
java.io.IOException
public void load(java.io.Reader reader) throws java.io.IOException
java.io.IOException
public void save() throws java.io.IOException
java.io.IOException
public void save(java.io.File location) throws java.io.IOException
java.io.IOException
public void save(java.io.OutputStream os) throws java.io.IOException
java.io.IOException
public void save(java.io.Writer writer) throws java.io.IOException
java.io.IOException
public java.util.Set<java.util.Map.Entry<java.lang.String,java.lang.String>> entrySet()
entrySet
in interface java.util.Map<java.lang.String,java.lang.String>
entrySet
in class java.util.AbstractMap<java.lang.String,java.lang.String>
public java.lang.String put(java.lang.String key, java.lang.String value)
put
in interface java.util.Map<java.lang.String,java.lang.String>
put
in class java.util.AbstractMap<java.lang.String,java.lang.String>
public java.lang.String remove(java.lang.Object key)
remove
in interface java.util.Map<java.lang.String,java.lang.String>
remove
in class java.util.AbstractMap<java.lang.String,java.lang.String>
public void clear()
clear
in interface java.util.Map<java.lang.String,java.lang.String>
clear
in class java.util.AbstractMap<java.lang.String,java.lang.String>
public java.util.List<java.lang.String> getHeader()
public void setHeader(java.util.List<java.lang.String> header)
header
- the header to usepublic java.util.List<java.lang.String> getFooter()
public void setFooter(java.util.List<java.lang.String> footer)
footer
- the footer to useprotected void loadLayout(java.io.Reader in) throws java.io.IOException
in
- the reader to the properties file
java.io.IOException
- if an error occursprotected void saveLayout(java.io.Writer out) throws java.io.IOException
out
- the writer
java.io.IOException
- if an error occurspublic static boolean contains(char[] array, char valueToFind)
Checks if the value is in the given array.
The method returns false
if a null
array is passed in.
array
- the array to search throughvalueToFind
- the value to find
true
if the array contains the objectpublic static void performSubstitution(java.util.Map<java.lang.String,java.lang.String> properties)
properties
- the property set to perform substitution onpublic static java.lang.String substVars(java.lang.String val, java.lang.String currentKey, java.util.Map<java.lang.String,java.lang.String> cycleMap, java.util.Map<java.lang.String,java.lang.String> configProps) throws java.lang.IllegalArgumentException
This method performs property variable substitution on the specified value. If the specified value contains the syntax ${<prop-name>}, where <prop-name> refers to either a configuration property or a system property, then the corresponding property value is substituted for the variable placeholder. Multiple variable placeholders may exist in the specified value as well as nested variable placeholders, which are substituted from inner most to outer most. Configuration properties override system properties.
val
- The string on which to perform property substitution.currentKey
- The key of the property being evaluated used to
detect cycles.cycleMap
- Map of variable references used to detect nested cycles.configProps
- Set of configuration properties.
java.lang.IllegalArgumentException
- If there was a syntax error in the
property placeholder syntax or a recursive variable reference.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |