|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectasia.redact.bracket.properties.AbstractPropertiesBase
asia.redact.bracket.properties.PropertiesImpl
public class PropertiesImpl
A better Properties class. This implementation class is thread-safe.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface asia.redact.bracket.properties.Properties |
|---|
Properties.Factory, Properties.Mode |
| Field Summary |
|---|
| Fields inherited from class asia.redact.bracket.properties.AbstractPropertiesBase |
|---|
lock, map |
| Constructor Summary | |
|---|---|
PropertiesImpl()
|
|
PropertiesImpl(InputStream in)
|
|
PropertiesImpl(Properties legacy)
Some slight information loss here is unavoidable. |
|
PropertiesImpl(Reader in)
|
|
PropertiesImpl(URL url)
|
|
| Method Summary | |
|---|---|
Date |
dateValue(String key)
Date value here is assumed to be a long |
Date |
dateValue(String key,
String format)
I should really deprecate this - you should really use long values as dates in a serialization. |
boolean |
equals(Object obj)
|
String |
get(String key)
Get the value of the property; concatenate multiple lines. |
List<String> |
getComments(String key)
Get the list of comments, return an empty list if none |
Properties |
getGroup(GroupParams params)
|
List<String> |
getKeyGroup(String keyBase)
|
Map<String,ValueModel> |
getPropertyMap()
Can be used to get direct access to the Entry data structures |
char |
getSeparator(String key)
The char found in the parse, normally '=' |
Node |
getTree()
Use "\\." as the separator |
Node |
getTree(GroupParams params)
Get the properties as a tree of nodes with a selector a.b.c=something a.b.c.d=something else a.b.c.e.f=item a.b.c.e=item2 |
int |
hashCode()
|
boolean |
hasValue(String key)
Returns true if the key exists and has a non-empty value |
protected void |
initMap()
|
int |
intValue(String key)
Coerce to an integer value. |
long |
longValue(String key)
Coerce to a long value. |
Properties |
merge(Properties props)
This is a merge function, existing keys which do not collide with the incoming are kept, keys that collide are overwritten with the new values TODO, cause comments to come over as well |
Properties |
merge(Properties props,
boolean mergeComments)
Overwrite existing keys with the new ones, keep those existing ones that don't collide This operation is non-destructive on the input |
void |
put(String key,
String... values)
yes, multivalued (multilined) properties are in the spec. |
void |
synchronize(Node rootNode)
Cause a graph to become the contents of the properties file. |
| Methods inherited from class asia.redact.bracket.properties.AbstractPropertiesBase |
|---|
clear, containsKey, containsValue, isEmpty, keySet, remove, size, toString, values |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface asia.redact.bracket.properties.Properties |
|---|
clear, containsKey, size |
| Constructor Detail |
|---|
public PropertiesImpl()
public PropertiesImpl(Properties legacy)
public PropertiesImpl(URL url)
public PropertiesImpl(InputStream in)
public PropertiesImpl(Reader in)
| Method Detail |
|---|
protected void initMap()
public String get(String key)
get in interface Propertieskey -
RuntimeException - if key is not present.
public void put(String key,
String... values)
put in interface Propertieskey - values - public Map<String,ValueModel> getPropertyMap()
Properties
getPropertyMap in interface Propertiespublic List<String> getComments(String key)
Properties
getComments in interface Propertiespublic char getSeparator(String key)
Properties
getSeparator in interface Propertiespublic List<String> getKeyGroup(String keyBase)
public int hashCode()
hashCode in class AbstractPropertiesBasepublic boolean equals(Object obj)
equals in class AbstractPropertiesBasepublic Properties merge(Properties props)
merge in interface Propertiesprops -
public Properties merge(Properties props,
boolean mergeComments)
Properties
merge in interface Propertiespublic Node getTree()
getTree in interface Propertiespublic Node getTree(GroupParams params)
PropertiesGet the properties as a tree of nodes with a selector a.b.c=something a.b.c.d=something else a.b.c.e.f=item a.b.c.e=item2
getTree in interface Propertiespublic Properties getGroup(GroupParams params)
public int intValue(String key)
Properties
intValue in interface Propertiespublic long longValue(String key)
Properties
longValue in interface Propertiespublic Date dateValue(String key)
Properties
dateValue in interface Properties
public Date dateValue(String key,
String format)
throws ParseException
dateValue in interface PropertiesParseExceptionpublic boolean hasValue(String key)
Properties
hasValue in interface Propertiespublic void synchronize(Node rootNode)
Properties
synchronize in interface Properties
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||