Package aQute.lib.env
Class Env
java.lang.Object
aQute.libg.reporter.ReporterAdapter
aQute.lib.env.Env
- Direct Known Subclasses:
AbstractConsoleApp
-
Nested Class Summary
Nested classes/interfaces inherited from interface aQute.service.reporter.Report
Report.LocationNested classes/interfaces inherited from interface aQute.service.reporter.Reporter
Reporter.SetLocation -
Field Summary
FieldsModifier and TypeFieldDescription(package private) File(package private) final Env(package private) boolean(package private) final Properties(package private) final ReplacerAdapter -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidaddAll(Properties map) voidaddProperties(File file, Pattern matching) voidaddProperty(String key, String value) voidprotected booleanclear()<T> T<T> TThis method returns an interface that can be used to get and set the properties in a type safe way (as well as describing any semantics of these properties).getBase()Return a file relative to the base.getMap()protected PropertiesgetProperty(String key) getProperty(String key, String deflt) protected booleanboolean(package private) StringmangleMethodName(String prefix, String string) protected booleanprepare()voidvoidputAll(Properties map) voidremoveProperty(String key) voidremoveTarget(Object domain) voidvoidsetProperties(File file) voidsetProperties(URI uri) voidsetProperty(String key, String value) Methods inherited from class aQute.libg.reporter.ReporterAdapter
addErrors, addWarnings, check, error, exception, getErrors, getInfo, getInfo, getLocation, getMessages, getOut, getWarnings, isExceptions, isOk, isPedantic, isPerfect, isTrace, progress, report, run, setExceptions, setPedantic, setTrace, trace, warning
-
Field Details
-
properties
-
replacer
-
parent
-
base
File base -
prepared
boolean prepared
-
-
Constructor Details
-
Env
public Env() -
Env
-
Env
-
-
Method Details
-
process
-
getMap
-
getParent
-
getProperty
-
getProperty
-
setProperty
-
addProperty
-
removeProperty
-
putAll
-
putAll
-
addAll
-
addAll
-
setProperties
- Throws:
Exception
-
addProperties
- Throws:
Exception
-
setProperties
- Throws:
Exception
-
getHeader
-
getHeader
-
getBase
-
setBase
-
getFile
-
addTarget
-
removeTarget
-
prepare
- Throws:
Exception
-
isPrepared
protected boolean isPrepared() -
clear
protected boolean clear() -
getProperties
-
getFile
Return a file relative to the base. -
getDir
-
config
This method returns an interface that can be used to get and set the properties in a type safe way (as well as describing any semantics of these properties). The interface must have get and/or set methods. The name is mangled to change _ to . and to remove $ (which is used to mask keywords like new). If _ and $ are in there twice, one remains. The set methods return the proxy object itself so you can use it in a builder style. The values are always stored as strings (and can use macros). The result is converted to the desired type. Arguments in the set methods are always converted to strings using the toString methods. Example:interface MyConfig { int level(); MyConfig level(int level); Pattern pattern(); MyConfig pattern(String p); } Env env = ... MyConfig c = env.config(MyConfig.class, "myconfig.");- Parameters:
front- the fronting interfaceprefix- the prefix in the properties- Returns:
- an interface that can be used to get and set properties
-
config
-
mangleMethodName
-
isTrue
-