/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
*/ package org.apache.el.lang;
if (this.fnMapper != null) {
m = fnMapper.resolveFunction(funcNode.getPrefix(), funcNode
.getLocalName());
}
// References to variables that refer to lambda expressions will be // parsed as functions. This is handled at runtime but at this point // need to treat it as a variable rather than a function. if (m == null && this.varMapper != null &&
funcNode.getPrefix().length() == 0) { this.varMapper.resolveVariable(funcNode.getLocalName()); return;
}
if (this.fnMapper == null) { thrownew ELException(MessageFactory.get("error.fnMapper.null"));
}
if (m == null) { thrownew ELException(MessageFactory.get( "error.fnMapper.method", funcNode.getOutputName()));
}
// simply capture it this.varMapper.resolveVariable(variable);
}
}
public ValueExpression createValueExpression(Class<?> expectedType) throws ELException {
Node n = this.build(); returnnew ValueExpressionImpl(this.expression, n, this.fnMapper, this.varMapper, expectedType);
}
public MethodExpression createMethodExpression(Class<?> expectedReturnType, Class<?>[] expectedParamTypes) throws ELException {
Node n = this.build(); if (!n.isParametersProvided() && expectedParamTypes == null) { thrownew NullPointerException(MessageFactory
.get("error.method.nullParms"));
} if (n instanceof AstValue || n instanceof AstIdentifier) { returnnew MethodExpressionImpl(expression, n, this.fnMapper, this.varMapper, expectedReturnType, expectedParamTypes);
} elseif (n instanceof AstLiteralExpression) { returnnew MethodExpressionLiteral(expression, expectedReturnType,
expectedParamTypes);
} else { thrownew ELException(MessageFactory.get("error.invalidMethodExpression", expression));
}
}
/* * Copied from org.apache.tomcat.util.collections.SynchronizedStack since * we don't want the EL implementation to depend on the JAR where that * class resides.
*/ privatestaticclass SynchronizedStack<T> {
@SuppressWarnings("unchecked") publicsynchronized T pop() { if (index == -1) { returnnull;
}
T result = (T) stack[index];
stack[index--] = null; return result;
}
privatevoid expand() { int newSize = size * 2; if (limit != -1 && newSize > limit) {
newSize = limit;
}
Object[] newStack = new Object[newSize];
System.arraycopy(stack, 0, newStack, 0, size); // This is the only point where garbage is created by throwing away the // old array. Note it is only the array, not the contents, that becomes // garbage.
stack = newStack;
size = newSize;
}
}
}
¤ Dauer der Verarbeitung: 0.2 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.