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

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

public class TargetPlaceholderResolver
extends Object
implements IPlaceholderResolver

The resolver offers some reflection information placeholders for the target class and target method. targetClassName{['qualification']}:
Returns the name of the target class, the optional parameter qualification can have the values 'full' (= full qualified class name) or 'simple' (=simple class name). The default is 'full'.
targetMethodName
Returns the name of the target method
targetMethodParameterTypes{[parameterNames][,[ 'qualification'],['separator']]}:
Returns the names of the target method parameter types.
Optional parameters: parameterNames: If true than the names of the parameters will be placed after the parameters types. If false not.
qualification: Can have the values 'full' (= full qualified class name) or 'simple' (=simple class name). The default is 'simple'.
separator: If the target method has more than one parameter, than the separator will be used to separate the parameters from each other. The default separator is ', '.
targetMethodReturnType{['qualification']}:
Returns the name of the target return type class, the optional parameter qualification can have the values 'full' (= full qualified class name) or 'simple' (=simple class name). The default is 'full'.

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

Constructor Summary
TargetPlaceholderResolver()
           
 
Method Summary
 IParameterNameLoader getParameterNameLoader()
          Returns the parameter name loader which will be used to load the parameter name symbol table of a target method.
 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.
 void setParameterNameLoader(IParameterNameLoader parameterNameLoader)
          Set the parameter name loader which will be used to load the parameter name symbol table of a target method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TargetPlaceholderResolver

public TargetPlaceholderResolver()
Method Detail

getParameterNameLoader

public IParameterNameLoader getParameterNameLoader()
Returns the parameter name loader which will be used to load the parameter name symbol table of a target method.

Returns:
null or non null
Since:
0.0.1 (sasl-common-aspect-library)

setParameterNameLoader

public void setParameterNameLoader(IParameterNameLoader parameterNameLoader)
Set the parameter name loader which will be used to load the parameter name symbol table of a target method.

Parameters:
parameterNameLoader - null or non null
Since:
0.0.1 (sasl-common-aspect-library)

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.
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.
See Also:
IPlaceholderResolver.resolve(java.lang.String, java.lang.Object[], net.sf.sasl.language.placeholder.aop.interpreter.IEnvironment)


Copyright © 2010. All Rights Reserved.