net.sf.sasl.language.placeholder.aop.resolver
Class EnvironmentPlaceholderResolver

java.lang.Object
  extended by net.sf.sasl.language.placeholder.aop.resolver.EnvironmentPlaceholderResolver
All Implemented Interfaces:
IPlaceholderResolver

public class EnvironmentPlaceholderResolver
extends Object
implements IPlaceholderResolver

The resolver offers placeholders to get access to environment variables.

iEnv{'variable name'}:
Returns the value of a placeholder interpreter environment variable.
sEnv{'variable name'}:
Returns the value of a global system variable (same as calling System.getenv("variable name")).
env{'variable name'}:
Returns the value of a system property (same as calling System.getProperty("variable name")).
setIEnv{'variable name', value}
Sets a shared interpreter environment variable.

Since:
0.0.1 (sasl-common-aspect-library)
Author:
Philipp Förmer

Constructor Summary
EnvironmentPlaceholderResolver()
           
 
Method Summary
 Set<String> getResolveablePlaceholders()
          Returns a set of all placeholder procedures names that can be resolved by the placeholder.
 Object resolve(String placeholderName, Object[] placeholderArguments, IEnvironment environment)
          Resolves the given placeholder under the passed interpreter environment.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EnvironmentPlaceholderResolver

public EnvironmentPlaceholderResolver()
Method Detail

getResolveablePlaceholders

public Set<String> getResolveablePlaceholders()
Description copied from interface: IPlaceholderResolver
Returns a set of all placeholder procedures names that can be resolved by the placeholder.

Specified by:
getResolveablePlaceholders in interface IPlaceholderResolver
Returns:
non null.
Since:
0.0.1 (sasl-common-aspect-library)
See Also:
IPlaceholderResolver.getResolveablePlaceholders()

resolve

public Object resolve(String placeholderName,
                      Object[] placeholderArguments,
                      IEnvironment environment)
               throws ResolveException
Description copied from interface: IPlaceholderResolver
Resolves the given placeholder under the passed interpreter environment. The placeholderArguments are static defined (in a placeholder script) or dynamic created parameters (by other placeholder calls) that are passed to the placeholder as procedure arguments.
The resolve method is only invoked for placeholders that the resolver defines that he offers them (IPlaceholderResolver.getResolveablePlaceholders()).

Specified by:
resolve in interface IPlaceholderResolver
Parameters:
placeholderName - non null.
placeholderArguments - non null.
environment - non null
Returns:
null or non null.
Throws:
ResolveException - if the placeholder could not get resolved, for example because the parameters mismatch, or the resolution is only successful for a specific target method execution phase.
Since:
0.0.1 (sasl-common-aspect-library)
See Also:
IPlaceholderResolver.resolve(java.lang.String, java.lang.Object[], net.sf.sasl.language.placeholder.aop.interpreter.IEnvironment)


Copyright © 2010. All Rights Reserved.