|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.Dictionary<K,V>
java.util.Hashtable<Object,Object>
java.util.Properties
org.apache.openejb.util.SuperProperties
public class SuperProperties
Properties is a Hashtable where the keys and values must be Strings. Each Properties can have a default Properties which specifies the default values which are used if the key is not in this Properties.
Hashtable
,
System.getProperties()
,
Serialized FormField Summary | |
---|---|
protected LinkedHashMap<String,LinkedHashMap<String,String>> |
attributes
Attributes for the properties. |
protected boolean |
caseInsensitive
Are lookups case insensitive? |
protected String |
commentIndent
Number of spaces to indent comment after '#' character. |
protected LinkedHashMap<String,String> |
comments
Comments for the properties. |
protected Properties |
defaults
The default property values. |
protected String |
indent
Number of spaces to indent each line of the properties file. |
protected String |
keyValueSeparator
The text between a key and the value. |
protected String |
lineSeparator
The line separator to use when storing. |
protected LinkedHashMap<Object,Object> |
properties
Actual property values. |
protected boolean |
spaceAfterComment
Should there be a blank line between a comment and the property. |
protected boolean |
spaceBetweenProperties
Should there be a blank line between properties. |
Constructor Summary | |
---|---|
SuperProperties()
Constructs a new Properties object. |
|
SuperProperties(Properties properties)
Constructs a new Properties object using the specified default properties. |
Method Summary | |
---|---|
void |
clear()
|
Object |
clone()
|
boolean |
contains(Object value)
|
boolean |
containsKey(Object key)
|
boolean |
containsValue(Object value)
|
Enumeration<Object> |
elements()
|
Set<Map.Entry<Object,Object>> |
entrySet()
Returns an unmodifiable view of the entries. |
boolean |
equals(Object o)
|
Object |
get(Object key)
|
Map<String,String> |
getAttributes(String name)
Searches for the attributes associated with the specified property. |
String |
getComment(String name)
Searches for the comment associated with the specified property. |
int |
getCommentIndent()
Gets the number of spaces to indent comment after '#' character. |
int |
getIndent()
Gets the number of spaces to indent each line of the properties file. |
String |
getKeyValueSeparator()
Gets the text that separates keys and values. |
String |
getLineSeparator()
Gets the text that separates lines while storing. |
String |
getProperty(String name)
|
String |
getProperty(String name,
String defaultValue)
|
int |
hashCode()
|
boolean |
isCaseInsensitive()
Are lookups case insensitive? |
boolean |
isEmpty()
|
boolean |
isSpaceAfterComment()
Should there be a blank line between a comment and the property? |
boolean |
isSpaceBetweenProperties()
Should a blank line be added between properties? |
Enumeration<Object> |
keys()
|
Set<Object> |
keySet()
Returns an unmodifiable view of the keys. |
void |
list(PrintStream out)
|
void |
list(PrintWriter writer)
|
void |
load(InputStream in)
|
void |
loadFromXML(InputStream in)
|
Enumeration<?> |
propertyNames()
|
Object |
put(Object key,
Object value)
|
void |
putAll(Map<?,?> t)
|
protected void |
rehash()
|
Object |
remove(Object key)
|
void |
save(OutputStream out,
String comment)
|
void |
setCaseInsensitive(boolean caseInsensitive)
Sets the sensitive of lookups. |
void |
setComment(String name,
String comment)
Sets the comment associated with a property. |
void |
setCommentIndent(int commentIndent)
Sets the number of spaces to indent comment after '#' character. |
void |
setIndent(int indent)
Sets the number of spaces to indent each line of the properties file. |
void |
setKeyValueSeparator(String keyValueSeparator)
Sets the text that separates keys and values. |
void |
setLineSeparator(String lineSeparator)
Sets the text that separates lines while storing |
Object |
setProperty(String name,
String value)
|
void |
setSpaceAfterComment(boolean spaceAfterComment)
If true a blank line will be added between a comment and the property. |
void |
setSpaceBetweenProperties(boolean spaceBetweenProperties)
If true a blank line will be added between properties. |
int |
size()
|
void |
store(OutputStream out,
String headComment)
|
void |
storeToXML(OutputStream os,
String comment)
|
void |
storeToXML(OutputStream os,
String headComment,
String encoding)
|
String |
toString()
|
Collection<Object> |
values()
Returns an unmodifiable view of the values. |
Methods inherited from class java.util.Properties |
---|
load, store, stringPropertyNames |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected LinkedHashMap<Object,Object> properties
protected LinkedHashMap<String,String> comments
protected LinkedHashMap<String,LinkedHashMap<String,String>> attributes
protected Properties defaults
protected boolean caseInsensitive
protected String keyValueSeparator
protected String lineSeparator
protected String indent
protected String commentIndent
protected boolean spaceBetweenProperties
protected boolean spaceAfterComment
Constructor Detail |
---|
public SuperProperties()
public SuperProperties(Properties properties)
properties
- the default propertiesMethod Detail |
---|
public boolean isCaseInsensitive()
public void setCaseInsensitive(boolean caseInsensitive)
caseInsensitive
- if looks are insensitivepublic String getKeyValueSeparator()
public void setKeyValueSeparator(String keyValueSeparator)
keyValueSeparator
- the text that separates keys and valuespublic String getLineSeparator()
public void setLineSeparator(String lineSeparator)
lineSeparator
- the text that separates linespublic int getIndent()
public void setIndent(int indent)
indent
- the number of spaces to indent each line of the properties filepublic int getCommentIndent()
public void setCommentIndent(int commentIndent)
commentIndent
- the number of spaces to indent comment after '#' characterpublic boolean isSpaceBetweenProperties()
public void setSpaceBetweenProperties(boolean spaceBetweenProperties)
spaceBetweenProperties
- if true a blank line will be added between propertiespublic boolean isSpaceAfterComment()
public void setSpaceAfterComment(boolean spaceAfterComment)
spaceAfterComment
- if true a blank line will be added between a comment and the propertypublic String getProperty(String name)
getProperty
in class Properties
public String getProperty(String name, String defaultValue)
getProperty
in class Properties
public Object setProperty(String name, String value)
setProperty
in class Properties
public String getComment(String name)
name
- the name of the property to find
public void setComment(String name, String comment)
name
- the property name; not nullcomment
- the comment; not nullpublic Map<String,String> getAttributes(String name)
name
- the name of the property to find
public void list(PrintStream out)
list
in class Properties
public void list(PrintWriter writer)
list
in class Properties
public void load(InputStream in) throws IOException
load
in class Properties
IOException
public Enumeration<?> propertyNames()
propertyNames
in class Properties
public void save(OutputStream out, String comment)
save
in class Properties
public void store(OutputStream out, String headComment) throws IOException
store
in class Properties
IOException
public void loadFromXML(InputStream in) throws IOException
loadFromXML
in class Properties
IOException
public void storeToXML(OutputStream os, String comment) throws IOException
storeToXML
in class Properties
IOException
public void storeToXML(OutputStream os, String headComment, String encoding) throws IOException
storeToXML
in class Properties
IOException
public boolean isEmpty()
isEmpty
in interface Map<Object,Object>
isEmpty
in class Hashtable<Object,Object>
public int size()
size
in interface Map<Object,Object>
size
in class Hashtable<Object,Object>
public Object get(Object key)
get
in interface Map<Object,Object>
get
in class Hashtable<Object,Object>
public Object put(Object key, Object value)
put
in interface Map<Object,Object>
put
in class Hashtable<Object,Object>
public Object remove(Object key)
remove
in interface Map<Object,Object>
remove
in class Hashtable<Object,Object>
public void putAll(Map<?,?> t)
putAll
in interface Map<Object,Object>
putAll
in class Hashtable<Object,Object>
public Set<Object> keySet()
keySet
in interface Map<Object,Object>
keySet
in class Hashtable<Object,Object>
public Enumeration<Object> keys()
keys
in class Hashtable<Object,Object>
public Collection<Object> values()
values
in interface Map<Object,Object>
values
in class Hashtable<Object,Object>
public Set<Map.Entry<Object,Object>> entrySet()
entrySet
in interface Map<Object,Object>
entrySet
in class Hashtable<Object,Object>
public Enumeration<Object> elements()
elements
in class Hashtable<Object,Object>
public boolean containsKey(Object key)
containsKey
in interface Map<Object,Object>
containsKey
in class Hashtable<Object,Object>
public boolean containsValue(Object value)
containsValue
in interface Map<Object,Object>
containsValue
in class Hashtable<Object,Object>
public boolean contains(Object value)
contains
in class Hashtable<Object,Object>
public void clear()
clear
in interface Map<Object,Object>
clear
in class Hashtable<Object,Object>
public Object clone()
clone
in class Hashtable<Object,Object>
public boolean equals(Object o)
equals
in interface Map<Object,Object>
equals
in class Hashtable<Object,Object>
public int hashCode()
hashCode
in interface Map<Object,Object>
hashCode
in class Hashtable<Object,Object>
public String toString()
toString
in class Hashtable<Object,Object>
protected void rehash()
rehash
in class Hashtable<Object,Object>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |