public final class Props extends java.lang.Object implements java.lang.Iterable<Props.Prop>
This is larger in scope than the standard Properties
, as it will also handle tracking the origin of each property, if it was overridden,
and also allowing for ${property}
expansion.
Modifier and Type | Class and Description |
---|---|
static class |
Props.Prop |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ORIGIN_SYSPROP |
Constructor and Description |
---|
Props() |
Modifier and Type | Method and Description |
---|---|
void |
addAll(Props other) |
boolean |
addPossibleProperty(java.lang.String arg,
java.lang.String source)
Add a potential argument as a property.
|
java.lang.String |
cleanReference(java.lang.String property) |
boolean |
containsKey(java.lang.String key) |
java.lang.String |
expand(java.lang.String str) |
Props.Prop |
getProp(java.lang.String key) |
Props.Prop |
getProp(java.lang.String key,
boolean searchSystemProps) |
java.lang.String |
getString(java.lang.String key) |
java.lang.String |
getString(java.lang.String key,
java.lang.String defVal) |
static java.lang.String |
getValue(java.lang.String arg) |
static java.util.List<java.lang.String> |
getValues(java.lang.String arg) |
static boolean |
hasPropertyKey(java.lang.String name) |
java.util.Iterator<Props.Prop> |
iterator() |
void |
reset() |
void |
setProperty(Props.Prop prop) |
void |
setProperty(java.lang.String key,
java.lang.String value,
java.lang.String origin) |
void |
setSystemProperty(java.lang.String key,
java.lang.String value) |
int |
size() |
void |
store(java.io.OutputStream stream,
java.lang.String comments) |
java.lang.String |
toString() |
public static final java.lang.String ORIGIN_SYSPROP
public static java.lang.String getValue(java.lang.String arg)
public static java.util.List<java.lang.String> getValues(java.lang.String arg)
public void addAll(Props other)
public boolean addPossibleProperty(java.lang.String arg, java.lang.String source)
If arg is not a property, ignore it.
arg
- the argument to parse for a potential propertysource
- the source for this argument (to track origin of property from)public java.lang.String cleanReference(java.lang.String property)
public boolean containsKey(java.lang.String key)
public java.lang.String expand(java.lang.String str)
public Props.Prop getProp(java.lang.String key)
public Props.Prop getProp(java.lang.String key, boolean searchSystemProps)
public java.lang.String getString(java.lang.String key)
public java.lang.String getString(java.lang.String key, java.lang.String defVal)
public static boolean hasPropertyKey(java.lang.String name)
public java.util.Iterator<Props.Prop> iterator()
iterator
in interface java.lang.Iterable<Props.Prop>
public void reset()
public void setProperty(Props.Prop prop)
public void setProperty(java.lang.String key, java.lang.String value, java.lang.String origin)
public int size()
public void store(java.io.OutputStream stream, java.lang.String comments) throws java.io.IOException
java.io.IOException
public void setSystemProperty(java.lang.String key, java.lang.String value)
public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 1995–2023 Webtide. All rights reserved.