Class AttributeResolverHelper
- java.lang.Object
-
- org.jvnet.hk2.config.VariableResolver
-
- org.glassfish.admin.amx.impl.config.AttributeResolverHelper
-
- All Implemented Interfaces:
Translator
@Taxonomy(stability=UNCOMMITTED) public class AttributeResolverHelper extends VariableResolver
Helper to resolve attribute configuration values eg ${com.sun.aas.installRoot} once they have already been obtained in "raw" form. If the goal is to fetch the attribute values in already-resolved form, do so directly via
-
-
Field Summary
-
Fields inherited from interface org.jvnet.hk2.config.Translator
NOOP, SYS_PROP_TR
-
-
Constructor Summary
Constructors Constructor Description AttributeResolverHelper()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected StringgetVariableValue(String varName)Returns the value of the variable.static booleanneedsResolving(String value)Return true if the string is a template string of the for ${...}Stringresolve(String in)Resolve the String using the target resolver (MBean).-
Methods inherited from class org.jvnet.hk2.config.VariableResolver
translate
-
-
-
-
Method Detail
-
getVariableValue
protected String getVariableValue(String varName) throws TranslationException
Description copied from class:VariableResolverReturns the value of the variable. This class will not try to further expand variables in the returned value. If the implementation wants to do so, that is the implementation's responsibility.- Specified by:
getVariableValuein classVariableResolver- Returns:
- null if the variable is not found. The caller will report an error.
When the variable is not found, it's also legal to throw
TranslationException, which is an useful technique if the implementation would like to report additional errors. - Throws:
TranslationException
-
needsResolving
public static boolean needsResolving(String value)
Return true if the string is a template string of the for ${...}
-
resolve
public String resolve(String in) throws TranslationException
Resolve the String using the target resolver (MBean).- Throws:
TranslationException
-
-