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.Location
Nested classes/interfaces inherited from interface aQute.service.reporter.Reporter
Reporter.SetLocation
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
addAll
(Properties map) void
addProperties
(File file, Pattern matching) void
addProperty
(String key, String value) void
protected boolean
clear()
<T> T
<T> T
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).getBase()
Return a file relative to the base.getMap()
protected Properties
getProperty
(String key) getProperty
(String key, String deflt) protected boolean
boolean
protected boolean
prepare()
void
void
putAll
(Properties map) void
removeProperty
(String key) void
removeTarget
(Object domain) void
void
setProperties
(File file) void
setProperties
(URI uri) void
setProperty
(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
-
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
-
isTrue
-