JBoss Metadata Common 7.2.2.Final

org.jboss.metadata.property
Class JBossASSimpleExpressionResolver

java.lang.Object
  extended by org.jboss.metadata.property.JBossASSimpleExpressionResolver
All Implemented Interfaces:
PropertyResolver, SimpleExpressionResolver
Direct Known Subclasses:
PropertiesPropertyResolver, SystemPropertyResolver

public abstract class JBossASSimpleExpressionResolver
extends Object
implements SimpleExpressionResolver, PropertyResolver

Base class for SimpleExpressionResolver implementations that handle traditional JBoss AS style expressions, with syntax key[,key]*[:defaultValue]. This class handles:

  1. any defaultValue if all key values are unresolvable
  2. separation of multiple comma-delimited key values
  3. the special cases where key is the string "/" or ":", returning File.separator and File.pathSeparator, respectively.

Author:
Brian Stansberry (c) 2014 Red Hat Inc.

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.jboss.metadata.property.SimpleExpressionResolver
SimpleExpressionResolver.ResolutionResult
 
Constructor Summary
JBossASSimpleExpressionResolver()
           
 
Method Summary
 String resolve(String propertyName)
          Deprecated. use SimpleExpressionResolver and resolveExpressionContent(String)
 SimpleExpressionResolver.ResolutionResult resolveExpressionContent(String expressionContent)
          Parses the given expression, extracting any key if present and returning the resolved value, if available, or, if not, returning any default value that is present.
protected abstract  String resolveKey(String key)
          Resolve a value with the given key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JBossASSimpleExpressionResolver

public JBossASSimpleExpressionResolver()
Method Detail

resolve

@Deprecated
public String resolve(String propertyName)
Deprecated. use SimpleExpressionResolver and resolveExpressionContent(String)

Treats propertyName as expression key and passes it to resolveExpressionKey(String). This method is retained for compatibility with legacy PropertyResolver usage.

Specified by:
resolve in interface PropertyResolver
Parameters:
propertyName - the expression The name to resolve.
Returns:
The resolved value or null if the property can not be resolved.

resolveExpressionContent

public SimpleExpressionResolver.ResolutionResult resolveExpressionContent(String expressionContent)
Parses the given expression, extracting any key if present and returning the resolved value, if available, or, if not, returning any default value that is present. See the class javadoc for full details.

Specified by:
resolveExpressionContent in interface SimpleExpressionResolver
Parameters:
expressionContent - the expression
Returns:
the resolved value, or null if the value cannot be resolved

resolveKey

protected abstract String resolveKey(String key)
Resolve a value with the given key.

Parameters:
key - the key. Will not be null
Returns:
the resolved value, or null if no value corresponds to key

JBoss Metadata Common 7.2.2.Final

Copyright © 2015 JBoss by Red Hat. All Rights Reserved.