You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@struts.apache.org by mu...@apache.org on 2009/09/28 03:55:35 UTC
svn commit: r819444 [3/27] - in /struts/struts2/trunk/plugins/embeddedjsp:
./ src/main/java/org/apache/struts2/el/
src/main/java/org/apache/struts2/el/lang/
src/main/java/org/apache/struts2/el/parser/
src/main/java/org/apache/struts2/el/util/ src/main/...
Added: struts/struts2/trunk/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstIdentifier.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstIdentifier.java?rev=819444&view=auto
==============================================================================
--- struts/struts2/trunk/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstIdentifier.java (added)
+++ struts/struts2/trunk/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstIdentifier.java Mon Sep 28 01:55:26 2009
@@ -0,0 +1,154 @@
+/*
+ * 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.struts2.el.parser;
+
+import javax.el.ELException;
+import javax.el.MethodExpression;
+import javax.el.MethodInfo;
+import javax.el.MethodNotFoundException;
+import javax.el.ValueExpression;
+import javax.el.VariableMapper;
+
+import org.apache.struts2.el.lang.EvaluationContext;
+
+
+/**
+ * @author Jacob Hookom [jacob@hookom.net]
+ * @version $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author: markt $
+ */
+public final class AstIdentifier extends SimpleNode {
+ public AstIdentifier(int id) {
+ super(id);
+ }
+
+ 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);
+ return ctx.getELResolver().getType(ctx, null, this.image);
+ }
+
+ public Object getValue(EvaluationContext ctx) throws ELException {
+ VariableMapper varMapper = ctx.getVariableMapper();
+ if (varMapper != null) {
+ ValueExpression expr = varMapper.resolveVariable(this.image);
+ if (expr != null) {
+ return expr.getValue(ctx.getELContext());
+ }
+ }
+ ctx.setPropertyResolved(false);
+ return ctx.getELResolver().getValue(ctx, null, this.image);
+ }
+
+ 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);
+ return ctx.getELResolver().isReadOnly(ctx, null, this.image);
+ }
+
+ 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);
+ }
+
+ private final Object invokeTarget(EvaluationContext ctx, Object target,
+ Object[] paramValues) throws ELException {
+ if (target instanceof MethodExpression) {
+ MethodExpression me = (MethodExpression) target;
+ return me.invoke(ctx.getELContext(), paramValues);
+ } else if (target == 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: "
+ + target.getClass().getName());
+ }
+ }
+
+ public Object invoke(EvaluationContext ctx, Class[] paramTypes,
+ Object[] paramValues) throws ELException {
+ return this.getMethodExpression(ctx).invoke(ctx.getELContext(), paramValues);
+ }
+
+
+ public MethodInfo getMethodInfo(EvaluationContext ctx, Class[] paramTypes)
+ throws ELException {
+ return this.getMethodExpression(ctx).getMethodInfo(ctx.getELContext());
+ }
+
+ 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());
+ }
+ }
+}
Added: struts/struts2/trunk/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstInteger.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstInteger.java?rev=819444&view=auto
==============================================================================
--- struts/struts2/trunk/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstInteger.java (added)
+++ struts/struts2/trunk/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstInteger.java Mon Sep 28 01:55:26 2009
@@ -0,0 +1,59 @@
+/*
+ * 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.struts2.el.parser;
+
+import java.math.BigInteger;
+
+import javax.el.ELException;
+
+import org.apache.struts2.el.lang.EvaluationContext;
+
+
+/**
+ * @author Jacob Hookom [jacob@hookom.net]
+ * @version $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author: markt $
+ */
+public final class AstInteger extends SimpleNode {
+ public AstInteger(int id) {
+ super(id);
+ }
+
+ private Number number;
+
+ protected Number getInteger() {
+ if (this.number == null) {
+ try {
+ this.number = new Long(this.image);
+ } catch (ArithmeticException e1) {
+ this.number = new BigInteger(this.image);
+ }
+ }
+ return number;
+ }
+
+ public Class getType(EvaluationContext ctx)
+ throws ELException {
+ return this.getInteger().getClass();
+ }
+
+ public Object getValue(EvaluationContext ctx)
+ throws ELException {
+ return this.getInteger();
+ }
+}
Added: struts/struts2/trunk/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstLessThan.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstLessThan.java?rev=819444&view=auto
==============================================================================
--- struts/struts2/trunk/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstLessThan.java (added)
+++ struts/struts2/trunk/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstLessThan.java Mon Sep 28 01:55:26 2009
@@ -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.struts2.el.parser;
+
+import javax.el.ELException;
+
+import org.apache.struts2.el.lang.EvaluationContext;
+
+
+/**
+ * @author Jacob Hookom [jacob@hookom.net]
+ * @version $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author: markt $
+ */
+public final class AstLessThan extends BooleanNode {
+ public AstLessThan(int id) {
+ super(id);
+ }
+
+ 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(obj0, obj1) < 0) ? Boolean.TRUE : Boolean.FALSE;
+ }
+}
Added: struts/struts2/trunk/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstLessThanEqual.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstLessThanEqual.java?rev=819444&view=auto
==============================================================================
--- struts/struts2/trunk/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstLessThanEqual.java (added)
+++ struts/struts2/trunk/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstLessThanEqual.java Mon Sep 28 01:55:26 2009
@@ -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.struts2.el.parser;
+
+import javax.el.ELException;
+
+import org.apache.struts2.el.lang.EvaluationContext;
+
+
+/**
+ * @author Jacob Hookom [jacob@hookom.net]
+ * @version $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author: markt $
+ */
+public final class AstLessThanEqual extends BooleanNode {
+ public AstLessThanEqual(int id) {
+ super(id);
+ }
+
+ 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(obj0, obj1) <= 0) ? Boolean.TRUE : Boolean.FALSE;
+ }
+}
Added: struts/struts2/trunk/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstLiteralExpression.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstLiteralExpression.java?rev=819444&view=auto
==============================================================================
--- struts/struts2/trunk/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstLiteralExpression.java (added)
+++ struts/struts2/trunk/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstLiteralExpression.java Mon Sep 28 01:55:26 2009
@@ -0,0 +1,64 @@
+/*
+ * 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.struts2.el.parser;
+
+import javax.el.ELException;
+
+import org.apache.struts2.el.lang.EvaluationContext;
+
+
+/**
+ * @author Jacob Hookom [jacob@hookom.net]
+ * @version $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author: markt $
+ */
+public final class AstLiteralExpression extends SimpleNode {
+ public AstLiteralExpression(int id) {
+ super(id);
+ }
+
+ public Class getType(EvaluationContext ctx) throws ELException {
+ return String.class;
+ }
+
+ public Object getValue(EvaluationContext ctx) throws ELException {
+ return this.image;
+ }
+
+ public void setImage(String image) {
+ if (image.indexOf('\\') == -1) {
+ this.image = image;
+ return;
+ }
+ int size = image.length();
+ StringBuffer buf = new StringBuffer(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 == '\'' || c1 == '#'
+ || c1 == '$') {
+ c = c1;
+ i++;
+ }
+ }
+ buf.append(c);
+ }
+ this.image = buf.toString();
+ }
+}
Added: struts/struts2/trunk/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstMinus.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstMinus.java?rev=819444&view=auto
==============================================================================
--- struts/struts2/trunk/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstMinus.java (added)
+++ struts/struts2/trunk/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstMinus.java Mon Sep 28 01:55:26 2009
@@ -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.struts2.el.parser;
+
+import javax.el.ELException;
+
+import org.apache.struts2.el.lang.ELArithmetic;
+import org.apache.struts2.el.lang.EvaluationContext;
+
+
+/**
+ * @author Jacob Hookom [jacob@hookom.net]
+ * @version $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author: markt $
+ */
+public final class AstMinus extends ArithmeticNode {
+ public AstMinus(int id) {
+ super(id);
+ }
+
+ 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);
+ }
+}
Added: struts/struts2/trunk/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstMod.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstMod.java?rev=819444&view=auto
==============================================================================
--- struts/struts2/trunk/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstMod.java (added)
+++ struts/struts2/trunk/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstMod.java Mon Sep 28 01:55:26 2009
@@ -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.struts2.el.parser;
+
+import javax.el.ELException;
+
+import org.apache.struts2.el.lang.ELArithmetic;
+import org.apache.struts2.el.lang.EvaluationContext;
+
+
+/**
+ * @author Jacob Hookom [jacob@hookom.net]
+ * @version $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author: markt $
+ */
+public final class AstMod extends ArithmeticNode {
+ public AstMod(int id) {
+ super(id);
+ }
+
+ 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);
+ }
+}
Added: struts/struts2/trunk/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstMult.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstMult.java?rev=819444&view=auto
==============================================================================
--- struts/struts2/trunk/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstMult.java (added)
+++ struts/struts2/trunk/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstMult.java Mon Sep 28 01:55:26 2009
@@ -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.struts2.el.parser;
+
+import javax.el.ELException;
+
+import org.apache.struts2.el.lang.ELArithmetic;
+import org.apache.struts2.el.lang.EvaluationContext;
+
+
+/**
+ * @author Jacob Hookom [jacob@hookom.net]
+ * @version $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author: markt $
+ */
+public final class AstMult extends ArithmeticNode {
+ public AstMult(int id) {
+ super(id);
+ }
+
+ 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);
+ }
+}
Added: struts/struts2/trunk/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstNegative.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstNegative.java?rev=819444&view=auto
==============================================================================
--- struts/struts2/trunk/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstNegative.java (added)
+++ struts/struts2/trunk/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstNegative.java Mon Sep 28 01:55:26 2009
@@ -0,0 +1,83 @@
+/*
+ * 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.struts2.el.parser;
+
+import java.math.BigDecimal;
+import java.math.BigInteger;
+
+import javax.el.ELException;
+
+import org.apache.struts2.el.lang.EvaluationContext;
+
+
+/**
+ * @author Jacob Hookom [jacob@hookom.net]
+ * @version $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author: markt $
+ */
+public final class AstNegative extends SimpleNode {
+ public AstNegative(int id) {
+ super(id);
+ }
+
+ public Class getType(EvaluationContext ctx)
+ throws ELException {
+ return Number.class;
+ }
+
+ public Object getValue(EvaluationContext ctx)
+ throws ELException {
+ Object obj = this.children[0].getValue(ctx);
+
+ if (obj == null) {
+ return new Long(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 new Double(-Double.parseDouble((String) obj));
+ }
+ return new Long(-Long.parseLong((String) obj));
+ }
+ if (obj instanceof Long) {
+ return new Long(-((Long) obj).longValue());
+ }
+ if (obj instanceof Double) {
+ return new Double(-((Double) obj).doubleValue());
+ }
+ if (obj instanceof Integer) {
+ return new Integer(-((Integer) obj).intValue());
+ }
+ if (obj instanceof Float) {
+ return new Float(-((Float) obj).floatValue());
+ }
+ if (obj instanceof Short) {
+ return new Short((short) -((Short) obj).shortValue());
+ }
+ if (obj instanceof Byte) {
+ return new Byte((byte) -((Byte) obj).byteValue());
+ }
+ Long num = (Long) coerceToNumber(obj, Long.class);
+ return new Long(-num.longValue());
+ }
+}
Added: struts/struts2/trunk/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstNot.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstNot.java?rev=819444&view=auto
==============================================================================
--- struts/struts2/trunk/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstNot.java (added)
+++ struts/struts2/trunk/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstNot.java Mon Sep 28 01:55:26 2009
@@ -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. AstNot.java */
+
+package org.apache.struts2.el.parser;
+
+import javax.el.ELException;
+
+import org.apache.struts2.el.lang.EvaluationContext;
+
+
+/**
+ * @author Jacob Hookom [jacob@hookom.net]
+ * @version $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author: markt $
+ */
+public final class AstNot extends SimpleNode {
+ public AstNot(int id) {
+ super(id);
+ }
+
+ public Class getType(EvaluationContext ctx)
+ throws ELException {
+ return Boolean.class;
+ }
+
+ public Object getValue(EvaluationContext ctx)
+ throws ELException {
+ Object obj = this.children[0].getValue(ctx);
+ Boolean b = coerceToBoolean(obj);
+ return Boolean.valueOf(!b.booleanValue());
+ }
+}
Added: struts/struts2/trunk/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstNotEqual.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstNotEqual.java?rev=819444&view=auto
==============================================================================
--- struts/struts2/trunk/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstNotEqual.java (added)
+++ struts/struts2/trunk/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstNotEqual.java Mon Sep 28 01:55:26 2009
@@ -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.struts2.el.parser;
+
+import javax.el.ELException;
+
+import org.apache.struts2.el.lang.EvaluationContext;
+
+
+/**
+ * @author Jacob Hookom [jacob@hookom.net]
+ * @version $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author: markt $
+ */
+public final class AstNotEqual extends BooleanNode {
+ public AstNotEqual(int id) {
+ super(id);
+ }
+
+ 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(obj0, obj1));
+ }
+}
Added: struts/struts2/trunk/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstNull.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstNull.java?rev=819444&view=auto
==============================================================================
--- struts/struts2/trunk/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstNull.java (added)
+++ struts/struts2/trunk/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstNull.java Mon Sep 28 01:55:26 2009
@@ -0,0 +1,44 @@
+/*
+ * 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.struts2.el.parser;
+
+import javax.el.ELException;
+
+import org.apache.struts2.el.lang.EvaluationContext;
+
+
+/**
+ * @author Jacob Hookom [jacob@hookom.net]
+ * @version $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author: markt $
+ */
+public final class AstNull extends SimpleNode {
+ public AstNull(int id) {
+ super(id);
+ }
+
+ public Class getType(EvaluationContext ctx)
+ throws ELException {
+ return null;
+ }
+
+ public Object getValue(EvaluationContext ctx)
+ throws ELException {
+ return null;
+ }
+}
Added: struts/struts2/trunk/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstOr.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstOr.java?rev=819444&view=auto
==============================================================================
--- struts/struts2/trunk/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstOr.java (added)
+++ struts/struts2/trunk/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstOr.java Mon Sep 28 01:55:26 2009
@@ -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.struts2.el.parser;
+
+import javax.el.ELException;
+
+import org.apache.struts2.el.lang.EvaluationContext;
+
+
+/**
+ * @author Jacob Hookom [jacob@hookom.net]
+ * @version $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author: markt $
+ */
+public final class AstOr extends BooleanNode {
+ public AstOr(int id) {
+ super(id);
+ }
+
+ public Object getValue(EvaluationContext ctx)
+ throws ELException {
+ Object obj = this.children[0].getValue(ctx);
+ Boolean b = coerceToBoolean(obj);
+ if (b.booleanValue()) {
+ return b;
+ }
+ obj = this.children[1].getValue(ctx);
+ b = coerceToBoolean(obj);
+ return b;
+ }
+}
Added: struts/struts2/trunk/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstPlus.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstPlus.java?rev=819444&view=auto
==============================================================================
--- struts/struts2/trunk/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstPlus.java (added)
+++ struts/struts2/trunk/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstPlus.java Mon Sep 28 01:55:26 2009
@@ -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.struts2.el.parser;
+
+import javax.el.ELException;
+
+import org.apache.struts2.el.lang.ELArithmetic;
+import org.apache.struts2.el.lang.EvaluationContext;
+
+
+/**
+ * @author Jacob Hookom [jacob@hookom.net]
+ * @version $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author: markt $
+ */
+public final class AstPlus extends ArithmeticNode {
+ public AstPlus(int id) {
+ super(id);
+ }
+
+ 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);
+ }
+}
Added: struts/struts2/trunk/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstString.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstString.java?rev=819444&view=auto
==============================================================================
--- struts/struts2/trunk/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstString.java (added)
+++ struts/struts2/trunk/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstString.java Mon Sep 28 01:55:26 2009
@@ -0,0 +1,75 @@
+/*
+ * 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.struts2.el.parser;
+
+import javax.el.ELException;
+
+import org.apache.struts2.el.lang.EvaluationContext;
+
+
+/**
+ * @author Jacob Hookom [jacob@hookom.net]
+ * @version $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author: markt $
+ */
+public final class AstString extends SimpleNode {
+ public AstString(int id) {
+ super(id);
+ }
+
+ private String string;
+
+ public String getString() {
+ if (this.string == null) {
+ this.string = this.image.substring(1, this.image.length() - 1);
+ }
+ return this.string;
+ }
+
+ public Class getType(EvaluationContext ctx)
+ throws ELException {
+ return String.class;
+ }
+
+ public Object getValue(EvaluationContext ctx)
+ throws ELException {
+ return this.getString();
+ }
+
+ public void setImage(String image) {
+ if (image.indexOf('\\') == -1) {
+ this.image = image;
+ return;
+ }
+ int size = image.length();
+ StringBuffer buf = new StringBuffer(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 == '\'' || c1 == '#'
+ || c1 == '$') {
+ c = c1;
+ i++;
+ }
+ }
+ buf.append(c);
+ }
+ this.image = buf.toString();
+ }
+}
Added: struts/struts2/trunk/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstTrue.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstTrue.java?rev=819444&view=auto
==============================================================================
--- struts/struts2/trunk/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstTrue.java (added)
+++ struts/struts2/trunk/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstTrue.java Mon Sep 28 01:55:26 2009
@@ -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.struts2.el.parser;
+
+import javax.el.ELException;
+
+import org.apache.struts2.el.lang.EvaluationContext;
+
+
+/**
+ * @author Jacob Hookom [jacob@hookom.net]
+ * @version $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author: markt $
+ */
+public final class AstTrue extends BooleanNode {
+ public AstTrue(int id) {
+ super(id);
+ }
+
+ public Object getValue(EvaluationContext ctx)
+ throws ELException {
+ return Boolean.TRUE;
+ }
+}
Added: struts/struts2/trunk/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstValue.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstValue.java?rev=819444&view=auto
==============================================================================
--- struts/struts2/trunk/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstValue.java (added)
+++ struts/struts2/trunk/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstValue.java Mon Sep 28 01:55:26 2009
@@ -0,0 +1,180 @@
+/*
+ * 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.struts2.el.parser;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
+import javax.el.ELException;
+import javax.el.ELResolver;
+import javax.el.MethodInfo;
+import javax.el.PropertyNotFoundException;
+
+import org.apache.struts2.el.lang.ELSupport;
+import org.apache.struts2.el.lang.EvaluationContext;
+import org.apache.struts2.el.util.MessageFactory;
+import org.apache.struts2.el.util.ReflectionUtil;
+
+
+/**
+ * @author Jacob Hookom [jacob@hookom.net]
+ * @version $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author: markt $
+ */
+public final class AstValue extends SimpleNode {
+
+ protected static final boolean COERCE_TO_ZERO =
+ Boolean.valueOf(System.getProperty(
+ "org.apache.el.parser.COERCE_TO_ZERO", "true")).booleanValue();
+
+ protected static class Target {
+ protected Object base;
+
+ protected Object property;
+ }
+
+ public AstValue(int id) {
+ super(id);
+ }
+
+ public Class getType(EvaluationContext ctx) throws ELException {
+ Target t = getTarget(ctx);
+ ctx.setPropertyResolved(false);
+ return ctx.getELResolver().getType(ctx, t.base, t.property);
+ }
+
+ 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 properites 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() - 1;
+ int i = 1;
+
+ // evaluate any properties before our target
+ ELResolver resolver = ctx.getELResolver();
+ if (propCount > 1) {
+ while (base != null && i < propCount) {
+ property = this.children[i].getValue(ctx);
+ ctx.setPropertyResolved(false);
+ base = resolver.getValue(ctx, base, property);
+ i++;
+ }
+ // if we are in this block, we have more properties to resolve,
+ // but our base was null
+ if (base == null || property == null) {
+ throw new PropertyNotFoundException(MessageFactory.get(
+ "error.unreachable.property", property));
+ }
+ }
+
+ property = this.children[i].getValue(ctx);
+
+ if (property == null) {
+ throw new PropertyNotFoundException(MessageFactory.get(
+ "error.unreachable.property", this.children[i]));
+ }
+
+ Target t = new Target();
+ t.base = base;
+ t.property = property;
+ return t;
+ }
+
+ public Object getValue(EvaluationContext ctx) throws ELException {
+ Object base = this.children[0].getValue(ctx);
+ int propCount = this.jjtGetNumChildren();
+ int i = 1;
+ Object property = null;
+ ELResolver resolver = ctx.getELResolver();
+ while (base != null && i < propCount) {
+ property = this.children[i].getValue(ctx);
+ if (property == null) {
+ return null;
+ } else {
+ ctx.setPropertyResolved(false);
+ base = resolver.getValue(ctx, base, property);
+ }
+ i++;
+ }
+ return base;
+ }
+
+ public boolean isReadOnly(EvaluationContext ctx) throws ELException {
+ Target t = getTarget(ctx);
+ ctx.setPropertyResolved(false);
+ return ctx.getELResolver().isReadOnly(ctx, t.base, t.property);
+ }
+
+ 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);
+ if (COERCE_TO_ZERO == true
+ || !isAssignable(value, targetClass)) {
+ value = ELSupport.coerceToType(value, targetClass);
+ }
+ resolver.setValue(ctx, t.base, t.property, value);
+ }
+
+ private boolean isAssignable(Object value, Class<?> targetClass) {
+ if (targetClass == null) {
+ return false;
+ } else if (value != null && targetClass.isPrimitive()) {
+ return false;
+ } else if (value != null && !targetClass.isInstance(value)) {
+ return false;
+ }
+ return true;
+ }
+
+
+ public MethodInfo getMethodInfo(EvaluationContext ctx, Class[] paramTypes)
+ throws ELException {
+ Target t = getTarget(ctx);
+ Method m = ReflectionUtil.getMethod(t.base, t.property, paramTypes);
+ return new MethodInfo(m.getName(), m.getReturnType(), m
+ .getParameterTypes());
+ }
+
+ public Object invoke(EvaluationContext ctx, Class[] paramTypes,
+ Object[] paramValues) throws ELException {
+ Target t = getTarget(ctx);
+ Method m = ReflectionUtil.getMethod(t.base, t.property, paramTypes);
+ Object result = null;
+ try {
+ result = m.invoke(t.base, (Object[]) paramValues);
+ } catch (IllegalAccessException iae) {
+ throw new ELException(iae);
+ } catch (InvocationTargetException ite) {
+ throw new ELException(ite.getCause());
+ }
+ return result;
+ }
+}
Added: struts/struts2/trunk/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/BooleanNode.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/BooleanNode.java?rev=819444&view=auto
==============================================================================
--- struts/struts2/trunk/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/BooleanNode.java (added)
+++ struts/struts2/trunk/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/BooleanNode.java Mon Sep 28 01:55:26 2009
@@ -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.
+ */
+package org.apache.struts2.el.parser;
+
+import javax.el.ELException;
+
+import org.apache.struts2.el.lang.EvaluationContext;
+
+
+/**
+ * @author Jacob Hookom [jacob@hookom.net]
+ * @version $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author: markt $
+ */
+public class BooleanNode extends SimpleNode {
+ /**
+ * @param i
+ */
+ public BooleanNode(int i) {
+ super(i);
+ }
+ public Class getType(EvaluationContext ctx)
+ throws ELException {
+ return Boolean.class;
+ }
+}
Added: struts/struts2/trunk/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/ELParser.html
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/ELParser.html?rev=819444&view=auto
==============================================================================
--- struts/struts2/trunk/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/ELParser.html (added)
+++ struts/struts2/trunk/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/ELParser.html Mon Sep 28 01:55:26 2009
@@ -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> )* <EOF></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><LITERAL_EXPRESSION></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><START_DEFERRED_EXPRESSION> <A HREF="#prod5">Expression</A> <END_EXPRESSION></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><START_DYNAMIC_EXPRESSION> <A HREF="#prod5">Expression</A> <END_EXPRESSION></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> ( <QUESTIONMARK> <A HREF="#prod6">Choice</A> <COLON> <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> ( ( <OR0> | <OR1> ) <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> ( ( <AND0> | <AND1> ) <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> ( ( ( <EQ0> | <EQ1> ) <A HREF="#prod10">Compare</A> ) | ( ( <NE0> | <NE1> ) <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> ( ( ( <LT0> | <LT1> ) <A HREF="#prod11">Math</A> ) | ( ( <GT0> | <GT1> ) <A HREF="#prod11">Math</A> ) | ( ( <LE0> | <LE1> ) <A HREF="#prod11">Math</A> ) | ( ( <GE0> | <GE1> ) <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> ( ( <PLUS> <A HREF="#prod12">Multiplication</A> ) | ( <MINUS> <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> ( ( <MULT> <A HREF="#prod13">Unary</A> ) | ( <DIV> <A HREF="#prod13">Unary</A> ) | ( ( <MOD0> | <MOD1> ) <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><MINUS> <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>( <NOT0> | <NOT1> ) <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><EMPTY> <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><DOT> <IDENTIFIER></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><LBRACK> <A HREF="#prod5">Expression</A> <RBRACK></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><LPAREN> <A HREF="#prod5">Expression</A> <RPAREN></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><IDENTIFIER></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><IDENTIFIER> ( <FUNCTIONSUFFIX> )? <LPAREN> ( <A HREF="#prod5">Expression</A> ( <COMMA> <A HREF="#prod5">Expression</A> )* )? <RPAREN></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><TRUE></TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>|</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE><FALSE></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><FLOATING_POINT_LITERAL></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><INTEGER_LITERAL></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><STRING_LITERAL></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><NULL></TD>
+</TR>
+</TABLE>
+</BODY>
+</HTML>