org.zkoss.xel.util
Class DualFunctionMapper

java.lang.Object
  extended by org.zkoss.xel.util.DualFunctionMapper
All Implemented Interfaces:
java.io.Serializable, FunctionMapper, FunctionMapperExt

public class DualFunctionMapper
extends java.lang.Object
implements FunctionMapper, FunctionMapperExt, java.io.Serializable

Combine two function mappers into one function mapper.

Since:
3.0.0
Author:
tomyeh
See Also:
Serialized Form

Constructor Summary
DualFunctionMapper(FunctionMapper first, FunctionMapper second)
          Constructor.
 
Method Summary
static FunctionMapper combine(FunctionMapper first, FunctionMapper second)
          Returns a function mapper by combining two function mappers.
 java.util.Collection<java.lang.String> getClassNames()
          Returns a readonly collection of the logic names of the class (never null).
 java.lang.Class<?> resolveClass(java.lang.String name)
          Resolves a class with the specified logic name, or null if not found.
 Function resolveFunction(java.lang.String prefix, java.lang.String name)
          Resolves a function Function with the specified name and prefix.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DualFunctionMapper

public DualFunctionMapper(FunctionMapper first,
                          FunctionMapper second)
Constructor. It is better to use combine(org.zkoss.xel.FunctionMapper, org.zkoss.xel.FunctionMapper) instead of this method since it checks whether any of them is null or equals.

Method Detail

combine

public static final FunctionMapper combine(FunctionMapper first,
                                           FunctionMapper second)
Returns a function mapper by combining two function mappers. It checks whether any of them is null, or equals. And, returns the non-null one if another is null. If both null, it returns null.


resolveFunction

public Function resolveFunction(java.lang.String prefix,
                                java.lang.String name)
Description copied from interface: FunctionMapper
Resolves a function Function with the specified name and prefix.

Note: not all EL evaluator support FunctionMapper.resolveFunction(java.lang.String, java.lang.String). Currently only JSP 2.0/2.1 EL-based expression factories support this method. You can check ExpressionFactory.isSupported(int) for this support.

Specified by:
resolveFunction in interface FunctionMapper
Parameters:
prefix - the prefix of the function, or "" if no prefix
name - the name of the function to resolve

getClassNames

public java.util.Collection<java.lang.String> getClassNames()
Description copied from interface: FunctionMapperExt
Returns a readonly collection of the logic names of the class (never null). Note: it is the name to resolve class, not the real class name. In other words, it is the logical name maintained by this function mapper.

Specified by:
getClassNames in interface FunctionMapperExt

resolveClass

public java.lang.Class<?> resolveClass(java.lang.String name)
Description copied from interface: FunctionMapperExt
Resolves a class with the specified logic name, or null if not found.

Note: not all EL evaluator support FunctionMapperExt.resolveClass(java.lang.String). JSP 2.0/2.1 EL-based expression factories don't support this method. You can check ExpressionFactory.isSupported(int) for this support.

Specified by:
resolveClass in interface FunctionMapperExt
Returns:
the class of the specified logic name.


Copyright © 2005-2011 Potix Corporation. All Rights Reserved. SourceForge.net Logo