Top Inners Fields Constructors Methods
com.sun.el.lang

public final Class ExpressionBuilder

extends Object
implements NodeVisitor
Class Inheritance
All Implemented Interfaces
com.sun.el.parser.NodeVisitor
Imports
java.io.StringReader, java.lang.ref.ReferenceQueue, .SoftReference, java.lang.reflect.Method, java.util.concurrent.ConcurrentHashMap, javax.el.ELContext, .ELException, .FunctionMapper, .MethodExpression, .ValueExpression, .VariableMapper, com.sun.el.MethodExpressionImpl, .MethodExpressionLiteral, .ValueExpressionImpl, com.sun.el.parser.AstCompositeExpression, .AstDeferredExpression, .AstDynamicExpression, .AstFunction, .AstIdentifier, .AstLiteralExpression, .AstMethodArguments, .AstValue, .ELParser, .Node, .NodeVisitor, .ParseException, com.sun.el.util.MessageFactory

Authors
Jacob Hookom [[email protected]], Kin-man Chung // EL cache
Version
$Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author: kchung $

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
private static class

Field Summary

Modifier and TypeField and Description
private static final ExpressionBuilder.SoftConcurrentHashMap
private String
private FunctionMapper
private VariableMapper

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private Node
public MethodExpression
createMethodExpression(Class<T> expectedReturnType, Class<T>[] expectedParamTypes)

public static Node
private static Node
public ValueExpression
createValueExpression(Class<T> expectedType)

private void
prepare(Node node)

Scan the expression nodes and captures the functions and variables used in this expression.

public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

cacheback to summary
private static final ExpressionBuilder.SoftConcurrentHashMap cache
expressionback to summary
private String expression
fnMapperback to summary
private FunctionMapper fnMapper
varMapperback to summary
private VariableMapper varMapper

Constructor Detail

ExpressionBuilderback to summary
public ExpressionBuilder(String expression, ELContext ctx) throws ELException

Method Detail

buildback to summary
private Node build() throws ELException
createMethodExpressionback to summary
public MethodExpression createMethodExpression(Class<T> expectedReturnType, Class<T>[] expectedParamTypes) throws ELException
createNodeback to summary
public static Node createNode(String expr) throws ELException
createNodeInternalback to summary
private static Node createNodeInternal(String expr) throws ELException
createValueExpressionback to summary
public ValueExpression createValueExpression(Class<T> expectedType) throws ELException
prepareback to summary
private void prepare(Node node) throws ELException

Scan the expression nodes and captures the functions and variables used in this expression. This ensures that any changes to the functions or variables mappings during the expression will not affect the evaluation of this expression, as the functions and variables are bound and resolved at parse time, as specified in the spec.

visitback to summary
public void visit(Node node) throws ELException

Implements com.sun.el.parser.NodeVisitor.visit.

Annotations
@Override
com.sun.el.lang back to summary

private Class ExpressionBuilder.NodeSoftReference

extends SoftReference<Node>
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv final String

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Inherited from java.lang.ref.SoftReference:
get

Field Detail

keyback to summary
pack-priv final String key

Constructor Detail

NodeSoftReferenceback to summary
pack-priv NodeSoftReference(String key, Node node, ReferenceQueue<Node> refQ)
com.sun.el.lang back to summary

private Class ExpressionBuilder.SoftConcurrentHashMap

extends ConcurrentHashMap<String, Node>
Class Inheritance

Field Summary

Modifier and TypeField and Description
private static final int
private ConcurrentHashMap<String, ExpressionBuilder.NodeSoftReference>
private ReferenceQueue<Node>

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private void
public Node
get(Object
the key whose associated value is to be returned
key
)

Overrides java.util.concurrent.ConcurrentHashMap.get.

Implements java.util.Map.get.

Returns the value to which the specified key is mapped, or null if this map contains no mapping for the key.
public Node
put(String
key with which the specified value is to be associated
key
,
Node
value to be associated with the specified key
value
)

Overrides java.util.concurrent.ConcurrentHashMap.put.

Implements java.util.Map.put.

Maps the specified key to the specified value in this table.
public Node
putIfAbsent(String
key with which the specified value is to be associated
key
,
Node
value to be associated with the specified key
value
)

Overrides java.util.concurrent.ConcurrentHashMap.putIfAbsent.

Overrides default java.util.Map.putIfAbsent.

Implements java.util.concurrent.ConcurrentMap.putIfAbsent.

If the specified key is not already associated with a value, associates it with the given value.
Inherited from java.util.concurrent.ConcurrentHashMap:
clearcomputecomputeIfAbsentcomputeIfPresentcontainscontainsKeycontainsValueelementsentrySetequalsforEachforEachforEachforEachEntryforEachEntryforEachKeyforEachKeyforEachValueforEachValuegetOrDefaulthashCodeisEmptykeyskeySetkeySetmappingCountmergenewKeySetnewKeySetputAllreducereduceEntriesreduceEntriesreduceEntriesToDoublereduceEntriesToIntreduceEntriesToLongreduceKeysreduceKeysreduceKeysToDoublereduceKeysToIntreduceKeysToLongreduceToDoublereduceToIntreduceToLongreduceValuesreduceValuesreduceValuesToDoublereduceValuesToIntreduceValuesToLongremoveremovereplacereplacereplaceAllsearchsearchEntriessearchKeyssearchValuessizetoStringvalues

Field Detail

CACHE_INIT_SIZEback to summary
private static final int CACHE_INIT_SIZE
mapback to summary
private ConcurrentHashMap<String, ExpressionBuilder.NodeSoftReference> map
refQback to summary
private ReferenceQueue<Node> refQ

Constructor Detail

SoftConcurrentHashMapback to summary
private SoftConcurrentHashMap()

Method Detail

cleanupback to summary
private void cleanup()
getback to summary
public Node get(Object key)

Overrides java.util.concurrent.ConcurrentHashMap.get.

Implements java.util.Map.get.

Doc from java.util.concurrent.ConcurrentHashMap.get.

Returns the value to which the specified key is mapped, or null if this map contains no mapping for the key.

More formally, if this map contains a mapping from a key k to a value v such that key.equals(k), then this method returns v; otherwise it returns null. (There can be at most one such mapping.)

Parameters
key:Object

Doc from java.util.Map.get.

the key whose associated value is to be returned

Returns:Node

Doc from java.util.Map.get.

the value to which the specified key is mapped, or null if this map contains no mapping for the key

Annotations
@Override
putback to summary
public Node put(String key, Node value)

Overrides java.util.concurrent.ConcurrentHashMap.put.

Implements java.util.Map.put.

Doc from java.util.concurrent.ConcurrentHashMap.put.

Maps the specified key to the specified value in this table. Neither the key nor the value can be null.

The value can be retrieved by calling the get method with a key that is equal to the original key.

Parameters
key:String

key with which the specified value is to be associated

value:Node

value to be associated with the specified key

Returns:Node

the previous value associated with key, or null if there was no mapping for key

Annotations
@Override
putIfAbsentback to summary
public Node putIfAbsent(String key, Node value)

Overrides java.util.concurrent.ConcurrentHashMap.putIfAbsent.

Overrides default java.util.Map.putIfAbsent.

Implements java.util.concurrent.ConcurrentMap.putIfAbsent.

Doc from java.util.concurrent.ConcurrentHashMap.putIfAbsent.

If the specified key is not already associated with a value, associates it with the given value. This is equivalent to, for this map:

 if (!map.containsKey(key))
  return map.put(key, value);
else
  return map.get(key);
except that the action is performed atomically.
Parameters
key:String

Doc from java.util.concurrent.ConcurrentMap.putIfAbsent.

key with which the specified value is to be associated

value:Node

Doc from java.util.concurrent.ConcurrentMap.putIfAbsent.

value to be associated with the specified key

Returns:Node

the previous value associated with the specified key, or null if there was no mapping for the key

Annotations
@Override