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
-
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 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
(package private) String
mangleMethodName
(String prefix, String string) 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
-
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
-