public class Env extends ReporterAdapter implements Replacer, Domain
Reporter.SetLocation
Report.Location
Constructor and Description |
---|
Env() |
Env(Env env) |
Env(Properties properties,
Env parent,
File base) |
Modifier and Type | Method and Description |
---|---|
void |
addAll(Map<String,String> map) |
void |
addAll(Properties map) |
void |
addProperties(File file,
Pattern matching) |
void |
addProperty(String key,
String value) |
void |
addTarget(Object domain) |
protected boolean |
clear() |
<T> T |
config(Class<?> front) |
<T> T |
config(Class<?> front,
String prefix)
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).
|
File |
getBase() |
File |
getDir(String file,
String notfound) |
File |
getFile(String file) |
File |
getFile(String file,
String notfound)
Return a file relative to the base.
|
Header |
getHeader(String header) |
Header |
getHeader(String header,
String deflt) |
Map<String,String> |
getMap() |
Domain |
getParent() |
protected Properties |
getProperties() |
String |
getProperty(String key) |
String |
getProperty(String key,
String deflt) |
protected boolean |
isPrepared() |
boolean |
isTrue(String v) |
protected boolean |
prepare() |
String |
process(String line) |
void |
putAll(Map<String,String> map) |
void |
putAll(Properties map) |
void |
removeProperty(String key) |
void |
removeTarget(Object domain) |
void |
setBase(File file) |
void |
setProperties(File file) |
void |
setProperties(URI uri) |
void |
setProperty(String key,
String value) |
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
public Env()
public Env(Properties properties, Env parent, File base)
public Env(Env env)
public void removeProperty(String key)
public void putAll(Properties map)
public void addAll(Properties map)
public void addProperties(File file, Pattern matching) throws Exception
Exception
public File getBase()
public void setBase(File file)
public void addTarget(Object domain)
public void removeTarget(Object domain)
protected boolean isPrepared()
protected boolean clear()
protected Properties getProperties()
public <T> T config(Class<?> front, String prefix)
interface MyConfig { int level(); MyConfig level(int level); Pattern pattern(); MyConfig pattern(String p); } Env env = ... MyConfig c = env.config(MyConfig.class, "myconfig.");
front
- the fronting interfaceprefix
- the prefix in the propertiespublic <T> T config(Class<?> front)
public boolean isTrue(String v)
Copyright © 2021 aQute SARL. All rights reserved.