This commit is contained in:
2024-11-30 19:03:49 +08:00
commit 1e6763c160
3806 changed files with 737676 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
/*
* 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.parser;
import javax.el.ELException;
import org.apache.el.lang.EvaluationContext;
/**
* @author Jacob Hookom [jacob@hookom.net]
*/
public abstract class ArithmeticNode extends SimpleNode {
public ArithmeticNode(int i) {
super(i);
}
@Override
public Class<?> getType(EvaluationContext ctx)
throws ELException {
return Number.class;
}
}

View File

@@ -0,0 +1,46 @@
/*
* 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. AstAnd.java */
package org.apache.el.parser;
import javax.el.ELException;
import org.apache.el.lang.EvaluationContext;
/**
* @author Jacob Hookom [jacob@hookom.net]
*/
public final class AstAnd extends BooleanNode {
public AstAnd(int id) {
super(id);
}
@Override
public Object getValue(EvaluationContext ctx)
throws ELException {
Object obj = children[0].getValue(ctx);
Boolean b = coerceToBoolean(ctx, obj, true);
if (!b.booleanValue()) {
return b;
}
obj = children[1].getValue(ctx);
b = coerceToBoolean(ctx, obj, true);
return b;
}
}

View File

@@ -0,0 +1,50 @@
/*
* 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. AstAssign.java Version 4.3 */
package org.apache.el.parser;
import javax.el.ELException;
import org.apache.el.lang.EvaluationContext;
public class AstAssign extends SimpleNode {
public AstAssign(int id) {
super(id);
}
@Override
public Object getValue(EvaluationContext ctx) throws ELException {
Object value = children[1].getValue(ctx);
children[0].setValue(ctx, value);
return value;
}
@Override
public Class<?> getType(EvaluationContext ctx) throws ELException {
Object value = children[1].getValue(ctx);
children[0].setValue(ctx, value);
return children[1].getType(ctx);
}
}
/* JavaCC - OriginalChecksum=151e58546054b618e758d7dc172cc7b5 (do not edit this line) */

View File

@@ -0,0 +1,39 @@
/*
* 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. AstBracketSuffix.java */
package org.apache.el.parser;
import javax.el.ELException;
import org.apache.el.lang.EvaluationContext;
/**
* @author Jacob Hookom [jacob@hookom.net]
*/
public final class AstBracketSuffix extends SimpleNode {
public AstBracketSuffix(int id) {
super(id);
}
@Override
public Object getValue(EvaluationContext ctx)
throws ELException {
return this.children[0].getValue(ctx);
}
}

View File

@@ -0,0 +1,48 @@
/*
* 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. AstChoice.java */
package org.apache.el.parser;
import javax.el.ELException;
import org.apache.el.lang.EvaluationContext;
/**
* @author Jacob Hookom [jacob@hookom.net]
*/
public final class AstChoice extends SimpleNode {
public AstChoice(int id) {
super(id);
}
@Override
public Class<?> getType(EvaluationContext ctx)
throws ELException {
Object val = this.getValue(ctx);
return (val != null) ? val.getClass() : null;
}
@Override
public Object getValue(EvaluationContext ctx)
throws ELException {
Object obj0 = this.children[0].getValue(ctx);
Boolean b0 = coerceToBoolean(ctx, obj0, true);
return this.children[((b0.booleanValue() ? 1 : 2))].getValue(ctx);
}
}

View File

@@ -0,0 +1,57 @@
/*
* 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. AstCompositeExpression.java */
package org.apache.el.parser;
import javax.el.ELException;
import org.apache.el.lang.ELSupport;
import org.apache.el.lang.EvaluationContext;
/**
* @author Jacob Hookom [jacob@hookom.net]
*/
public final class AstCompositeExpression extends SimpleNode {
public AstCompositeExpression(int id) {
super(id);
}
@Override
public Class<?> getType(EvaluationContext ctx)
throws ELException {
return String.class;
}
@Override
public Object getValue(EvaluationContext ctx)
throws ELException {
StringBuilder sb = new StringBuilder(16);
Object obj = null;
if (this.children != null) {
for (int i = 0; i < this.children.length; i++) {
obj = this.children[i].getValue(ctx);
if (obj != null) {
sb.append(ELSupport.coerceToString(ctx, obj));
}
}
}
return sb.toString();
}
}

View File

@@ -0,0 +1,45 @@
/*
* 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. AstConcatenation.java Version 4.3 */
package org.apache.el.parser;
import javax.el.ELException;
import org.apache.el.lang.EvaluationContext;
public class AstConcatenation extends SimpleNode {
public AstConcatenation(int id) {
super(id);
}
@Override
public Object getValue(EvaluationContext ctx) throws ELException {
// Coerce the two child nodes to string and then concatenate
String s1 = coerceToString(ctx, children[0].getValue(ctx));
String s2 = coerceToString(ctx, children[1].getValue(ctx));
return s1 + s2;
}
@Override
public Class<?> getType(EvaluationContext ctx) throws ELException {
return String.class;
}
}
/* JavaCC - OriginalChecksum=a95de353974c2c05fa5c7d695a1d50fd (do not edit this line) */

View File

@@ -0,0 +1,57 @@
/*
* 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. AstDeferredExpression.java */
package org.apache.el.parser;
import javax.el.ELException;
import org.apache.el.lang.EvaluationContext;
/**
* @author Jacob Hookom [jacob@hookom.net]
*/
public final class AstDeferredExpression extends SimpleNode {
public AstDeferredExpression(int id) {
super(id);
}
@Override
public Class<?> getType(EvaluationContext ctx)
throws ELException {
return this.children[0].getType(ctx);
}
@Override
public Object getValue(EvaluationContext ctx)
throws ELException {
return this.children[0].getValue(ctx);
}
@Override
public boolean isReadOnly(EvaluationContext ctx)
throws ELException {
return this.children[0].isReadOnly(ctx);
}
@Override
public void setValue(EvaluationContext ctx, Object value)
throws ELException {
this.children[0].setValue(ctx, value);
}
}

View File

@@ -0,0 +1,42 @@
/*
* 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. AstDiv.java */
package org.apache.el.parser;
import javax.el.ELException;
import org.apache.el.lang.ELArithmetic;
import org.apache.el.lang.EvaluationContext;
/**
* @author Jacob Hookom [jacob@hookom.net]
*/
public final class AstDiv extends ArithmeticNode {
public AstDiv(int id) {
super(id);
}
@Override
public Object getValue(EvaluationContext ctx)
throws ELException {
Object obj0 = this.children[0].getValue(ctx);
Object obj1 = this.children[1].getValue(ctx);
return ELArithmetic.divide(obj0, obj1);
}
}

View File

@@ -0,0 +1,50 @@
/*
* 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. AstDotSuffix.java */
package org.apache.el.parser;
import javax.el.ELException;
import org.apache.el.lang.EvaluationContext;
import org.apache.el.util.MessageFactory;
import org.apache.el.util.Validation;
/**
* @author Jacob Hookom [jacob@hookom.net]
*/
public final class AstDotSuffix extends SimpleNode {
public AstDotSuffix(int id) {
super(id);
}
@Override
public Object getValue(EvaluationContext ctx)
throws ELException {
return this.image;
}
@Override
public void setImage(String image) {
if (!Validation.isIdentifier(image)) {
throw new ELException(MessageFactory.get("error.identifier.notjava",
image));
}
this.image = image;
}
}

View File

@@ -0,0 +1,57 @@
/*
* 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. AstDynamicExpression.java */
package org.apache.el.parser;
import javax.el.ELException;
import org.apache.el.lang.EvaluationContext;
/**
* @author Jacob Hookom [jacob@hookom.net]
*/
public final class AstDynamicExpression extends SimpleNode {
public AstDynamicExpression(int id) {
super(id);
}
@Override
public Class<?> getType(EvaluationContext ctx)
throws ELException {
return this.children[0].getType(ctx);
}
@Override
public Object getValue(EvaluationContext ctx)
throws ELException {
return this.children[0].getValue(ctx);
}
@Override
public boolean isReadOnly(EvaluationContext ctx)
throws ELException {
return this.children[0].isReadOnly(ctx);
}
@Override
public void setValue(EvaluationContext ctx, Object value)
throws ELException {
this.children[0].setValue(ctx, value);
}
}

View File

@@ -0,0 +1,60 @@
/*
* 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. AstEmpty.java */
package org.apache.el.parser;
import java.util.Collection;
import java.util.Map;
import javax.el.ELException;
import org.apache.el.lang.EvaluationContext;
/**
* @author Jacob Hookom [jacob@hookom.net]
*/
public final class AstEmpty extends SimpleNode {
public AstEmpty(int id) {
super(id);
}
@Override
public Class<?> getType(EvaluationContext ctx)
throws ELException {
return Boolean.class;
}
@Override
public Object getValue(EvaluationContext ctx)
throws ELException {
Object obj = this.children[0].getValue(ctx);
if (obj == null) {
return Boolean.TRUE;
} else if (obj instanceof String) {
return Boolean.valueOf(((String) obj).length() == 0);
} else if (obj instanceof Object[]) {
return Boolean.valueOf(((Object[]) obj).length == 0);
} else if (obj instanceof Collection<?>) {
return Boolean.valueOf(((Collection<?>) obj).isEmpty());
} else if (obj instanceof Map<?,?>) {
return Boolean.valueOf(((Map<?,?>) obj).isEmpty());
}
return Boolean.FALSE;
}
}

View File

@@ -0,0 +1,41 @@
/*
* 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. AstEqual.java */
package org.apache.el.parser;
import javax.el.ELException;
import org.apache.el.lang.EvaluationContext;
/**
* @author Jacob Hookom [jacob@hookom.net]
*/
public final class AstEqual extends BooleanNode {
public AstEqual(int id) {
super(id);
}
@Override
public Object getValue(EvaluationContext ctx)
throws ELException {
Object obj0 = this.children[0].getValue(ctx);
Object obj1 = this.children[1].getValue(ctx);
return Boolean.valueOf(equals(ctx, obj0, obj1));
}
}

View File

@@ -0,0 +1,39 @@
/*
* 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. AstFalse.java */
package org.apache.el.parser;
import javax.el.ELException;
import org.apache.el.lang.EvaluationContext;
/**
* @author Jacob Hookom [jacob@hookom.net]
*/
public final class AstFalse extends BooleanNode {
public AstFalse(int id) {
super(id);
}
@Override
public Object getValue(EvaluationContext ctx)
throws ELException {
return Boolean.FALSE;
}
}

View File

@@ -0,0 +1,60 @@
/*
* 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. AstFloatingPoint.java */
package org.apache.el.parser;
import java.math.BigDecimal;
import javax.el.ELException;
import org.apache.el.lang.EvaluationContext;
/**
* @author Jacob Hookom [jacob@hookom.net]
*/
public final class AstFloatingPoint extends SimpleNode {
public AstFloatingPoint(int id) {
super(id);
}
private volatile Number number;
public Number getFloatingPoint() {
if (this.number == null) {
try {
this.number = Double.valueOf(this.image);
} catch (ArithmeticException e0) {
this.number = new BigDecimal(this.image);
}
}
return this.number;
}
@Override
public Object getValue(EvaluationContext ctx)
throws ELException {
return this.getFloatingPoint();
}
@Override
public Class<?> getType(EvaluationContext ctx)
throws ELException {
return this.getFloatingPoint().getClass();
}
}

View File

@@ -0,0 +1,231 @@
/*
* 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;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import javax.el.ELClass;
import javax.el.ELException;
import javax.el.FunctionMapper;
import javax.el.LambdaExpression;
import javax.el.ValueExpression;
import javax.el.VariableMapper;
import org.apache.el.lang.EvaluationContext;
import org.apache.el.util.MessageFactory;
/**
* @author Jacob Hookom [jacob@hookom.net]
*/
public final class AstFunction extends SimpleNode {
protected String localName = "";
protected String prefix = "";
public AstFunction(int id) {
super(id);
}
public String getLocalName() {
return localName;
}
public String getOutputName() {
if (this.prefix == null) {
return this.localName;
} else {
return this.prefix + ":" + this.localName;
}
}
public String getPrefix() {
return prefix;
}
@Override
public Class<?> getType(EvaluationContext ctx)
throws ELException {
FunctionMapper fnMapper = ctx.getFunctionMapper();
// quickly validate again for this request
if (fnMapper == null) {
throw new ELException(MessageFactory.get("error.fnMapper.null"));
}
Method m = fnMapper.resolveFunction(this.prefix, this.localName);
if (m == null) {
throw new ELException(MessageFactory.get("error.fnMapper.method",
this.getOutputName()));
}
return m.getReturnType();
}
@Override
public Object getValue(EvaluationContext ctx)
throws ELException {
FunctionMapper fnMapper = ctx.getFunctionMapper();
// quickly validate again for this request
if (fnMapper == null) {
throw new 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
throw new 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), "<init>", 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) {
throw new 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) {
throw new ELException(MessageFactory.get(
"error.funciton.tooManyMethodParameterSets",
getOutputName()));
}
Node parameters = jjtGetChild(0);
Class<?>[] paramTypes = m.getParameterTypes();
Object[] params = null;
Object result = null;
int inputParameterCount = parameters.jjtGetNumChildren();
int methodParameterCount = paramTypes.length;
if (inputParameterCount == 0 && methodParameterCount == 1 && m.isVarArgs()) {
params = new Object[] { null };
} else if (inputParameterCount > 0) {
params = new Object[methodParameterCount];
try {
for (int i = 0; i < methodParameterCount; i++) {
if (m.isVarArgs() && i == methodParameterCount - 1) {
if (inputParameterCount < methodParameterCount) {
params[i] = new Object[] { null };
} else if (inputParameterCount == methodParameterCount &&
paramTypes[i].isArray()) {
params[i] = parameters.jjtGetChild(i).getValue(ctx);
} else {
Object[] varargs =
new Object[inputParameterCount - methodParameterCount + 1];
Class<?> target = paramTypes[i].getComponentType();
for (int j = i; j < inputParameterCount; j++) {
varargs[j-i] = parameters.jjtGetChild(j).getValue(ctx);
varargs[j-i] = coerceToType(ctx, varargs[j-i], target);
}
params[i] = varargs;
}
} else {
params[i] = parameters.jjtGetChild(i).getValue(ctx);
}
params[i] = coerceToType(ctx, params[i], paramTypes[i]);
}
} catch (ELException ele) {
throw new ELException(MessageFactory.get("error.function", this
.getOutputName()), ele);
}
}
try {
result = m.invoke(null, params);
} catch (IllegalAccessException iae) {
throw new ELException(MessageFactory.get("error.function", this
.getOutputName()), iae);
} catch (InvocationTargetException ite) {
Throwable cause = ite.getCause();
if (cause instanceof ThreadDeath) {
throw (ThreadDeath) cause;
}
if (cause instanceof VirtualMachineError) {
throw (VirtualMachineError) cause;
}
throw new ELException(MessageFactory.get("error.function", this
.getOutputName()), cause);
}
return result;
}
public void setLocalName(String localName) {
this.localName = localName;
}
public void setPrefix(String prefix) {
this.prefix = prefix;
}
@Override
public String toString()
{
return ELParserTreeConstants.jjtNodeName[id] + "[" + this.getOutputName() + "]";
}
}

View File

@@ -0,0 +1,47 @@
/*
* 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. AstGreaterThan.java */
package org.apache.el.parser;
import javax.el.ELException;
import org.apache.el.lang.EvaluationContext;
/**
* @author Jacob Hookom [jacob@hookom.net]
*/
public final class AstGreaterThan extends BooleanNode {
public AstGreaterThan(int id) {
super(id);
}
@Override
public Object getValue(EvaluationContext ctx)
throws ELException {
Object obj0 = this.children[0].getValue(ctx);
if (obj0 == null) {
return Boolean.FALSE;
}
Object obj1 = this.children[1].getValue(ctx);
if (obj1 == null) {
return Boolean.FALSE;
}
return (compare(ctx, obj0, obj1) > 0) ? Boolean.TRUE : Boolean.FALSE;
}
}

View File

@@ -0,0 +1,47 @@
/*
* 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. AstGreaterThanEqual.java */
package org.apache.el.parser;
import javax.el.ELException;
import org.apache.el.lang.EvaluationContext;
/**
* @author Jacob Hookom [jacob@hookom.net]
*/
public final class AstGreaterThanEqual extends BooleanNode {
public AstGreaterThanEqual(int id) {
super(id);
}
@Override
public Object getValue(EvaluationContext ctx)
throws ELException {
Object obj0 = this.children[0].getValue(ctx);
Object obj1 = this.children[1].getValue(ctx);
if (obj0 == obj1) {
return Boolean.TRUE;
}
if (obj0 == null || obj1 == null) {
return Boolean.FALSE;
}
return (compare(ctx, obj0, obj1) >= 0) ? Boolean.TRUE : Boolean.FALSE;
}
}

View File

@@ -0,0 +1,238 @@
/*
* 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. AstIdentifier.java */
package org.apache.el.parser;
import javax.el.ELClass;
import javax.el.ELException;
import javax.el.MethodExpression;
import javax.el.MethodInfo;
import javax.el.MethodNotFoundException;
import javax.el.PropertyNotFoundException;
import javax.el.ValueExpression;
import javax.el.ValueReference;
import javax.el.VariableMapper;
import org.apache.el.lang.EvaluationContext;
import org.apache.el.util.MessageFactory;
import org.apache.el.util.Validation;
/**
* @author Jacob Hookom [jacob@hookom.net]
*/
public final class AstIdentifier extends SimpleNode {
public AstIdentifier(int id) {
super(id);
}
@Override
public Class<?> getType(EvaluationContext ctx) throws ELException {
VariableMapper varMapper = ctx.getVariableMapper();
if (varMapper != null) {
ValueExpression expr = varMapper.resolveVariable(this.image);
if (expr != null) {
return expr.getType(ctx.getELContext());
}
}
ctx.setPropertyResolved(false);
Class<?> result = ctx.getELResolver().getType(ctx, null, this.image);
if (!ctx.isPropertyResolved()) {
throw new PropertyNotFoundException(MessageFactory.get(
"error.resolver.unhandled.null", this.image));
}
return result;
}
@Override
public Object getValue(EvaluationContext ctx) throws ELException {
// Lambda parameters
if (ctx.isLambdaArgument(this.image)) {
return ctx.getLambdaArgument(this.image);
}
// Variable mapper
VariableMapper varMapper = ctx.getVariableMapper();
if (varMapper != null) {
ValueExpression expr = varMapper.resolveVariable(this.image);
if (expr != null) {
return expr.getValue(ctx.getELContext());
}
}
// EL Resolvers
ctx.setPropertyResolved(false);
Object result;
/* Putting the Boolean into the ELContext is part of a performance
* optimisation for ScopedAttributeELResolver. When looking up "foo",
* the resolver can't differentiate between ${ foo } and ${ foo.bar }.
* This is important because the expensive class lookup only needs to
* be performed in the later case. This flag tells the resolver if the
* lookup can be skipped.
*/
if (parent instanceof AstValue) {
ctx.putContext(this.getClass(), Boolean.FALSE);
} else {
ctx.putContext(this.getClass(), Boolean.TRUE);
}
try {
result = ctx.getELResolver().getValue(ctx, null, this.image);
} finally {
// Always reset the flag to false so the optimisation is not applied
// inappropriately
ctx.putContext(this.getClass(), Boolean.FALSE);
}
if (ctx.isPropertyResolved()) {
return result;
}
// Import
result = ctx.getImportHandler().resolveClass(this.image);
if (result != null) {
return new ELClass((Class<?>) result);
}
result = ctx.getImportHandler().resolveStatic(this.image);
if (result != null) {
try {
return ((Class<?>) result).getField(this.image).get(null);
} catch (IllegalArgumentException | IllegalAccessException
| NoSuchFieldException | SecurityException e) {
throw new ELException(e);
}
}
throw new PropertyNotFoundException(MessageFactory.get(
"error.resolver.unhandled.null", this.image));
}
@Override
public boolean isReadOnly(EvaluationContext ctx) throws ELException {
VariableMapper varMapper = ctx.getVariableMapper();
if (varMapper != null) {
ValueExpression expr = varMapper.resolveVariable(this.image);
if (expr != null) {
return expr.isReadOnly(ctx.getELContext());
}
}
ctx.setPropertyResolved(false);
boolean result = ctx.getELResolver().isReadOnly(ctx, null, this.image);
if (!ctx.isPropertyResolved()) {
throw new PropertyNotFoundException(MessageFactory.get(
"error.resolver.unhandled.null", this.image));
}
return result;
}
@Override
public void setValue(EvaluationContext ctx, Object value)
throws ELException {
VariableMapper varMapper = ctx.getVariableMapper();
if (varMapper != null) {
ValueExpression expr = varMapper.resolveVariable(this.image);
if (expr != null) {
expr.setValue(ctx.getELContext(), value);
return;
}
}
ctx.setPropertyResolved(false);
ctx.getELResolver().setValue(ctx, null, this.image, value);
if (!ctx.isPropertyResolved()) {
throw new PropertyNotFoundException(MessageFactory.get(
"error.resolver.unhandled.null", this.image));
}
}
@Override
public Object invoke(EvaluationContext ctx, Class<?>[] paramTypes,
Object[] paramValues) throws ELException {
return this.getMethodExpression(ctx).invoke(ctx.getELContext(), paramValues);
}
@Override
public MethodInfo getMethodInfo(EvaluationContext ctx,
Class<?>[] paramTypes) throws ELException {
return this.getMethodExpression(ctx).getMethodInfo(ctx.getELContext());
}
@Override
public void setImage(String image) {
if (!Validation.isIdentifier(image)) {
throw new ELException(MessageFactory.get("error.identifier.notjava",
image));
}
this.image = image;
}
@Override
public ValueReference getValueReference(EvaluationContext ctx) {
VariableMapper varMapper = ctx.getVariableMapper();
if (varMapper == null) {
return null;
}
ValueExpression expr = varMapper.resolveVariable(this.image);
if (expr == null) {
return null;
}
return expr.getValueReference(ctx);
}
private final MethodExpression getMethodExpression(EvaluationContext ctx)
throws ELException {
Object obj = null;
// case A: ValueExpression exists, getValue which must
// be a MethodExpression
VariableMapper varMapper = ctx.getVariableMapper();
ValueExpression ve = null;
if (varMapper != null) {
ve = varMapper.resolveVariable(this.image);
if (ve != null) {
obj = ve.getValue(ctx);
}
}
// case B: evaluate the identity against the ELResolver, again, must be
// a MethodExpression to be able to invoke
if (ve == null) {
ctx.setPropertyResolved(false);
obj = ctx.getELResolver().getValue(ctx, null, this.image);
}
// finally provide helpful hints
if (obj instanceof MethodExpression) {
return (MethodExpression) obj;
} else if (obj == null) {
throw new MethodNotFoundException("Identity '" + this.image
+ "' was null and was unable to invoke");
} else {
throw new ELException(
"Identity '"
+ this.image
+ "' does not reference a MethodExpression instance, returned type: "
+ obj.getClass().getName());
}
}
}

View File

@@ -0,0 +1,60 @@
/*
* 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. AstInteger.java */
package org.apache.el.parser;
import java.math.BigInteger;
import javax.el.ELException;
import org.apache.el.lang.EvaluationContext;
/**
* @author Jacob Hookom [jacob@hookom.net]
*/
public final class AstInteger extends SimpleNode {
public AstInteger(int id) {
super(id);
}
private volatile Number number;
protected Number getInteger() {
if (this.number == null) {
try {
this.number = Long.valueOf(this.image);
} catch (ArithmeticException e1) {
this.number = new BigInteger(this.image);
}
}
return number;
}
@Override
public Class<?> getType(EvaluationContext ctx)
throws ELException {
return this.getInteger().getClass();
}
@Override
public Object getValue(EvaluationContext ctx)
throws ELException {
return this.getInteger();
}
}

View File

@@ -0,0 +1,182 @@
/*
* 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. AstLambdaExpression.java Version 4.3 */
package org.apache.el.parser;
import java.util.ArrayList;
import java.util.List;
import javax.el.ELException;
import javax.el.LambdaExpression;
import org.apache.el.ValueExpressionImpl;
import org.apache.el.lang.EvaluationContext;
import org.apache.el.util.MessageFactory;
public class AstLambdaExpression extends SimpleNode {
private NestedState nestedState = null;
public AstLambdaExpression(int id) {
super(id);
}
@Override
public Object getValue(EvaluationContext ctx) throws ELException {
// Correct evaluation requires knowledge of the whole set of nested
// expressions, not just the current expression
NestedState state = getNestedState();
// Check that there are not more sets of parameters than there are
// nested expressions.
int methodParameterSetCount = jjtGetNumChildren() - 2;
if (methodParameterSetCount > state.getNestingCount()) {
throw new ELException(MessageFactory.get(
"error.lambda.tooManyMethodParameterSets"));
}
// First child is always parameters even if there aren't any
AstLambdaParameters formalParametersNode =
(AstLambdaParameters) children[0];
Node[] formalParamNodes = formalParametersNode.children;
// Second child is a value expression
ValueExpressionImpl ve = new ValueExpressionImpl("", children[1],
ctx.getFunctionMapper(), ctx.getVariableMapper(), null);
// Build a LambdaExpression
List<String> formalParameters = new ArrayList<>();
if (formalParamNodes != null) {
for (Node formalParamNode : formalParamNodes) {
formalParameters.add(formalParamNode.getImage());
}
}
LambdaExpression le = new LambdaExpression(formalParameters, ve);
le.setELContext(ctx);
if (jjtGetNumChildren() == 2) {
// No method parameters
// Can only invoke the expression if none of the lambda expressions
// in the nesting declare parameters
if (state.getHasFormalParameters()) {
return le;
} else {
return le.invoke(ctx, (Object[]) null);
}
}
/*
* This is a (possibly nested) lambda expression with one or more sets
* of parameters provided.
*
* If there are more nested expressions than sets of parameters this may
* return a LambdaExpression.
*
* If there are more sets of parameters than nested expressions an
* ELException will have been thrown by the check at the start of this
* method.
*/
// Always have to invoke the outer-most expression
int methodParameterIndex = 2;
Object result = le.invoke(((AstMethodParameters)
children[methodParameterIndex]).getParameters(ctx));
methodParameterIndex++;
while (result instanceof LambdaExpression &&
methodParameterIndex < jjtGetNumChildren()) {
result = ((LambdaExpression) result).invoke(((AstMethodParameters)
children[methodParameterIndex]).getParameters(ctx));
methodParameterIndex++;
}
return result;
}
private NestedState getNestedState() {
if (nestedState == null) {
setNestedState(new NestedState());
}
return nestedState;
}
private void setNestedState(NestedState nestedState) {
if (this.nestedState != null) {
// Should never happen
throw new IllegalStateException("nestedState may only be set once");
}
this.nestedState = nestedState;
// Increment the nesting count for the current expression
nestedState.incrementNestingCount();
if (jjtGetNumChildren() > 1) {
Node firstChild = jjtGetChild(0);
if (firstChild instanceof AstLambdaParameters) {
if (firstChild.jjtGetNumChildren() > 0) {
nestedState.setHasFormalParameters();
}
} else {
// Can't be a lambda expression
return;
}
Node secondChild = jjtGetChild(1);
if (secondChild instanceof AstLambdaExpression) {
((AstLambdaExpression) secondChild).setNestedState(nestedState);
}
}
}
@Override
public String toString() {
// Purely for debug purposes. May not be complete or correct. Certainly
// is not efficient. Be sure not to call this from 'real' code.
StringBuilder result = new StringBuilder();
for (Node n : children) {
result.append(n.toString());
}
return result.toString();
}
private static class NestedState {
private int nestingCount = 0;
private boolean hasFormalParameters = false;
private void incrementNestingCount() {
nestingCount++;
}
private int getNestingCount() {
return nestingCount;
}
private void setHasFormalParameters() {
hasFormalParameters = true;
}
private boolean getHasFormalParameters() {
return hasFormalParameters;
}
}
}
/* JavaCC - OriginalChecksum=071159eff10c8e15ec612c765ae4480a (do not edit this line) */

View File

@@ -0,0 +1,43 @@
/*
* 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. AstLambdaParameters.java Version 4.3 */
package org.apache.el.parser;
public class AstLambdaParameters extends SimpleNode {
public AstLambdaParameters(int id) {
super(id);
}
@Override
public String toString() {
// Purely for debug purposes. May not be complete or correct. Certainly
// is not efficient. Be sure not to call this from 'real' code.
StringBuilder result = new StringBuilder();
result.append('(');
if (children != null) {
for (Node n : children) {
result.append(n.toString());
result.append(',');
}
}
result.append(")->");
return result.toString();
}
}
/* JavaCC - OriginalChecksum=a8c1609257dac59e41c43d6ed91072c6 (do not edit this line) */

View File

@@ -0,0 +1,47 @@
/*
* 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. AstLessThan.java */
package org.apache.el.parser;
import javax.el.ELException;
import org.apache.el.lang.EvaluationContext;
/**
* @author Jacob Hookom [jacob@hookom.net]
*/
public final class AstLessThan extends BooleanNode {
public AstLessThan(int id) {
super(id);
}
@Override
public Object getValue(EvaluationContext ctx)
throws ELException {
Object obj0 = this.children[0].getValue(ctx);
if (obj0 == null) {
return Boolean.FALSE;
}
Object obj1 = this.children[1].getValue(ctx);
if (obj1 == null) {
return Boolean.FALSE;
}
return (compare(ctx, obj0, obj1) < 0) ? Boolean.TRUE : Boolean.FALSE;
}
}

View File

@@ -0,0 +1,47 @@
/*
* 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. AstLessThanEqual.java */
package org.apache.el.parser;
import javax.el.ELException;
import org.apache.el.lang.EvaluationContext;
/**
* @author Jacob Hookom [jacob@hookom.net]
*/
public final class AstLessThanEqual extends BooleanNode {
public AstLessThanEqual(int id) {
super(id);
}
@Override
public Object getValue(EvaluationContext ctx)
throws ELException {
Object obj0 = this.children[0].getValue(ctx);
Object obj1 = this.children[1].getValue(ctx);
if (obj0 == obj1) {
return Boolean.TRUE;
}
if (obj0 == null || obj1 == null) {
return Boolean.FALSE;
}
return (compare(ctx, obj0, obj1) <= 0) ? Boolean.TRUE : Boolean.FALSE;
}
}

View File

@@ -0,0 +1,50 @@
/*
* 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. AstListData.java Version 4.3 */
package org.apache.el.parser;
import java.util.ArrayList;
import java.util.List;
import javax.el.ELException;
import org.apache.el.lang.EvaluationContext;
public class AstListData extends SimpleNode {
public AstListData(int id) {
super(id);
}
@Override
public Object getValue(EvaluationContext ctx) throws ELException {
List<Object> result = new ArrayList<>();
if (children != null) {
for (Node child : children) {
result.add(child.getValue(ctx));
}
}
return result;
}
@Override
public Class<?> getType(EvaluationContext ctx) throws ELException {
return List.class;
}
}
/* JavaCC - OriginalChecksum=7f2694086a9ba64558ee39d1cd719db1 (do not edit this line) */

View File

@@ -0,0 +1,66 @@
/*
* 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. AstLiteralExpression.java */
package org.apache.el.parser;
import javax.el.ELException;
import org.apache.el.lang.EvaluationContext;
/**
* @author Jacob Hookom [jacob@hookom.net]
*/
public final class AstLiteralExpression extends SimpleNode {
public AstLiteralExpression(int id) {
super(id);
}
@Override
public Class<?> getType(EvaluationContext ctx) throws ELException {
return String.class;
}
@Override
public Object getValue(EvaluationContext ctx) throws ELException {
return this.image;
}
@Override
public void setImage(String image) {
if (image.indexOf('\\') == -1) {
this.image = image;
return;
}
int size = image.length();
StringBuilder buf = new StringBuilder(size);
for (int i = 0; i < size; i++) {
char c = image.charAt(i);
if (c == '\\' && i + 2 < size) {
char c1 = image.charAt(i + 1);
char c2 = image.charAt(i + 2);
if ((c1 == '#' || c1 == '$') && c2 == '{') {
c = c1;
i++;
}
}
buf.append(c);
}
this.image = buf.toString();
}
}

View File

@@ -0,0 +1,56 @@
/*
* 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. AstMapData.java Version 4.3 */
package org.apache.el.parser;
import java.util.HashMap;
import java.util.Map;
import javax.el.ELException;
import org.apache.el.lang.EvaluationContext;
public class AstMapData extends SimpleNode {
public AstMapData(int id) {
super(id);
}
@Override
public Object getValue(EvaluationContext ctx) throws ELException {
Map<Object,Object> result = new HashMap<>();
if (children != null) {
for (Node child : children) {
AstMapEntry mapEntry = (AstMapEntry) child;
Object key = mapEntry.children[0].getValue(ctx);
Object value = mapEntry.children[1].getValue(ctx);
result.put(key, value);
}
}
return result;
}
@Override
public Class<?> getType(EvaluationContext ctx) throws ELException {
return Map.class;
}
}
/* JavaCC - OriginalChecksum=a68b5c6f0a0708f478fdf8c0e6e1263e (do not edit this line) */

View File

@@ -0,0 +1,26 @@
/*
* 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. AstMapEntry.java Version 4.3 */
package org.apache.el.parser;
public
class AstMapEntry extends SimpleNode {
public AstMapEntry(int id) {
super(id);
}
}
/* JavaCC - OriginalChecksum=6a7910e58a583371769800554113a8d3 (do not edit this line) */

View File

@@ -0,0 +1,53 @@
/*
* 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. AstDotSuffix.java */
package org.apache.el.parser;
import java.util.ArrayList;
import org.apache.el.lang.EvaluationContext;
public final class AstMethodParameters extends SimpleNode {
public AstMethodParameters(int id) {
super(id);
}
public Object[] getParameters(EvaluationContext ctx) {
ArrayList<Object> params = new ArrayList<>();
for (int i = 0; i < this.jjtGetNumChildren(); i++) {
params.add(this.jjtGetChild(i).getValue(ctx));
}
return params.toArray(new Object[params.size()]);
}
@Override
public String toString() {
// Purely for debug purposes. May not be complete or correct. Certainly
// is not efficient. Be sure not to call this from 'real' code.
StringBuilder result = new StringBuilder();
result.append('(');
if (children != null) {
for (Node n : children) {
result.append(n.toString());
result.append(',');
}
}
result.append(')');
return result.toString();
}
}

View File

@@ -0,0 +1,42 @@
/*
* 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. AstMinus.java */
package org.apache.el.parser;
import javax.el.ELException;
import org.apache.el.lang.ELArithmetic;
import org.apache.el.lang.EvaluationContext;
/**
* @author Jacob Hookom [jacob@hookom.net]
*/
public final class AstMinus extends ArithmeticNode {
public AstMinus(int id) {
super(id);
}
@Override
public Object getValue(EvaluationContext ctx)
throws ELException {
Object obj0 = this.children[0].getValue(ctx);
Object obj1 = this.children[1].getValue(ctx);
return ELArithmetic.subtract(obj0, obj1);
}
}

View File

@@ -0,0 +1,42 @@
/*
* 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. AstMod.java */
package org.apache.el.parser;
import javax.el.ELException;
import org.apache.el.lang.ELArithmetic;
import org.apache.el.lang.EvaluationContext;
/**
* @author Jacob Hookom [jacob@hookom.net]
*/
public final class AstMod extends ArithmeticNode {
public AstMod(int id) {
super(id);
}
@Override
public Object getValue(EvaluationContext ctx)
throws ELException {
Object obj0 = this.children[0].getValue(ctx);
Object obj1 = this.children[1].getValue(ctx);
return ELArithmetic.mod(obj0, obj1);
}
}

View File

@@ -0,0 +1,42 @@
/*
* 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. AstMult.java */
package org.apache.el.parser;
import javax.el.ELException;
import org.apache.el.lang.ELArithmetic;
import org.apache.el.lang.EvaluationContext;
/**
* @author Jacob Hookom [jacob@hookom.net]
*/
public final class AstMult extends ArithmeticNode {
public AstMult(int id) {
super(id);
}
@Override
public Object getValue(EvaluationContext ctx)
throws ELException {
Object obj0 = this.children[0].getValue(ctx);
Object obj1 = this.children[1].getValue(ctx);
return ELArithmetic.multiply(obj0, obj1);
}
}

View File

@@ -0,0 +1,84 @@
/*
* 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. AstNegative.java */
package org.apache.el.parser;
import java.math.BigDecimal;
import java.math.BigInteger;
import javax.el.ELException;
import org.apache.el.lang.EvaluationContext;
/**
* @author Jacob Hookom [jacob@hookom.net]
*/
public final class AstNegative extends SimpleNode {
public AstNegative(int id) {
super(id);
}
@Override
public Class<?> getType(EvaluationContext ctx)
throws ELException {
return Number.class;
}
@Override
public Object getValue(EvaluationContext ctx)
throws ELException {
Object obj = this.children[0].getValue(ctx);
if (obj == null) {
return Long.valueOf(0);
}
if (obj instanceof BigDecimal) {
return ((BigDecimal) obj).negate();
}
if (obj instanceof BigInteger) {
return ((BigInteger) obj).negate();
}
if (obj instanceof String) {
if (isStringFloat((String) obj)) {
return Double.valueOf(-Double.parseDouble((String) obj));
}
return Long.valueOf(-Long.parseLong((String) obj));
}
if (obj instanceof Long) {
return Long.valueOf(-((Long) obj).longValue());
}
if (obj instanceof Double) {
return Double.valueOf(-((Double) obj).doubleValue());
}
if (obj instanceof Integer) {
return Integer.valueOf(-((Integer) obj).intValue());
}
if (obj instanceof Float) {
return Float.valueOf(-((Float) obj).floatValue());
}
if (obj instanceof Short) {
return Short.valueOf((short) -((Short) obj).shortValue());
}
if (obj instanceof Byte) {
return Byte.valueOf((byte) -((Byte) obj).byteValue());
}
Long num = (Long) coerceToNumber(ctx, obj, Long.class);
return Long.valueOf(-num.longValue());
}
}

View File

@@ -0,0 +1,47 @@
/*
* 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. AstNot.java */
package org.apache.el.parser;
import javax.el.ELException;
import org.apache.el.lang.EvaluationContext;
/**
* @author Jacob Hookom [jacob@hookom.net]
*/
public final class AstNot extends SimpleNode {
public AstNot(int id) {
super(id);
}
@Override
public Class<?> getType(EvaluationContext ctx)
throws ELException {
return Boolean.class;
}
@Override
public Object getValue(EvaluationContext ctx)
throws ELException {
Object obj = this.children[0].getValue(ctx);
Boolean b = coerceToBoolean(ctx, obj, true);
return Boolean.valueOf(!b.booleanValue());
}
}

View File

@@ -0,0 +1,41 @@
/*
* 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. AstNotEqual.java */
package org.apache.el.parser;
import javax.el.ELException;
import org.apache.el.lang.EvaluationContext;
/**
* @author Jacob Hookom [jacob@hookom.net]
*/
public final class AstNotEqual extends BooleanNode {
public AstNotEqual(int id) {
super(id);
}
@Override
public Object getValue(EvaluationContext ctx)
throws ELException {
Object obj0 = this.children[0].getValue(ctx);
Object obj1 = this.children[1].getValue(ctx);
return Boolean.valueOf(!equals(ctx, obj0, obj1));
}
}

View File

@@ -0,0 +1,45 @@
/*
* 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. AstNull.java */
package org.apache.el.parser;
import javax.el.ELException;
import org.apache.el.lang.EvaluationContext;
/**
* @author Jacob Hookom [jacob@hookom.net]
*/
public final class AstNull extends SimpleNode {
public AstNull(int id) {
super(id);
}
@Override
public Class<?> getType(EvaluationContext ctx)
throws ELException {
return null;
}
@Override
public Object getValue(EvaluationContext ctx)
throws ELException {
return null;
}
}

View File

@@ -0,0 +1,46 @@
/*
* 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. AstOr.java */
package org.apache.el.parser;
import javax.el.ELException;
import org.apache.el.lang.EvaluationContext;
/**
* @author Jacob Hookom [jacob@hookom.net]
*/
public final class AstOr extends BooleanNode {
public AstOr(int id) {
super(id);
}
@Override
public Object getValue(EvaluationContext ctx)
throws ELException {
Object obj = this.children[0].getValue(ctx);
Boolean b = coerceToBoolean(ctx, obj, true);
if (b.booleanValue()) {
return b;
}
obj = this.children[1].getValue(ctx);
b = coerceToBoolean(ctx, obj, true);
return b;
}
}

View File

@@ -0,0 +1,42 @@
/*
* 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. AstPlus.java */
package org.apache.el.parser;
import javax.el.ELException;
import org.apache.el.lang.ELArithmetic;
import org.apache.el.lang.EvaluationContext;
/**
* @author Jacob Hookom [jacob@hookom.net]
*/
public final class AstPlus extends ArithmeticNode {
public AstPlus(int id) {
super(id);
}
@Override
public Object getValue(EvaluationContext ctx)
throws ELException {
Object obj0 = this.children[0].getValue(ctx);
Object obj1 = this.children[1].getValue(ctx);
return ELArithmetic.add(obj0, obj1);
}
}

View File

@@ -0,0 +1,49 @@
/*
* 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. AstSemicolon.java Version 4.3 */
package org.apache.el.parser;
import javax.el.ELException;
import org.apache.el.lang.EvaluationContext;
public class AstSemicolon extends SimpleNode {
public AstSemicolon(int id) {
super(id);
}
@Override
public Object getValue(EvaluationContext ctx) throws ELException {
// Evaluate and throw away
children[0].getValue(ctx);
return children[1].getValue(ctx);
}
@Override
public Class<?> getType(EvaluationContext ctx) throws ELException {
// Evaluate and throw away
children[0].getType(ctx);
return children[1].getType(ctx);
}
}
/* JavaCC - OriginalChecksum=ce956594ca572a4e452fe4f084a03099 (do not edit this line) */

View File

@@ -0,0 +1,51 @@
/*
* 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. AstSetData.java Version 4.3 */
package org.apache.el.parser;
import java.util.HashSet;
import java.util.Set;
import javax.el.ELException;
import org.apache.el.lang.EvaluationContext;
public class AstSetData extends SimpleNode {
public AstSetData(int id) {
super(id);
}
@Override
public Object getValue(EvaluationContext ctx) throws ELException {
Set<Object> result = new HashSet<>();
if (children != null) {
for (Node child : children) {
result.add(child.getValue(ctx));
}
}
return result;
}
@Override
public Class<?> getType(EvaluationContext ctx) throws ELException {
return Set.class;
}
}
/* JavaCC - OriginalChecksum=e1dc4e2011eee313491decfa9e0152fe (do not edit this line) */

View File

@@ -0,0 +1,76 @@
/*
* 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. AstString.java */
package org.apache.el.parser;
import javax.el.ELException;
import org.apache.el.lang.EvaluationContext;
/**
* @author Jacob Hookom [jacob@hookom.net]
*/
public final class AstString extends SimpleNode {
public AstString(int id) {
super(id);
}
private volatile String string;
public String getString() {
if (this.string == null) {
this.string = this.image.substring(1, this.image.length() - 1);
}
return this.string;
}
@Override
public Class<?> getType(EvaluationContext ctx)
throws ELException {
return String.class;
}
@Override
public Object getValue(EvaluationContext ctx)
throws ELException {
return this.getString();
}
@Override
public void setImage(String image) {
if (image.indexOf('\\') == -1) {
this.image = image;
return;
}
int size = image.length();
StringBuilder buf = new StringBuilder(size);
for (int i = 0; i < size; i++) {
char c = image.charAt(i);
if (c == '\\' && i + 1 < size) {
char c1 = image.charAt(i + 1);
if (c1 == '\\' || c1 == '"' || c1 == '\'') {
c = c1;
i++;
}
}
buf.append(c);
}
this.image = buf.toString();
}
}

View File

@@ -0,0 +1,39 @@
/*
* 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. AstTrue.java */
package org.apache.el.parser;
import javax.el.ELException;
import org.apache.el.lang.EvaluationContext;
/**
* @author Jacob Hookom [jacob@hookom.net]
*/
public final class AstTrue extends BooleanNode {
public AstTrue(int id) {
super(id);
}
@Override
public Object getValue(EvaluationContext ctx)
throws ELException {
return Boolean.TRUE;
}
}

View File

@@ -0,0 +1,369 @@
/*
* 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. AstValue.java */
package org.apache.el.parser;
import java.lang.reflect.Array;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import javax.el.ELException;
import javax.el.ELResolver;
import javax.el.LambdaExpression;
import javax.el.MethodInfo;
import javax.el.PropertyNotFoundException;
import javax.el.ValueReference;
import org.apache.el.lang.ELSupport;
import org.apache.el.lang.EvaluationContext;
import org.apache.el.stream.Optional;
import org.apache.el.util.MessageFactory;
import org.apache.el.util.ReflectionUtil;
/**
* @author Jacob Hookom [jacob@hookom.net]
*/
public final class AstValue extends SimpleNode {
private static final Object[] EMPTY_ARRAY = new Object[0];
protected static class Target {
protected Object base;
protected Object property;
}
public AstValue(int id) {
super(id);
}
@Override
public Class<?> getType(EvaluationContext ctx) throws ELException {
Target t = getTarget(ctx);
ctx.setPropertyResolved(false);
Class<?> result = ctx.getELResolver().getType(ctx, t.base, t.property);
if (!ctx.isPropertyResolved()) {
throw new PropertyNotFoundException(MessageFactory.get(
"error.resolver.unhandled", t.base, t.property));
}
return result;
}
private final Target getTarget(EvaluationContext ctx) throws ELException {
// evaluate expr-a to value-a
Object base = this.children[0].getValue(ctx);
// if our base is null (we know there are more properties to evaluate)
if (base == null) {
throw new PropertyNotFoundException(MessageFactory.get(
"error.unreachable.base", this.children[0].getImage()));
}
// set up our start/end
Object property = null;
int propCount = this.jjtGetNumChildren();
int i = 1;
// Evaluate any properties or methods before our target
ELResolver resolver = ctx.getELResolver();
while (i < propCount) {
if (i + 2 < propCount &&
this.children[i + 1] instanceof AstMethodParameters) {
// Method call not at end of expression
base = resolver.invoke(ctx, base,
this.children[i].getValue(ctx), null,
((AstMethodParameters)
this.children[i + 1]).getParameters(ctx));
i += 2;
} else if (i + 2 == propCount &&
this.children[i + 1] instanceof AstMethodParameters) {
// Method call at end of expression
ctx.setPropertyResolved(false);
property = this.children[i].getValue(ctx);
i += 2;
if (property == null) {
throw new PropertyNotFoundException(MessageFactory.get(
"error.unreachable.property", property));
}
} else if (i + 1 < propCount) {
// Object with property not at end of expression
property = this.children[i].getValue(ctx);
ctx.setPropertyResolved(false);
base = resolver.getValue(ctx, base, property);
i++;
} else {
// Object with property at end of expression
ctx.setPropertyResolved(false);
property = this.children[i].getValue(ctx);
i++;
if (property == null) {
throw new PropertyNotFoundException(MessageFactory.get(
"error.unreachable.property", property));
}
}
if (base == null) {
throw new PropertyNotFoundException(MessageFactory.get(
"error.unreachable.property", property));
}
}
Target t = new Target();
t.base = base;
t.property = property;
return t;
}
@Override
public Object getValue(EvaluationContext ctx) throws ELException {
Object base = this.children[0].getValue(ctx);
int propCount = this.jjtGetNumChildren();
int i = 1;
Object suffix = null;
ELResolver resolver = ctx.getELResolver();
while (base != null && i < propCount) {
suffix = this.children[i].getValue(ctx);
if (i + 1 < propCount &&
(this.children[i+1] instanceof AstMethodParameters)) {
AstMethodParameters mps =
(AstMethodParameters) this.children[i+1];
if (base instanceof Optional && "orElseGet".equals(suffix) &&
mps.jjtGetNumChildren() == 1) {
Node paramFoOptional = mps.jjtGetChild(0);
if (!(paramFoOptional instanceof AstLambdaExpression ||
paramFoOptional instanceof LambdaExpression)) {
throw new ELException(MessageFactory.get(
"stream.optional.paramNotLambda", suffix));
}
}
// This is a method
Object[] paramValues = mps.getParameters(ctx);
base = resolver.invoke(ctx, base, suffix,
getTypesFromValues(paramValues), paramValues);
i+=2;
} else {
// This is a property
if (suffix == null) {
return null;
}
ctx.setPropertyResolved(false);
base = resolver.getValue(ctx, base, suffix);
i++;
}
}
if (!ctx.isPropertyResolved()) {
throw new PropertyNotFoundException(MessageFactory.get(
"error.resolver.unhandled", base, suffix));
}
return base;
}
@Override
public boolean isReadOnly(EvaluationContext ctx) throws ELException {
Target t = getTarget(ctx);
ctx.setPropertyResolved(false);
boolean result =
ctx.getELResolver().isReadOnly(ctx, t.base, t.property);
if (!ctx.isPropertyResolved()) {
throw new PropertyNotFoundException(MessageFactory.get(
"error.resolver.unhandled", t.base, t.property));
}
return result;
}
@Override
public void setValue(EvaluationContext ctx, Object value)
throws ELException {
Target t = getTarget(ctx);
ctx.setPropertyResolved(false);
ELResolver resolver = ctx.getELResolver();
// coerce to the expected type
Class<?> targetClass = resolver.getType(ctx, t.base, t.property);
resolver.setValue(ctx, t.base, t.property,
ELSupport.coerceToType(ctx, value, targetClass));
if (!ctx.isPropertyResolved()) {
throw new PropertyNotFoundException(MessageFactory.get(
"error.resolver.unhandled", t.base, t.property));
}
}
@Override
// Interface el.parser.Node uses raw types (and is auto-generated)
public MethodInfo getMethodInfo(EvaluationContext ctx,
@SuppressWarnings("rawtypes") Class[] paramTypes)
throws ELException {
Target t = getTarget(ctx);
Method m = ReflectionUtil.getMethod(
ctx, t.base, t.property, paramTypes, null);
return new MethodInfo(m.getName(), m.getReturnType(), m
.getParameterTypes());
}
@Override
// Interface el.parser.Node uses a raw type (and is auto-generated)
public Object invoke(EvaluationContext ctx,
@SuppressWarnings("rawtypes") Class[] paramTypes,
Object[] paramValues) throws ELException {
Target t = getTarget(ctx);
Method m = null;
Object[] values = null;
Class<?>[] types = null;
if (isParametersProvided()) {
values = ((AstMethodParameters) this.jjtGetChild(
this.jjtGetNumChildren() - 1)).getParameters(ctx);
types = getTypesFromValues(values);
} else {
values = paramValues;
types = paramTypes;
}
m = ReflectionUtil.getMethod(ctx, t.base, t.property, types, values);
// Handle varArgs and any coercion required
values = convertArgs(ctx, values, m);
Object result = null;
try {
result = m.invoke(t.base, values);
} catch (IllegalAccessException iae) {
throw new ELException(iae);
} catch (IllegalArgumentException iae) {
throw new ELException(iae);
} catch (InvocationTargetException ite) {
Throwable cause = ite.getCause();
if (cause instanceof ThreadDeath) {
throw (ThreadDeath) cause;
}
if (cause instanceof VirtualMachineError) {
throw (VirtualMachineError) cause;
}
throw new ELException(cause);
}
return result;
}
private Object[] convertArgs(EvaluationContext ctx, Object[] src, Method m) {
Class<?>[] types = m.getParameterTypes();
if (types.length == 0) {
// Treated as if parameters have been provided so src is ignored
return EMPTY_ARRAY;
}
int paramCount = types.length;
if (m.isVarArgs() && paramCount > 1 && (src == null || paramCount > src.length) ||
!m.isVarArgs() && (paramCount > 0 && src == null ||
src != null && src.length != paramCount)) {
String srcCount = null;
if (src != null) {
srcCount = Integer.toString(src.length);
}
String msg;
if (m.isVarArgs()) {
msg = MessageFactory.get("error.invoke.tooFewParams",
m.getName(), srcCount, Integer.toString(paramCount));
} else {
msg = MessageFactory.get("error.invoke.wrongParams",
m.getName(), srcCount, Integer.toString(paramCount));
}
throw new IllegalArgumentException(msg);
}
if (src == null) {
// Must be a varargs method with a single parameter.
// Use a new array every time since the called code could modify the
// contents of the array
return new Object[1];
}
Object[] dest = new Object[paramCount];
for (int i = 0; i < paramCount - 1; i++) {
dest[i] = ELSupport.coerceToType(ctx, src[i], types[i]);
}
if (m.isVarArgs()) {
Class<?> varArgType = m.getParameterTypes()[paramCount - 1].getComponentType();
Object[] varArgs =
(Object[]) Array.newInstance(varArgType, src.length - (paramCount - 1));
for (int i = 0; i < src.length - (paramCount - 1); i ++) {
varArgs[i] = ELSupport.coerceToType(ctx, src[paramCount - 1 + i], varArgType);
}
dest[paramCount - 1] = varArgs;
} else {
dest[paramCount - 1] = ELSupport.coerceToType(
ctx, src[paramCount - 1], types[paramCount - 1]);
}
return dest;
}
private Class<?>[] getTypesFromValues(Object[] values) {
if (values == null) {
return null;
}
Class<?> result[] = new Class<?>[values.length];
for (int i = 0; i < values.length; i++) {
if (values[i] == null) {
result[i] = null;
} else {
result[i] = values[i].getClass();
}
}
return result;
}
/**
* @since EL 2.2
*/
@Override
public ValueReference getValueReference(EvaluationContext ctx) {
// Check this is a reference to a base and a property
if (this.children.length > 2 &&
this.jjtGetChild(2) instanceof AstMethodParameters) {
// This is a method call
return null;
}
Target t = getTarget(ctx);
return new ValueReference(t.base, t.property);
}
/**
* @since EL 2.2
*/
@Override
public boolean isParametersProvided() {
// Assumption is that method parameters, if present, will be the last
// child
int len = children.length;
if (len > 2) {
if (this.jjtGetChild(len - 1) instanceof AstMethodParameters) {
return true;
}
}
return false;
}
}

View File

@@ -0,0 +1,37 @@
/*
* 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.parser;
import javax.el.ELException;
import org.apache.el.lang.EvaluationContext;
/**
* @author Jacob Hookom [jacob@hookom.net]
*/
public abstract class BooleanNode extends SimpleNode {
public BooleanNode(int i) {
super(i);
}
@Override
public Class<?> getType(EvaluationContext ctx)
throws ELException {
return Boolean.class;
}
}

View File

@@ -0,0 +1,223 @@
<!--
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.
-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE>BNF for ELParser.jj</TITLE>
</HEAD>
<BODY>
<H1 ALIGN=CENTER>BNF for ELParser.jj</H1>
<H2 ALIGN=CENTER>NON-TERMINALS</H2>
<TABLE>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod1">CompositeExpression</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>( <A HREF="#prod2">DeferredExpression</A> | <A HREF="#prod3">DynamicExpression</A> | <A HREF="#prod4">LiteralExpression</A> )* &lt;EOF&gt;</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod4">LiteralExpression</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>&lt;LITERAL_EXPRESSION&gt;</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod2">DeferredExpression</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>&lt;START_DEFERRED_EXPRESSION&gt; <A HREF="#prod5">Expression</A> &lt;END_EXPRESSION&gt;</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod3">DynamicExpression</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>&lt;START_DYNAMIC_EXPRESSION&gt; <A HREF="#prod5">Expression</A> &lt;END_EXPRESSION&gt;</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod5">Expression</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod6">Choice</A></TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod6">Choice</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod7">Or</A> ( &lt;QUESTIONMARK&gt; <A HREF="#prod6">Choice</A> &lt;COLON&gt; <A HREF="#prod6">Choice</A> )*</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod7">Or</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod8">And</A> ( ( &lt;OR0&gt; | &lt;OR1&gt; ) <A HREF="#prod8">And</A> )*</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod8">And</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod9">Equality</A> ( ( &lt;AND0&gt; | &lt;AND1&gt; ) <A HREF="#prod9">Equality</A> )*</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod9">Equality</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod10">Compare</A> ( ( ( &lt;EQ0&gt; | &lt;EQ1&gt; ) <A HREF="#prod10">Compare</A> ) | ( ( &lt;NE0&gt; | &lt;NE1&gt; ) <A HREF="#prod10">Compare</A> ) )*</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod10">Compare</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod11">Math</A> ( ( ( &lt;LT0&gt; | &lt;LT1&gt; ) <A HREF="#prod11">Math</A> ) | ( ( &lt;GT0&gt; | &lt;GT1&gt; ) <A HREF="#prod11">Math</A> ) | ( ( &lt;LE0&gt; | &lt;LE1&gt; ) <A HREF="#prod11">Math</A> ) | ( ( &lt;GE0&gt; | &lt;GE1&gt; ) <A HREF="#prod11">Math</A> ) )*</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod11">Math</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod12">Multiplication</A> ( ( &lt;PLUS&gt; <A HREF="#prod12">Multiplication</A> ) | ( &lt;MINUS&gt; <A HREF="#prod12">Multiplication</A> ) )*</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod12">Multiplication</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod13">Unary</A> ( ( &lt;MULT&gt; <A HREF="#prod13">Unary</A> ) | ( &lt;DIV&gt; <A HREF="#prod13">Unary</A> ) | ( ( &lt;MOD0&gt; | &lt;MOD1&gt; ) <A HREF="#prod13">Unary</A> ) )*</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod13">Unary</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>&lt;MINUS&gt; <A HREF="#prod13">Unary</A></TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>|</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>( &lt;NOT0&gt; | &lt;NOT1&gt; ) <A HREF="#prod13">Unary</A></TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>|</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>&lt;EMPTY&gt; <A HREF="#prod13">Unary</A></TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>|</TD>
<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod14">Value</A></TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod14">Value</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>( <A HREF="#prod15">ValuePrefix</A> ( <A HREF="#prod16">ValueSuffix</A> )* )</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod15">ValuePrefix</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod17">Literal</A></TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>|</TD>
<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod18">NonLiteral</A></TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod16">ValueSuffix</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod19">DotSuffix</A></TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>|</TD>
<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod20">BracketSuffix</A></TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod19">DotSuffix</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>&lt;DOT&gt; &lt;IDENTIFIER&gt;</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod20">BracketSuffix</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>&lt;LBRACK&gt; <A HREF="#prod5">Expression</A> &lt;RBRACK&gt;</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod18">NonLiteral</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>&lt;LPAREN&gt; <A HREF="#prod5">Expression</A> &lt;RPAREN&gt;</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>|</TD>
<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod21">Function</A></TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>|</TD>
<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod22">Identifier</A></TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod22">Identifier</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>&lt;IDENTIFIER&gt;</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod21">Function</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>&lt;IDENTIFIER&gt; ( &lt;FUNCTIONSUFFIX&gt; )? &lt;LPAREN&gt; ( <A HREF="#prod5">Expression</A> ( &lt;COMMA&gt; <A HREF="#prod5">Expression</A> )* )? &lt;RPAREN&gt;</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod17">Literal</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod23">Boolean</A></TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>|</TD>
<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod24">FloatingPoint</A></TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>|</TD>
<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod25">Integer</A></TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>|</TD>
<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod26">String</A></TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>|</TD>
<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod27">Null</A></TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod23">Boolean</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>&lt;TRUE&gt;</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>|</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>&lt;FALSE&gt;</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod24">FloatingPoint</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>&lt;FLOATING_POINT_LITERAL&gt;</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod25">Integer</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>&lt;INTEGER_LITERAL&gt;</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod26">String</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>&lt;STRING_LITERAL&gt;</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod27">Null</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>&lt;NULL&gt;</TD>
</TR>
</TABLE>
</BODY>
</HTML>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,201 @@
/* Generated By:JJTree&JavaCC: Do not edit this line. ELParserConstants.java */
package org.apache.el.parser;
/**
* Token literal values and constants.
* Generated by org.javacc.parser.OtherFilesGen#start()
*/
public interface ELParserConstants {
/** End of File. */
int EOF = 0;
/** RegularExpression Id. */
int LITERAL_EXPRESSION = 1;
/** RegularExpression Id. */
int START_DYNAMIC_EXPRESSION = 2;
/** RegularExpression Id. */
int START_DEFERRED_EXPRESSION = 3;
/** RegularExpression Id. */
int START_SET_OR_MAP = 8;
/** RegularExpression Id. */
int RBRACE = 9;
/** RegularExpression Id. */
int INTEGER_LITERAL = 10;
/** RegularExpression Id. */
int FLOATING_POINT_LITERAL = 11;
/** RegularExpression Id. */
int EXPONENT = 12;
/** RegularExpression Id. */
int STRING_LITERAL = 13;
/** RegularExpression Id. */
int TRUE = 14;
/** RegularExpression Id. */
int FALSE = 15;
/** RegularExpression Id. */
int NULL = 16;
/** RegularExpression Id. */
int DOT = 17;
/** RegularExpression Id. */
int LPAREN = 18;
/** RegularExpression Id. */
int RPAREN = 19;
/** RegularExpression Id. */
int LBRACK = 20;
/** RegularExpression Id. */
int RBRACK = 21;
/** RegularExpression Id. */
int COLON = 22;
/** RegularExpression Id. */
int SEMICOLON = 23;
/** RegularExpression Id. */
int COMMA = 24;
/** RegularExpression Id. */
int GT0 = 25;
/** RegularExpression Id. */
int GT1 = 26;
/** RegularExpression Id. */
int LT0 = 27;
/** RegularExpression Id. */
int LT1 = 28;
/** RegularExpression Id. */
int GE0 = 29;
/** RegularExpression Id. */
int GE1 = 30;
/** RegularExpression Id. */
int LE0 = 31;
/** RegularExpression Id. */
int LE1 = 32;
/** RegularExpression Id. */
int EQ0 = 33;
/** RegularExpression Id. */
int EQ1 = 34;
/** RegularExpression Id. */
int NE0 = 35;
/** RegularExpression Id. */
int NE1 = 36;
/** RegularExpression Id. */
int NOT0 = 37;
/** RegularExpression Id. */
int NOT1 = 38;
/** RegularExpression Id. */
int AND0 = 39;
/** RegularExpression Id. */
int AND1 = 40;
/** RegularExpression Id. */
int OR0 = 41;
/** RegularExpression Id. */
int OR1 = 42;
/** RegularExpression Id. */
int EMPTY = 43;
/** RegularExpression Id. */
int INSTANCEOF = 44;
/** RegularExpression Id. */
int MULT = 45;
/** RegularExpression Id. */
int PLUS = 46;
/** RegularExpression Id. */
int MINUS = 47;
/** RegularExpression Id. */
int QUESTIONMARK = 48;
/** RegularExpression Id. */
int DIV0 = 49;
/** RegularExpression Id. */
int DIV1 = 50;
/** RegularExpression Id. */
int MOD0 = 51;
/** RegularExpression Id. */
int MOD1 = 52;
/** RegularExpression Id. */
int CONCAT = 53;
/** RegularExpression Id. */
int ASSIGN = 54;
/** RegularExpression Id. */
int ARROW = 55;
/** RegularExpression Id. */
int IDENTIFIER = 56;
/** RegularExpression Id. */
int FUNCTIONSUFFIX = 57;
/** RegularExpression Id. */
int IMPL_OBJ_START = 58;
/** RegularExpression Id. */
int LETTER = 59;
/** RegularExpression Id. */
int DIGIT = 60;
/** RegularExpression Id. */
int ILLEGAL_CHARACTER = 61;
/** Lexical state. */
int DEFAULT = 0;
/** Lexical state. */
int IN_EXPRESSION = 1;
/** Lexical state. */
int IN_SET_OR_MAP = 2;
/** Literal token values. */
String[] tokenImage = {
"<EOF>",
"<LITERAL_EXPRESSION>",
"\"${\"",
"\"#{\"",
"\" \"",
"\"\\t\"",
"\"\\n\"",
"\"\\r\"",
"\"{\"",
"\"}\"",
"<INTEGER_LITERAL>",
"<FLOATING_POINT_LITERAL>",
"<EXPONENT>",
"<STRING_LITERAL>",
"\"true\"",
"\"false\"",
"\"null\"",
"\".\"",
"\"(\"",
"\")\"",
"\"[\"",
"\"]\"",
"\":\"",
"\";\"",
"\",\"",
"\">\"",
"\"gt\"",
"\"<\"",
"\"lt\"",
"\">=\"",
"\"ge\"",
"\"<=\"",
"\"le\"",
"\"==\"",
"\"eq\"",
"\"!=\"",
"\"ne\"",
"\"!\"",
"\"not\"",
"\"&&\"",
"\"and\"",
"\"||\"",
"\"or\"",
"\"empty\"",
"\"instanceof\"",
"\"*\"",
"\"+\"",
"\"-\"",
"\"?\"",
"\"/\"",
"\"div\"",
"\"%\"",
"\"mod\"",
"\"+=\"",
"\"=\"",
"\"->\"",
"<IDENTIFIER>",
"<FUNCTIONSUFFIX>",
"\"#\"",
"<LETTER>",
"<DIGIT>",
"<ILLEGAL_CHARACTER>",
};
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,97 @@
/* Generated By:JavaCC: Do not edit this line. ELParserTreeConstants.java Version 5.0 */
package org.apache.el.parser;
public interface ELParserTreeConstants
{
public int JJTCOMPOSITEEXPRESSION = 0;
public int JJTLITERALEXPRESSION = 1;
public int JJTDEFERREDEXPRESSION = 2;
public int JJTDYNAMICEXPRESSION = 3;
public int JJTVOID = 4;
public int JJTSEMICOLON = 5;
public int JJTASSIGN = 6;
public int JJTLAMBDAEXPRESSION = 7;
public int JJTLAMBDAPARAMETERS = 8;
public int JJTCHOICE = 9;
public int JJTOR = 10;
public int JJTAND = 11;
public int JJTEQUAL = 12;
public int JJTNOTEQUAL = 13;
public int JJTLESSTHAN = 14;
public int JJTGREATERTHAN = 15;
public int JJTLESSTHANEQUAL = 16;
public int JJTGREATERTHANEQUAL = 17;
public int JJTCONCATENATION = 18;
public int JJTPLUS = 19;
public int JJTMINUS = 20;
public int JJTMULT = 21;
public int JJTDIV = 22;
public int JJTMOD = 23;
public int JJTNEGATIVE = 24;
public int JJTNOT = 25;
public int JJTEMPTY = 26;
public int JJTVALUE = 27;
public int JJTDOTSUFFIX = 28;
public int JJTBRACKETSUFFIX = 29;
public int JJTMETHODPARAMETERS = 30;
public int JJTSETDATA = 31;
public int JJTLISTDATA = 32;
public int JJTMAPDATA = 33;
public int JJTMAPENTRY = 34;
public int JJTIDENTIFIER = 35;
public int JJTFUNCTION = 36;
public int JJTTRUE = 37;
public int JJTFALSE = 38;
public int JJTFLOATINGPOINT = 39;
public int JJTINTEGER = 40;
public int JJTSTRING = 41;
public int JJTNULL = 42;
public String[] jjtNodeName = {
"CompositeExpression",
"LiteralExpression",
"DeferredExpression",
"DynamicExpression",
"void",
"Semicolon",
"Assign",
"LambdaExpression",
"LambdaParameters",
"Choice",
"Or",
"And",
"Equal",
"NotEqual",
"LessThan",
"GreaterThan",
"LessThanEqual",
"GreaterThanEqual",
"Concatenation",
"Plus",
"Minus",
"Mult",
"Div",
"Mod",
"Negative",
"Not",
"Empty",
"Value",
"DotSuffix",
"BracketSuffix",
"MethodParameters",
"SetData",
"ListData",
"MapData",
"MapEntry",
"Identifier",
"Function",
"True",
"False",
"FloatingPoint",
"Integer",
"String",
"Null",
};
}
/* JavaCC - OriginalChecksum=96680d397165a1214a1ad1f24011d5c1 (do not edit this line) */

Some files were not shown because too many files have changed in this diff Show More