Package org.eclipse.jetty.start
Class Props
- java.lang.Object
-
- org.eclipse.jetty.start.Props
-
- All Implemented Interfaces:
java.lang.Iterable<Props.Prop>
public final class Props extends java.lang.Object implements java.lang.Iterable<Props.Prop>
Management of Properties.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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classProps.Prop
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringORIGIN_SYSPROP
-
Constructor Summary
Constructors Constructor Description Props()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAll(Props other)booleanaddPossibleProperty(java.lang.String arg, java.lang.String source)Add a potential argument as a property.java.lang.StringcleanReference(java.lang.String property)booleancontainsKey(java.lang.String key)java.lang.Stringexpand(java.lang.String str)Props.PropgetProp(java.lang.String key)Props.PropgetProp(java.lang.String key, boolean searchSystemProps)java.lang.StringgetString(java.lang.String key)java.lang.StringgetString(java.lang.String key, java.lang.String defVal)static java.lang.StringgetValue(java.lang.String arg)static java.util.List<java.lang.String>getValues(java.lang.String arg)static booleanhasPropertyKey(java.lang.String name)java.util.Iterator<Props.Prop>iterator()static Propsload(java.lang.ClassLoader classLoader, java.lang.String resourceName)static Propsload(java.net.URL url)voidreset()voidsetProperty(java.lang.String key, java.lang.String value, java.lang.String origin)voidsetProperty(Props.Prop prop)voidsetSystemProperty(java.lang.String key, java.lang.String value)intsize()voidstore(java.io.OutputStream stream, java.lang.String comments)java.lang.StringtoString()
-
-
-
Field Detail
-
ORIGIN_SYSPROP
public static final java.lang.String ORIGIN_SYSPROP
- See Also:
- Constant Field Values
-
-
Method Detail
-
getValue
public static java.lang.String getValue(java.lang.String arg)
-
getValues
public static java.util.List<java.lang.String> getValues(java.lang.String arg)
-
addAll
public void addAll(Props other)
-
addPossibleProperty
public boolean addPossibleProperty(java.lang.String arg, java.lang.String source)Add a potential argument as a property.If arg is not a property, ignore it.
- Parameters:
arg- the argument to parse for a potential propertysource- the source for this argument (to track origin of property from)- Returns:
- true if the property was added, false if the property wasn't added
-
cleanReference
public java.lang.String cleanReference(java.lang.String property)
-
containsKey
public boolean containsKey(java.lang.String key)
-
expand
public java.lang.String expand(java.lang.String str)
-
getProp
public Props.Prop getProp(java.lang.String key)
-
getProp
public Props.Prop getProp(java.lang.String key, boolean searchSystemProps)
-
getString
public java.lang.String getString(java.lang.String key)
-
getString
public java.lang.String getString(java.lang.String key, java.lang.String defVal)
-
hasPropertyKey
public static boolean hasPropertyKey(java.lang.String name)
-
iterator
public java.util.Iterator<Props.Prop> iterator()
- Specified by:
iteratorin interfacejava.lang.Iterable<Props.Prop>
-
reset
public void reset()
-
setProperty
public void setProperty(Props.Prop prop)
-
setProperty
public void setProperty(java.lang.String key, java.lang.String value, java.lang.String origin)
-
size
public int size()
-
store
public void store(java.io.OutputStream stream, java.lang.String comments) throws java.io.IOException- Throws:
java.io.IOException
-
setSystemProperty
public void setSystemProperty(java.lang.String key, java.lang.String value)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
load
public static Props load(java.lang.ClassLoader classLoader, java.lang.String resourceName)
-
load
public static Props load(java.net.URL url)
-
-