Package org.jpos.core
Class Environment
- java.lang.Object
-
- org.jpos.core.Environment
-
- All Implemented Interfaces:
Loggeable
public class Environment extends java.lang.Object implements Loggeable
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.util.Map<java.lang.String,java.lang.String>
notMap
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
dump(java.io.PrintStream p, java.lang.String indent)
static void
flat(java.util.Properties properties, java.lang.String prefix, java.util.Map<java.lang.String,java.lang.Object> c, boolean dereference)
static java.lang.String
get(java.lang.String p)
static java.lang.String
get(java.lang.String p, java.lang.String def)
java.lang.String
getEnvDir()
static Environment
getEnvironment()
java.lang.String
getErrorString()
java.lang.String
getName()
java.lang.String
getProperty(java.lang.String s)
If property name has the pattern${propname}
, this method will Attempt to get it from an operating system environment variable called 'propname' If not present, it will try to pick it from the Java system.property If not present either, it will try the target environment (either.yml
or.cfg
Otherwise it returns null The special pattern$env{propname}
would just try to pick it from the OS environment.java.lang.String
getProperty(java.lang.String p, java.lang.String def)
static Environment
reload()
java.lang.String
toString()
-
-
-
Field Detail
-
notMap
protected static java.util.Map<java.lang.String,java.lang.String> notMap
-
-
Method Detail
-
getName
public java.lang.String getName()
-
getEnvDir
public java.lang.String getEnvDir()
-
reload
public static Environment reload() throws java.io.IOException
- Throws:
java.io.IOException
-
getEnvironment
public static Environment getEnvironment()
-
get
public static java.lang.String get(java.lang.String p)
-
get
public static java.lang.String get(java.lang.String p, java.lang.String def)
-
getProperty
public java.lang.String getProperty(java.lang.String p, java.lang.String def)
-
getErrorString
public java.lang.String getErrorString()
-
getProperty
public java.lang.String getProperty(java.lang.String s)
If property name has the pattern${propname}
, this method will- Attempt to get it from an operating system environment variable called 'propname'
- If not present, it will try to pick it from the Java system.property
- If not present either, it will try the target environment (either
.yml
or.cfg
- Otherwise it returns null
$env{propname}
would just try to pick it from the OS environment.$sys{propname}
will just try to get it from a System.property and$verb{propname}
will return a verbatim copy of the value.- Parameters:
s
- property name- Returns:
- property value
-
flat
public static void flat(java.util.Properties properties, java.lang.String prefix, java.util.Map<java.lang.String,java.lang.Object> c, boolean dereference)
-
dump
public void dump(java.io.PrintStream p, java.lang.String indent)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-