svn commit: r684410 [6/16] - in /ibatis/trunk/java/ibatis-3: ./ ibatis-3-core/src/main/java/org/apache/ibatis/ognl/ ibatis-3-core/src/test/java/org/apache/ibatis/ognl/ ibatis-3-core/src/test/java/org/
Added: ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/ognl/OgnlOps.java URL: http://svn.apache.org/viewvc/ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/ognl/OgnlOps.java?rev=684410view=auto == --- ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/ognl/OgnlOps.java (added) +++ ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/ognl/OgnlOps.java Sat Aug 9 23:00:18 2008 @@ -0,0 +1,730 @@ +//-- +// Copyright (c) 1998-2004, Drew Davidson and Luke Blanshard +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// Neither the name of the Drew Davidson nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +// OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +// AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF +// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +// DAMAGE. +//-- +package org.apache.ibatis.ognl; + +import java.lang.reflect.Array; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Enumeration; + +/** + * This is an abstract class with static methods that define the operations of OGNL. + * @author Luke Blanshard ([EMAIL PROTECTED]) + * @author Drew Davidson ([EMAIL PROTECTED]) + */ +public abstract class OgnlOps implements NumericTypes +{ +/** + * Compares two objects for equality, even if it has to convert + * one of them to the other type. If both objects are numeric + * they are converted to the widest type and compared. If + * one is non-numeric and one is numeric the non-numeric is + * converted to double and compared to the double numeric + * value. If both are non-numeric and Comparable and the + * types are compatible (i.e. v1 is of the same or superclass + * of v2's type) they are compared with Comparable.compareTo(). + * If both values are non-numeric and not Comparable or of + * incompatible classes this will throw and IllegalArgumentException. + * + * @param v1First value to compare + * @param v2second value to compare + * + * @return integer describing the comparison between the two objects. + * A negative number indicates that v1 v2. Positive indicates + * that v1 v2. Zero indicates v1 == v2. + * + * @throws IllegalArgumentException if the objects are both non-numeric + * yet of incompatible types or do not implement Comparable. + */ +public static int compareWithConversion( Object v1, Object v2 ) +{ +return compareWithConversion(v1, v2, false); +} + +/** + * Compares two objects for equality, even if it has to convert + * one of them to the other type. If both objects are numeric + * they are converted to the widest type and compared. If + * one is non-numeric and one is numeric the non-numeric is + * converted to double and compared to the double numeric + * value. If both are non-numeric and Comparable and the + * types are compatible (i.e. v1 is of the same or superclass + * of v2's type) they are compared with Comparable.compareTo(). + * If both values are non-numeric and not Comparable or of + * incompatible classes this will throw and IllegalArgumentException. + * + * @param v1First value to compare + * @param v2second value to compare + * + * @return integer describing the comparison between the two objects. + * A negative number indicates that v1 v2.
svn commit: r684410 [16/16] - in /ibatis/trunk/java/ibatis-3: ./ ibatis-3-core/src/main/java/org/apache/ibatis/ognl/ ibatis-3-core/src/test/java/org/apache/ibatis/ognl/ ibatis-3-core/src/test/java/org
Added: ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/ognl/util/NameFactory.java URL: http://svn.apache.org/viewvc/ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/ognl/util/NameFactory.java?rev=684410view=auto == --- ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/ognl/util/NameFactory.java (added) +++ ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/ognl/util/NameFactory.java Sat Aug 9 23:00:18 2008 @@ -0,0 +1,62 @@ +//-- +// Copyright (c) 2004, Drew Davidson and Luke Blanshard +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// Neither the name of the Drew Davidson nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +// OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +// AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF +// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +// DAMAGE. +//-- +package org.apache.ibatis.ognl.util; + +public class NameFactory extends Object +{ +private String classBaseName; +private int classNameCounter = 0; +private String variableBaseName; +private int variableNameCounter = 0; + + /*=== + Constructors + ===*/ +public NameFactory(String classBaseName, String variableBaseName) +{ +super(); +this.classBaseName = classBaseName; +this.variableBaseName = variableBaseName; +} + + /*=== + Public methods + ===*/ +public String getNewClassName() +{ +return classBaseName + classNameCounter++; +} + +public String getNewVariableName() +{ +return variableBaseName + variableNameCounter++; +} +}
svn commit: r684410 [10/16] - in /ibatis/trunk/java/ibatis-3: ./ ibatis-3-core/src/main/java/org/apache/ibatis/ognl/ ibatis-3-core/src/test/java/org/apache/ibatis/ognl/ ibatis-3-core/src/test/java/org
Added: ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/ognl/SimpleNode.java URL: http://svn.apache.org/viewvc/ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/ognl/SimpleNode.java?rev=684410view=auto == --- ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/ognl/SimpleNode.java (added) +++ ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/ognl/SimpleNode.java Sat Aug 9 23:00:18 2008 @@ -0,0 +1,325 @@ +//-- +// Copyright (c) 1998-2004, Drew Davidson and Luke Blanshard +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// Neither the name of the Drew Davidson nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +// OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +// AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF +// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +// DAMAGE. +//-- +package org.apache.ibatis.ognl; + +import java.io.*; + +/** + * @author Luke Blanshard ([EMAIL PROTECTED]) + * @author Drew Davidson ([EMAIL PROTECTED]) + */ +public abstract class SimpleNode implements Node, Serializable +{ +protected Node parent; +protected Node[]children; +protected int id; +protected OgnlParserparser; + +private boolean constantValueCalculated; +private boolean hasConstantValue; +private Object constantValue; + +public SimpleNode(int i) { +id = i; +} + +public SimpleNode(OgnlParser p, int i) { +this(i); +parser = p; +} + +public void jjtOpen() { +} + +public void jjtClose() { +} + +public void jjtSetParent(Node n) { parent = n; } +public Node jjtGetParent() { return parent; } + +public void jjtAddChild(Node n, int i) { +if (children == null) { +children = new Node[i + 1]; +} else if (i = children.length) { +Node c[] = new Node[i + 1]; +System.arraycopy(children, 0, c, 0, children.length); +children = c; +} +children[i] = n; +} + +public Node jjtGetChild(int i) { +return children[i]; +} + +public int jjtGetNumChildren() { +return (children == null) ? 0 : children.length; +} + + /* You can override these two methods in subclasses of SimpleNode to + customize the way the node appears when the tree is dumped. If + your output uses more than one line you should override + toString(String), otherwise overriding toString() is probably all + you need to do. */ + +public String toString() { return OgnlParserTreeConstants.jjtNodeName[id]; } + +// OGNL additions + +public String toString(String prefix) { return prefix + OgnlParserTreeConstants.jjtNodeName[id] + + toString(); } + + /* Override this method if you want to customize how the node dumps + out its children. */ + +public void dump(PrintWriter writer, String prefix) { +writer.println(toString(prefix)); +if (children != null) { +for (int i = 0; i children.length; ++i) { +SimpleNode n = (SimpleNode)children[i]; +if (n != null) { +n.dump(writer, prefix + ); +} +} +} +} + +public int getIndexInParent() +{ +int result = -1; + +if (parent != null) { +int icount = parent.jjtGetNumChildren(); + +for (int i
svn commit: r684564 - /ibatis/trunk/site/pages/javadownloads.vm
Author: nmaves Date: Sun Aug 10 10:56:54 2008 New Revision: 684564 URL: http://svn.apache.org/viewvc?rev=684564view=rev Log: updated the docs page to reflect the new svn path Modified: ibatis/trunk/site/pages/javadownloads.vm Modified: ibatis/trunk/site/pages/javadownloads.vm URL: http://svn.apache.org/viewvc/ibatis/trunk/site/pages/javadownloads.vm?rev=684564r1=684563r2=684564view=diff == --- ibatis/trunk/site/pages/javadownloads.vm (original) +++ ibatis/trunk/site/pages/javadownloads.vm Sun Aug 10 10:56:54 2008 @@ -63,28 +63,28 @@ ul li - a href=http://svn.apache.org/repos/asf/ibatis/trunk/java/docs/en/; target=_newEnglish/a + a href=http://svn.apache.org/repos/asf/ibatis/trunk/java/ibatis-2/ibatis-2-docs/en/; target=_newEnglish/a /li li - a href=http://svn.apache.org/repos/asf/ibatis/trunk/java/docs/de/; target=_newGerman/a + a href=http://svn.apache.org/repos/asf/ibatis/trunk/java/ibatis-2/ibatis-2-docs/de/; target=_newGerman/a /li li - a href=http://svn.apache.org/repos/asf/ibatis/trunk/java/docs/cn/; target=_newChinese/a + a href=http://svn.apache.org/repos/asf/ibatis/trunk/java/ibatis-2/ibatis-2-docs/cn/; target=_newChinese/a /li li - a href=http://svn.apache.org/repos/asf/ibatis/trunk/java/docs/ko/; target=_newKorean/a + a href=http://svn.apache.org/repos/asf/ibatis/trunk/java/ibatis-2/ibatis-2-docs/ko/; target=_newKorean/a /li li - a href=http://svn.apache.org/repos/asf/ibatis/trunk/java/docs/ja/; target=_newJapanese/a + a href=http://svn.apache.org/repos/asf/ibatis/trunk/java/ibatis-2/ibatis-2-docs/ja/; target=_newJapanese/a /li li - a href=http://svn.apache.org/repos/asf/ibatis/trunk/java/docs/fr/; target=_newFrench (tutorial)/a + a href=http://svn.apache.org/repos/asf/ibatis/trunk/java/ibatis-2/ibatis-2-docs/fr/; target=_newFrench (tutorial)/a /li li - a href=http://svn.apache.org/repos/asf/ibatis/trunk/java/docs/it/; target=_newItalian (tutorial)/a + a href=http://svn.apache.org/repos/asf/ibatis/trunk/java/ibatis-2/ibatis-2-docs/it/; target=_newItalian (tutorial)/a /li li - a href=http://svn.apache.org/repos/asf/ibatis/trunk/java/docs/es/; target=_newSpanish (tutorial)/a + a href=http://svn.apache.org/repos/asf/ibatis/trunk/java/ibatis-2/ibatis-2-docs/es/; target=_newSpanish (tutorial)/a /li /ul