public class SuperProperties
extends java.util.Properties
Hashtable,
System.getProperties(),
Serialized Form| Modifier and Type | Field and Description |
|---|---|
protected java.util.LinkedHashMap<java.lang.String,java.util.LinkedHashMap<java.lang.String,java.lang.String>> |
attributes
Attributes for the properties.
|
protected boolean |
caseInsensitive
Are lookups case insensitive?
|
protected java.lang.String |
commentIndent
Number of spaces to indent comment after '#' character.
|
protected java.util.LinkedHashMap<java.lang.String,java.lang.String> |
comments
Comments for individual the properties.
|
protected java.util.Properties |
defaults
The default property values.
|
protected java.lang.String |
indent
Number of spaces to indent each line of the properties file.
|
protected java.lang.String |
keyValueSeparator
The text between a key and the value.
|
protected java.lang.String |
lineSeparator
The line separator to use when storing.
|
protected java.util.LinkedHashMap<java.lang.Object,java.lang.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 and Description |
|---|
SuperProperties()
Constructs a new Properties object.
|
SuperProperties(java.util.Properties properties)
Constructs a new Properties object using the specified default properties.
|
| Modifier and Type | Method and Description |
|---|---|
SuperProperties |
caseInsensitive(boolean caseInsensitive) |
void |
clear() |
java.lang.Object |
clone() |
boolean |
contains(java.lang.Object value) |
boolean |
containsKey(java.lang.Object key) |
boolean |
containsValue(java.lang.Object value) |
java.util.Enumeration<java.lang.Object> |
elements() |
java.util.Set<java.util.Map.Entry<java.lang.Object,java.lang.Object>> |
entrySet()
Returns an unmodifiable view of the entries.
|
boolean |
equals(java.lang.Object o) |
java.lang.Object |
get(java.lang.Object key) |
java.util.Map<java.lang.String,java.lang.String> |
getAttributes(java.lang.String name)
Searches for the attributes associated with the specified property.
|
java.lang.String |
getComment(java.lang.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.
|
java.lang.String |
getKeyValueSeparator()
Gets the text that separates keys and values.
|
java.lang.String |
getLineSeparator()
Gets the text that separates lines while storing.
|
java.lang.String |
getProperty(java.lang.String name) |
java.lang.String |
getProperty(java.lang.String name,
java.lang.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?
|
java.util.Enumeration<java.lang.Object> |
keys() |
java.util.Set<java.lang.Object> |
keySet()
Returns an unmodifiable view of the keys.
|
void |
list(java.io.PrintStream out) |
void |
list(java.io.PrintWriter writer) |
void |
load(java.io.InputStream in) |
void |
loadFromXML(java.io.InputStream in) |
java.util.Enumeration<?> |
propertyNames() |
java.lang.Object |
put(java.lang.Object key,
java.lang.Object value) |
void |
putAll(java.util.Map<?,?> t) |
protected void |
rehash() |
java.lang.Object |
remove(java.lang.Object key) |
void |
save(java.io.OutputStream out,
java.lang.String comment) |
void |
setCaseInsensitive(boolean caseInsensitive)
Sets the sensitive of lookups.
|
void |
setComment(java.lang.String name,
java.lang.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(java.lang.String keyValueSeparator)
Sets the text that separates keys and values.
|
void |
setLineSeparator(java.lang.String lineSeparator)
Sets the text that separates lines while storing
|
java.lang.Object |
setProperty(java.lang.String name,
java.lang.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(java.io.OutputStream out,
java.lang.String headComment) |
void |
storeToXML(java.io.OutputStream os,
java.lang.String comment) |
void |
storeToXML(java.io.OutputStream os,
java.lang.String headComment,
java.lang.String encoding) |
java.lang.String |
toString() |
java.util.Collection<java.lang.Object> |
values()
Returns an unmodifiable view of the values.
|
protected java.util.LinkedHashMap<java.lang.Object,java.lang.Object> properties
protected java.util.LinkedHashMap<java.lang.String,java.lang.String> comments
protected java.util.LinkedHashMap<java.lang.String,java.util.LinkedHashMap<java.lang.String,java.lang.String>> attributes
protected java.util.Properties defaults
protected boolean caseInsensitive
protected java.lang.String keyValueSeparator
protected java.lang.String lineSeparator
protected java.lang.String indent
protected java.lang.String commentIndent
protected boolean spaceBetweenProperties
protected boolean spaceAfterComment
public SuperProperties()
public SuperProperties(java.util.Properties properties)
properties - the default propertiespublic boolean isCaseInsensitive()
public void setCaseInsensitive(boolean caseInsensitive)
caseInsensitive - if looks are insensitivepublic SuperProperties caseInsensitive(boolean caseInsensitive)
public java.lang.String getKeyValueSeparator()
public void setKeyValueSeparator(java.lang.String keyValueSeparator)
keyValueSeparator - the text that separates keys and valuespublic java.lang.String getLineSeparator()
public void setLineSeparator(java.lang.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 java.lang.String getProperty(java.lang.String name)
getProperty in class java.util.Propertiespublic java.lang.String getProperty(java.lang.String name,
java.lang.String defaultValue)
getProperty in class java.util.Propertiespublic java.lang.Object setProperty(java.lang.String name,
java.lang.String value)
setProperty in class java.util.Propertiespublic java.lang.String getComment(java.lang.String name)
name - the name of the property to findpublic void setComment(java.lang.String name,
java.lang.String comment)
name - the property name; not nullcomment - the comment; not nullpublic java.util.Map<java.lang.String,java.lang.String> getAttributes(java.lang.String name)
name - the name of the property to findpublic void list(java.io.PrintStream out)
list in class java.util.Propertiespublic void list(java.io.PrintWriter writer)
list in class java.util.Propertiespublic void load(java.io.InputStream in)
throws java.io.IOException
load in class java.util.Propertiesjava.io.IOExceptionpublic java.util.Enumeration<?> propertyNames()
propertyNames in class java.util.Propertiespublic void save(java.io.OutputStream out,
java.lang.String comment)
save in class java.util.Propertiespublic void store(java.io.OutputStream out,
java.lang.String headComment)
throws java.io.IOException
store in class java.util.Propertiesjava.io.IOExceptionpublic void loadFromXML(java.io.InputStream in)
throws java.io.IOException
loadFromXML in class java.util.Propertiesjava.io.IOExceptionpublic void storeToXML(java.io.OutputStream os,
java.lang.String comment)
throws java.io.IOException
storeToXML in class java.util.Propertiesjava.io.IOExceptionpublic void storeToXML(java.io.OutputStream os,
java.lang.String headComment,
java.lang.String encoding)
throws java.io.IOException
storeToXML in class java.util.Propertiesjava.io.IOExceptionpublic boolean isEmpty()
isEmpty in interface java.util.Map<java.lang.Object,java.lang.Object>isEmpty in class java.util.Hashtable<java.lang.Object,java.lang.Object>public int size()
size in interface java.util.Map<java.lang.Object,java.lang.Object>size in class java.util.Hashtable<java.lang.Object,java.lang.Object>public java.lang.Object get(java.lang.Object key)
get in interface java.util.Map<java.lang.Object,java.lang.Object>get in class java.util.Hashtable<java.lang.Object,java.lang.Object>public java.lang.Object put(java.lang.Object key,
java.lang.Object value)
put in interface java.util.Map<java.lang.Object,java.lang.Object>put in class java.util.Hashtable<java.lang.Object,java.lang.Object>public java.lang.Object remove(java.lang.Object key)
remove in interface java.util.Map<java.lang.Object,java.lang.Object>remove in class java.util.Hashtable<java.lang.Object,java.lang.Object>public void putAll(java.util.Map<?,?> t)
putAll in interface java.util.Map<java.lang.Object,java.lang.Object>putAll in class java.util.Hashtable<java.lang.Object,java.lang.Object>public java.util.Set<java.lang.Object> keySet()
keySet in interface java.util.Map<java.lang.Object,java.lang.Object>keySet in class java.util.Hashtable<java.lang.Object,java.lang.Object>public java.util.Enumeration<java.lang.Object> keys()
keys in class java.util.Hashtable<java.lang.Object,java.lang.Object>public java.util.Collection<java.lang.Object> values()
values in interface java.util.Map<java.lang.Object,java.lang.Object>values in class java.util.Hashtable<java.lang.Object,java.lang.Object>public java.util.Set<java.util.Map.Entry<java.lang.Object,java.lang.Object>> entrySet()
entrySet in interface java.util.Map<java.lang.Object,java.lang.Object>entrySet in class java.util.Hashtable<java.lang.Object,java.lang.Object>public java.util.Enumeration<java.lang.Object> elements()
elements in class java.util.Hashtable<java.lang.Object,java.lang.Object>public boolean containsKey(java.lang.Object key)
containsKey in interface java.util.Map<java.lang.Object,java.lang.Object>containsKey in class java.util.Hashtable<java.lang.Object,java.lang.Object>public boolean containsValue(java.lang.Object value)
containsValue in interface java.util.Map<java.lang.Object,java.lang.Object>containsValue in class java.util.Hashtable<java.lang.Object,java.lang.Object>public boolean contains(java.lang.Object value)
contains in class java.util.Hashtable<java.lang.Object,java.lang.Object>public void clear()
clear in interface java.util.Map<java.lang.Object,java.lang.Object>clear in class java.util.Hashtable<java.lang.Object,java.lang.Object>public java.lang.Object clone()
clone in class java.util.Hashtable<java.lang.Object,java.lang.Object>public boolean equals(java.lang.Object o)
equals in interface java.util.Map<java.lang.Object,java.lang.Object>equals in class java.util.Hashtable<java.lang.Object,java.lang.Object>public int hashCode()
hashCode in interface java.util.Map<java.lang.Object,java.lang.Object>hashCode in class java.util.Hashtable<java.lang.Object,java.lang.Object>public java.lang.String toString()
toString in class java.util.Hashtable<java.lang.Object,java.lang.Object>protected void rehash()
rehash in class java.util.Hashtable<java.lang.Object,java.lang.Object>