/* * 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.
*/ /* Generated By:JJTree: Do not edit this line. AstFunction.java */ package org.apache.el.parser;
// quickly validate again for this request if (fnMapper == null) { thrownew ELException(MessageFactory.get("error.fnMapper.null"));
}
Method m = fnMapper.resolveFunction(this.prefix, this.localName);
if (m == null && this.prefix.length() == 0) { // TODO: Do we need to think about precedence of the various ways // a lambda expression may be obtained from something that // the parser thinks is a function?
Object obj = null; if (ctx.isLambdaArgument(this.localName)) {
obj = ctx.getLambdaArgument(this.localName);
} if (obj == null) {
VariableMapper varMapper = ctx.getVariableMapper(); if (varMapper != null) {
obj = varMapper.resolveVariable(this.localName); if (obj instanceof ValueExpression) { // See if this returns a LambdaExpression
obj = ((ValueExpression) obj).getValue(ctx);
}
}
} if (obj == null) {
obj = ctx.getELResolver().getValue(ctx, null, this.localName);
} if (obj instanceof LambdaExpression) { // Build arguments int i = 0; while (obj instanceof LambdaExpression && i < jjtGetNumChildren()) {
Node args = jjtGetChild(i);
obj = ((LambdaExpression) obj).invoke(((AstMethodParameters) args).getParameters(ctx));
i++;
} if (i < jjtGetNumChildren()) { // Haven't consumed all the sets of parameters therefore // there were too many sets of parameters thrownew ELException(MessageFactory.get("error.lambda.tooManyMethodParameterSets"));
} return obj;
}
// Call to a constructor or a static method
obj = ctx.getImportHandler().resolveClass(this.localName); if (obj != null) { return ctx.getELResolver().invoke(ctx, new ELClass((Class<?>) obj), "", null,
((AstMethodParameters) this.children[0]).getParameters(ctx));
}
obj = ctx.getImportHandler().resolveStatic(this.localName); if (obj != null) { return ctx.getELResolver().invoke(ctx, new ELClass((Class<?>) obj), this.localName, null,
((AstMethodParameters) this.children[0]).getParameters(ctx));
}
}
if (m == null) { thrownew ELException(MessageFactory.get("error.fnMapper.method", this.getOutputName()));
}
// Not a lambda expression so must be a function. Check there is just a // single set of method parameters if (this.jjtGetNumChildren() != 1) { thrownew ELException(MessageFactory.get("error.function.tooManyMethodParameterSets", getOutputName()));
}
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.