org.sadun.util
Class EnvironmentVariables.SimpleNameTransformer
java.lang.Object
org.sadun.util.EnvironmentVariables.SimpleNameTransformer
- All Implemented Interfaces:
- EnvironmentVariables.NameTransformer
- Enclosing class:
- EnvironmentVariables
- public class EnvironmentVariables.SimpleNameTransformer
- extends java.lang.Object
- implements EnvironmentVariables.NameTransformer
A NameTransformer
which
produces names in the style of typical java property names. In detail:
- Each property is prefixed with a given prefix (default env.)
- Character case is lowered
- Underscores are substituted with dots
- If the original variable name contains both lowercase and uppercase
letters, every nonconsecutive uppercase letter is considered the start
of a word, and words are divided by dots.
For example, JAVA_HOME will become env.java.home,
CommSpec will become comm.spec and My_StrangeVariableName
will become my.strange.variable.name
- Version:
- 1.1
- Author:
- cris
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
EnvironmentVariables.SimpleNameTransformer
public EnvironmentVariables.SimpleNameTransformer(java.lang.String prefix)
EnvironmentVariables.SimpleNameTransformer
public EnvironmentVariables.SimpleNameTransformer()
transform
public java.lang.String transform(java.lang.String name)
- Specified by:
transform
in interface EnvironmentVariables.NameTransformer
transformAllUpperCase
public java.lang.String transformAllUpperCase(java.lang.String name)
- See Also:
EnvironmentVariables.NameTransformer.transform(java.lang.String)