From jdo-commits-return-179-apmail-db-jdo-commits-archive=www.apache.org@db.apache.org Sat Mar 19 05:01:09 2005 Return-Path: Delivered-To: apmail-db-jdo-commits-archive@www.apache.org Received: (qmail 83148 invoked from network); 19 Mar 2005 05:01:09 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 19 Mar 2005 05:01:09 -0000 Received: (qmail 83751 invoked by uid 500); 19 Mar 2005 05:01:09 -0000 Mailing-List: contact jdo-commits-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: jdo-dev@db.apache.org Delivered-To: mailing list jdo-commits@db.apache.org Delivered-To: moderator for jdo-commits@db.apache.org Received: (qmail 83058 invoked by uid 99); 19 Mar 2005 01:06:16 -0000 X-ASF-Spam-Status: No, hits=-9.8 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Message-ID: <20050319010611.28249.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Mailer: svnmailer-1.0.0-dev Date: Sat, 19 Mar 2005 01:06:11 -0000 Subject: svn commit: r158176 [53/79] - in incubator/jdo/trunk/ri11: ./ src/ src/conf/ src/java/ src/java/org/ src/java/org/apache/ src/java/org/apache/jdo/ src/java/org/apache/jdo/ejb/ src/java/org/apache/jdo/enhancer/ src/java/org/apache/jdo/impl/ src/java/org/apache/jdo/impl/enhancer/ src/java/org/apache/jdo/impl/enhancer/classfile/ src/java/org/apache/jdo/impl/enhancer/core/ src/java/org/apache/jdo/impl/enhancer/generator/ src/java/org/apache/jdo/impl/enhancer/meta/ src/java/org/apache/jdo/impl/enhancer/meta/model/ src/java/org/apache/jdo/impl/enhancer/meta/prop/ src/java/org/apache/jdo/impl/enhancer/meta/util/ src/java/org/apache/jdo/impl/enhancer/util/ src/java/org/apache/jdo/impl/fostore/ src/java/org/apache/jdo/impl/jdoql/ src/java/org/apache/jdo/impl/jdoql/jdoqlc/ src/java/org/apache/jdo/impl/jdoql/scope/ src/java/org/apache/jdo/impl/jdoql/tree/ src/java/org/apache/jdo/impl/model/ src/java/org/apache/jdo/impl/model/java/ src/java/org/apache/jdo/impl/model/java/runtime/ src/java/org/apache/jdo/impl/model/jdo/ src/java/org/apache/jdo/impl/model/jdo/caching/ src/java/org/apache/jdo/impl/model/jdo/util/ src/java/org/apache/jdo/impl/model/jdo/xml/ src/java/org/apache/jdo/impl/pm/ src/java/org/apache/jdo/impl/sco/ src/java/org/apache/jdo/impl/state/ src/java/org/apache/jdo/jdoql/ src/java/org/apache/jdo/jdoql/tree/ src/java/org/apache/jdo/model/ src/java/org/apache/jdo/model/java/ src/java/org/apache/jdo/model/jdo/ src/java/org/apache/jdo/pm/ src/java/org/apache/jdo/sco/ src/java/org/apache/jdo/state/ src/java/org/apache/jdo/store/ src/java/org/apache/jdo/util/ test/ test/conf/ test/enhancer/ test/enhancer/sempdept/ test/enhancer/sempdept/src/ test/enhancer/sempdept/src/empdept/ test/fsuid2/ test/fsuid2/org/ test/fsuid2/org/apache/ test/fsuid2/org/apache/jdo/ test/fsuid2/org/apache/jdo/pc/ test/java/ test/java/org/ test/java/org/apache/ test/java/org/apache/jdo/ test/java/org/apache/jdo/impl/ test/java/org/apache/jdo/impl/fostore/ test/java/org/apache/jdo/pc/ test/java/org/apache/jdo/pc/appid/ test/java/org/apache/jdo/pc/empdept/ test/java/org/apache/jdo/pc/serializable/ test/java/org/apache/jdo/pc/xempdept/ test/java/org/apache/jdo/test/ test/java/org/apache/jdo/test/query/ test/java/org/apache/jdo/test/util/ test/jdo/ test/jdo/org/ test/jdo/org/apache/ test/jdo/org/apache/jdo/ test/jdo/org/apache/jdo/pc/ test/jdo/org/apache/jdo/pc/appid/ test/jdo/org/apache/jdo/pc/empdept/ test/jdo/org/apache/jdo/pc/serializable/ test/jdo/org/apache/jdo/pc/xempdept/ xdocs/ To: jdo-commits@db.apache.org From: mbo@apache.org X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Added: incubator/jdo/trunk/ri11/src/java/org/apache/jdo/jdoql/tree/NotEqual= sExpression.java URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/ri11/src/java/org/ap= ache/jdo/jdoql/tree/NotEqualsExpression.java?view=3Dauto&rev=3D158176 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- incubator/jdo/trunk/ri11/src/java/org/apache/jdo/jdoql/tree/NotEqualsEx= pression.java (added) +++ incubator/jdo/trunk/ri11/src/java/org/apache/jdo/jdoql/tree/NotEqualsEx= pression.java Fri Mar 18 17:02:29 2005 @@ -0,0 +1,28 @@ +/* + * Copyright 2005 The Apache Software Foundation. + *=20 + * Licensed 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=20 + *=20 + * http://www.apache.org/licenses/LICENSE-2.0 + *=20 + * Unless required by applicable law or agreed to in writing, software=20 + * distributed under the License is distributed on an "AS IS" BASIS,=20 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied= .=20 + * See the License for the specific language governing permissions and=20 + * limitations under the License. + */ + +package org.apache.jdo.jdoql.tree; + +/** + * This node represents a not equals operator. + * A not equals operator is a binary expression. + * The string representation of this operator is !=3D. + * + * @author Michael Watzek + */ +public interface NotEqualsExpression extends BinaryExpression +{ +} Added: incubator/jdo/trunk/ri11/src/java/org/apache/jdo/jdoql/tree/NotExpre= ssion.java URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/ri11/src/java/org/ap= ache/jdo/jdoql/tree/NotExpression.java?view=3Dauto&rev=3D158176 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- incubator/jdo/trunk/ri11/src/java/org/apache/jdo/jdoql/tree/NotExpressi= on.java (added) +++ incubator/jdo/trunk/ri11/src/java/org/apache/jdo/jdoql/tree/NotExpressi= on.java Fri Mar 18 17:02:29 2005 @@ -0,0 +1,28 @@ +/* + * Copyright 2005 The Apache Software Foundation. + *=20 + * Licensed 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=20 + *=20 + * http://www.apache.org/licenses/LICENSE-2.0 + *=20 + * Unless required by applicable law or agreed to in writing, software=20 + * distributed under the License is distributed on an "AS IS" BASIS,=20 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied= .=20 + * See the License for the specific language governing permissions and=20 + * limitations under the License. + */ + +package org.apache.jdo.jdoql.tree; + +/** + * This node represents a logical not operator. + * A logical not operator is a unary expression. + * The string representation of this operator is !. + * + * @author Michael Watzek + */ +public interface NotExpression extends UnaryExpression +{ +} Added: incubator/jdo/trunk/ri11/src/java/org/apache/jdo/jdoql/tree/OrExpres= sion.java URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/ri11/src/java/org/ap= ache/jdo/jdoql/tree/OrExpression.java?view=3Dauto&rev=3D158176 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- incubator/jdo/trunk/ri11/src/java/org/apache/jdo/jdoql/tree/OrExpressio= n=2Ejava (added) +++ incubator/jdo/trunk/ri11/src/java/org/apache/jdo/jdoql/tree/OrExpressio= n=2Ejava Fri Mar 18 17:02:29 2005 @@ -0,0 +1,29 @@ +/* + * Copyright 2005 The Apache Software Foundation. + *=20 + * Licensed 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=20 + *=20 + * http://www.apache.org/licenses/LICENSE-2.0 + *=20 + * Unless required by applicable law or agreed to in writing, software=20 + * distributed under the License is distributed on an "AS IS" BASIS,=20 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied= .=20 + * See the License for the specific language governing permissions and=20 + * limitations under the License. + */ + +package org.apache.jdo.jdoql.tree; + +/** + * This node represents a bitwise or logical or operator depending on the = result + * types of its children. A bitwise operator is based on arithmetical type= s=2E + * In contrast, a logical operator is based on boolean types. + * The string representation of this operator is |. + * + * @author Michael Watzek + */ +public interface OrExpression extends BinaryExpression +{ +} Added: incubator/jdo/trunk/ri11/src/java/org/apache/jdo/jdoql/tree/Ordering= Expression.java URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/ri11/src/java/org/ap= ache/jdo/jdoql/tree/OrderingExpression.java?view=3Dauto&rev=3D158176 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- incubator/jdo/trunk/ri11/src/java/org/apache/jdo/jdoql/tree/OrderingExp= ression.java (added) +++ incubator/jdo/trunk/ri11/src/java/org/apache/jdo/jdoql/tree/OrderingExp= ression.java Fri Mar 18 17:02:29 2005 @@ -0,0 +1,33 @@ +/* + * Copyright 2005 The Apache Software Foundation. + *=20 + * Licensed 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=20 + *=20 + * http://www.apache.org/licenses/LICENSE-2.0 + *=20 + * Unless required by applicable law or agreed to in writing, software=20 + * distributed under the License is distributed on an "AS IS" BASIS,=20 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied= .=20 + * See the License for the specific language governing permissions and=20 + * limitations under the License. + */ + +package org.apache.jdo.jdoql.tree; + +/** + * This node represents an ordering expression. Examples of ordering expre= ssions + * are AscendingOrderingExpression and + * DescendingOrderingExpression. + * + * @author Michael Watzek + */ +public interface OrderingExpression extends Node +{ + /** + * Returns the node's ordering expression. + * @return the node's expression + */ + public Expression getOrdering(); +} Added: incubator/jdo/trunk/ri11/src/java/org/apache/jdo/jdoql/tree/Paramete= rAccessExpression.java URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/ri11/src/java/org/ap= ache/jdo/jdoql/tree/ParameterAccessExpression.java?view=3Dauto&rev=3D158176 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- incubator/jdo/trunk/ri11/src/java/org/apache/jdo/jdoql/tree/ParameterAc= cessExpression.java (added) +++ incubator/jdo/trunk/ri11/src/java/org/apache/jdo/jdoql/tree/ParameterAc= cessExpression.java Fri Mar 18 17:02:29 2005 @@ -0,0 +1,27 @@ +/* + * Copyright 2005 The Apache Software Foundation. + *=20 + * Licensed 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=20 + *=20 + * http://www.apache.org/licenses/LICENSE-2.0 + *=20 + * Unless required by applicable law or agreed to in writing, software=20 + * distributed under the License is distributed on an "AS IS" BASIS,=20 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied= .=20 + * See the License for the specific language governing permissions and=20 + * limitations under the License. + */ + +package org.apache.jdo.jdoql.tree; + +/** + * This node represents a parameter access expression. + * It does not have any children. + * + * @author Michael Watzek + */ +public interface ParameterAccessExpression extends IdentifierExpression +{ +} Added: incubator/jdo/trunk/ri11/src/java/org/apache/jdo/jdoql/tree/Paramete= rDeclaration.java URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/ri11/src/java/org/ap= ache/jdo/jdoql/tree/ParameterDeclaration.java?view=3Dauto&rev=3D158176 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- incubator/jdo/trunk/ri11/src/java/org/apache/jdo/jdoql/tree/ParameterDe= claration.java (added) +++ incubator/jdo/trunk/ri11/src/java/org/apache/jdo/jdoql/tree/ParameterDe= claration.java Fri Mar 18 17:02:29 2005 @@ -0,0 +1,27 @@ +/* + * Copyright 2005 The Apache Software Foundation. + *=20 + * Licensed 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=20 + *=20 + * http://www.apache.org/licenses/LICENSE-2.0 + *=20 + * Unless required by applicable law or agreed to in writing, software=20 + * distributed under the License is distributed on an "AS IS" BASIS,=20 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied= .=20 + * See the License for the specific language governing permissions and=20 + * limitations under the License. + */ + +package org.apache.jdo.jdoql.tree; + +/** + * This node represents a parameter access expression. + * It does not have any children. + * + * @author Michael Watzek + */ +public interface ParameterDeclaration extends Declaration +{ +} Added: incubator/jdo/trunk/ri11/src/java/org/apache/jdo/jdoql/tree/PlusExpr= ession.java URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/ri11/src/java/org/ap= ache/jdo/jdoql/tree/PlusExpression.java?view=3Dauto&rev=3D158176 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- incubator/jdo/trunk/ri11/src/java/org/apache/jdo/jdoql/tree/PlusExpress= ion.java (added) +++ incubator/jdo/trunk/ri11/src/java/org/apache/jdo/jdoql/tree/PlusExpress= ion.java Fri Mar 18 17:02:29 2005 @@ -0,0 +1,27 @@ +/* + * Copyright 2005 The Apache Software Foundation. + *=20 + * Licensed 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=20 + *=20 + * http://www.apache.org/licenses/LICENSE-2.0 + *=20 + * Unless required by applicable law or agreed to in writing, software=20 + * distributed under the License is distributed on an "AS IS" BASIS,=20 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied= .=20 + * See the License for the specific language governing permissions and=20 + * limitations under the License. + */ + +package org.apache.jdo.jdoql.tree; + +/** + * This node represents a binary plus operator. + * The string representation of this operator is +. + * + * @author Michael Watzek + */ +public interface PlusExpression extends BinaryExpression +{ +} Added: incubator/jdo/trunk/ri11/src/java/org/apache/jdo/jdoql/tree/QueryTre= e=2Ejava URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/ri11/src/java/org/ap= ache/jdo/jdoql/tree/QueryTree.java?view=3Dauto&rev=3D158176 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- incubator/jdo/trunk/ri11/src/java/org/apache/jdo/jdoql/tree/QueryTree.j= ava (added) +++ incubator/jdo/trunk/ri11/src/java/org/apache/jdo/jdoql/tree/QueryTree.j= ava Fri Mar 18 17:02:29 2005 @@ -0,0 +1,127 @@ +/* + * Copyright 2005 The Apache Software Foundation. + *=20 + * Licensed 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=20 + *=20 + * http://www.apache.org/licenses/LICENSE-2.0 + *=20 + * Unless required by applicable law or agreed to in writing, software=20 + * distributed under the License is distributed on an "AS IS" BASIS,=20 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied= .=20 + * See the License for the specific language governing permissions and=20 + * limitations under the License. + */ + +package org.apache.jdo.jdoql.tree; + +import java.util.List; +import java.util.Map; + +/** + * Instances of classes implementing this interface + * represent the root of a query tree. + * You can use these intances to factorize this node's children, as there = are + * candidate class, declarations, filter expression and + * ordering expressions as children. + * + * @author Michael Watzek + */ +public interface QueryTree extends ExpressionFactory, Node +{ + /** + * Sets the candidate class for this query tree. + * @param clazz the candidate class + */ + public void setCandidateClass(Class clazz); + + /** + * Declares a parameter for this query tree. + * Once you have declared a parameter, you can access it using method + * newIdentifier. + * @param type the instance of a Java class which is the type of the d= eclared parameter + * @param parameter the name of the declared parameter + */ + public void declareParameter(Class type, String parameter); + + /** + * Declares a variable for this query tree. + * Once you have declared a variable, you can access it using method + * newIdentifier. + * @param type the instance of a Java class which is the type of the d= eclared variable + * @param variable the name of the declared variable + */ + public void declareVariable(Class type, String variable); + + /** + * Sets the filter expression for this query tree. + * @param filter the filter expression + */ + public void setFilter(Expression filter); + + /** + * Adds an ascending ordering expression to this query tree. + * The order of adding ascending and descending ordering expressions d= efines + * the order of instances in the result collection of an executed query + * instance corresponding with this query tree. + * @param expression the order expression + */ + public void addAscendingOrdering(Expression expression); + + /** + * Adds an descending ordering expression to this query tree. + * The order of adding ascending and descending ordering expressions d= efines + * the order of instances in the result collection of an executed query + * instance corresponding with this query tree. + * @param expression the order expression + */ + public void addDescendingOrdering(Expression expression); + + /** + * Returns the candidate class. + * @return the candidate class + */ + public Class getCandidateClass(); + + + /** + * Returns a map containing all declared parameters. + * This map contains parameter names as keys and instances of + * ParameterDeclaration as values. + * @return the map of declared parameters + */ + public Map getDeclaredParameters(); + /** + * Returns a map containing all declared variables. + * This map contains variable names as keys and instances of + * VariableDeclaration as values. + * @return the map of declared variables + */ + public Map getDeclaredVariables(); + + /** + * Returns a list of all declared parameters. The order of entries is + * defined by the order of calls declareParameter. + * This list contains instances of + * ParametersDeclaration as entries. + * @return the list of declared parameters + */ + public List getDeclaredParametersAsList(); + + /** + * Returns the filter expression of this query tree. + * @return the filter or null. + */ + public Expression getFilter(); + + /** + * Returns a list of all added ordering expressions. + * The order of entries is defined by the order of calls + * addAscendingOrdering and addDescendingOrdering. + * This list contains instances of + * OrderingExpression as entries. + * @return the list of declared parameters + */ + public List getOrderingExpressions(); +} Added: incubator/jdo/trunk/ri11/src/java/org/apache/jdo/jdoql/tree/ShortLit= eralExpression.java URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/ri11/src/java/org/ap= ache/jdo/jdoql/tree/ShortLiteralExpression.java?view=3Dauto&rev=3D158176 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- incubator/jdo/trunk/ri11/src/java/org/apache/jdo/jdoql/tree/ShortLitera= lExpression.java (added) +++ incubator/jdo/trunk/ri11/src/java/org/apache/jdo/jdoql/tree/ShortLitera= lExpression.java Fri Mar 18 17:02:29 2005 @@ -0,0 +1,31 @@ +/* + * Copyright 2005 The Apache Software Foundation. + *=20 + * Licensed 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=20 + *=20 + * http://www.apache.org/licenses/LICENSE-2.0 + *=20 + * Unless required by applicable law or agreed to in writing, software=20 + * distributed under the License is distributed on an "AS IS" BASIS,=20 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied= .=20 + * See the License for the specific language governing permissions and=20 + * limitations under the License. + */ + +package org.apache.jdo.jdoql.tree; + +/** + * This node represents a short literal. It does not have any children. + * + * @author Michael Watzek + */ +public interface ShortLiteralExpression extends ConstantExpression +{ + /** + * Returns the short value represented by this expression. + * @return the short value + */ + public short getShort(); +} Added: incubator/jdo/trunk/ri11/src/java/org/apache/jdo/jdoql/tree/StartsWi= thCallExpression.java URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/ri11/src/java/org/ap= ache/jdo/jdoql/tree/StartsWithCallExpression.java?view=3Dauto&rev=3D158176 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- incubator/jdo/trunk/ri11/src/java/org/apache/jdo/jdoql/tree/StartsWithC= allExpression.java (added) +++ incubator/jdo/trunk/ri11/src/java/org/apache/jdo/jdoql/tree/StartsWithC= allExpression.java Fri Mar 18 17:02:29 2005 @@ -0,0 +1,29 @@ +/* + * Copyright 2005 The Apache Software Foundation. + *=20 + * Licensed 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=20 + *=20 + * http://www.apache.org/licenses/LICENSE-2.0 + *=20 + * Unless required by applicable law or agreed to in writing, software=20 + * distributed under the License is distributed on an "AS IS" BASIS,=20 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied= .=20 + * See the License for the specific language governing permissions and=20 + * limitations under the License. + */ + +package org.apache.jdo.jdoql.tree; + +/** + * This node represents the method call expression + * String.startsWith. Children of this node are a target + * expression (e.g. a FieldAccessExpression) and the method + * argument which is an arbitrary expression. + * + * @author Michael Watzek + */ +public interface StartsWithCallExpression extends MethodCallExpression +{ +} Added: incubator/jdo/trunk/ri11/src/java/org/apache/jdo/jdoql/tree/StaticFi= eldAccessExpression.java URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/ri11/src/java/org/ap= ache/jdo/jdoql/tree/StaticFieldAccessExpression.java?view=3Dauto&rev=3D1581= 76 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- incubator/jdo/trunk/ri11/src/java/org/apache/jdo/jdoql/tree/StaticField= AccessExpression.java (added) +++ incubator/jdo/trunk/ri11/src/java/org/apache/jdo/jdoql/tree/StaticField= AccessExpression.java Fri Mar 18 17:02:29 2005 @@ -0,0 +1,43 @@ +/* + * Copyright 2005 The Apache Software Foundation. + *=20 + * Licensed 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=20 + *=20 + * http://www.apache.org/licenses/LICENSE-2.0 + *=20 + * Unless required by applicable law or agreed to in writing, software=20 + * distributed under the License is distributed on an "AS IS" BASIS,=20 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied= .=20 + * See the License for the specific language governing permissions and=20 + * limitations under the License. + */ + +package org.apache.jdo.jdoql.tree; + +import javax.jdo.PersistenceManager; + +import org.apache.jdo.jdoql.JDOQueryException; + +/** + * This node represents a static field access expression. + * It inherits from IdentifierExpression. + * Static Field access expressions have exactly one child, the type of the= clazz + * containing the static field. + * + * @author Michael Watzek + */ +public interface StaticFieldAccessExpression extends IdentifierExpression +{ + /** + * Returns the value of the field corresponding with this static + * field access expression. + * @param pm the persistence manager of the query + * @return the field value + * @exception JDOQueryException if access to the corresponding field o= f this + * expression is denied + */ + public Object getFieldValue(PersistenceManager pm); +} + Added: incubator/jdo/trunk/ri11/src/java/org/apache/jdo/jdoql/tree/ThisExpr= ession.java URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/ri11/src/java/org/ap= ache/jdo/jdoql/tree/ThisExpression.java?view=3Dauto&rev=3D158176 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- incubator/jdo/trunk/ri11/src/java/org/apache/jdo/jdoql/tree/ThisExpress= ion.java (added) +++ incubator/jdo/trunk/ri11/src/java/org/apache/jdo/jdoql/tree/ThisExpress= ion.java Fri Mar 18 17:02:29 2005 @@ -0,0 +1,27 @@ +/* + * Copyright 2005 The Apache Software Foundation. + *=20 + * Licensed 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=20 + *=20 + * http://www.apache.org/licenses/LICENSE-2.0 + *=20 + * Unless required by applicable law or agreed to in writing, software=20 + * distributed under the License is distributed on an "AS IS" BASIS,=20 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied= .=20 + * See the License for the specific language governing permissions and=20 + * limitations under the License. + */ + +package org.apache.jdo.jdoql.tree; + +/** + * This node represents an access to this. + * It does not have any children. + * + * @author Michael Watzek + */ +public interface ThisExpression extends IdentifierExpression +{ +} Added: incubator/jdo/trunk/ri11/src/java/org/apache/jdo/jdoql/tree/TimesExp= ression.java URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/ri11/src/java/org/ap= ache/jdo/jdoql/tree/TimesExpression.java?view=3Dauto&rev=3D158176 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- incubator/jdo/trunk/ri11/src/java/org/apache/jdo/jdoql/tree/TimesExpres= sion.java (added) +++ incubator/jdo/trunk/ri11/src/java/org/apache/jdo/jdoql/tree/TimesExpres= sion.java Fri Mar 18 17:02:29 2005 @@ -0,0 +1,28 @@ +/* + * Copyright 2005 The Apache Software Foundation. + *=20 + * Licensed 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=20 + *=20 + * http://www.apache.org/licenses/LICENSE-2.0 + *=20 + * Unless required by applicable law or agreed to in writing, software=20 + * distributed under the License is distributed on an "AS IS" BASIS,=20 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied= .=20 + * See the License for the specific language governing permissions and=20 + * limitations under the License. + */ + +package org.apache.jdo.jdoql.tree; + +/** + * This node represents a times operator. + * A times operator is a binary expression. + * The string representation of this operator is *. + * + * @author Michael Watzek + */ +public interface TimesExpression extends BinaryExpression +{ +} Added: incubator/jdo/trunk/ri11/src/java/org/apache/jdo/jdoql/tree/TreeWalk= er.java URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/ri11/src/java/org/ap= ache/jdo/jdoql/tree/TreeWalker.java?view=3Dauto&rev=3D158176 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- incubator/jdo/trunk/ri11/src/java/org/apache/jdo/jdoql/tree/TreeWalker.= java (added) +++ incubator/jdo/trunk/ri11/src/java/org/apache/jdo/jdoql/tree/TreeWalker.= java Fri Mar 18 17:02:29 2005 @@ -0,0 +1,69 @@ +/* + * Copyright 2005 The Apache Software Foundation. + *=20 + * Licensed 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=20 + *=20 + * http://www.apache.org/licenses/LICENSE-2.0 + *=20 + * Unless required by applicable law or agreed to in writing, software=20 + * distributed under the License is distributed on an "AS IS" BASIS,=20 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied= .=20 + * See the License for the specific language governing permissions and=20 + * limitations under the License. + */ + +package org.apache.jdo.jdoql.tree; + +/** + * An instance of this class is used to walk any query node. It provides + * a walk method which takes a node and a node visitor as arguments. It de= legates + * to methods Node.arrive, Node.leave/code> and + * Node.walkNextChild. Node implementations are required + * to delegate these calls to corresponding methods of the supplied node + * visitor. + * + * @author Michael Watzek + */ +public final class TreeWalker +{ + /** + * Walks the tree specified by the argument node + * implementing a depth first algorithm. + * Executes the visitor instance callback arrive + * when starting to walk the argument node. + * Subsequently iterates that node's children and + * executes the visitor instance callback walkNextChild + * before the current child is walked. For the case that + * walkNextChild returns true, + * this tree walker walkes the next child. + * Otherwise, the next child and all remaining childs are not walked. + * In both cases, this tree walker + * executes the visitor instance callback leave indicating + * that the argument node and its children have been walk= ed. + * The result of leave is returned. + * when starting to traverse a node. + * @param node the tree instance + * @param visitor the node visitor instance + * @return the object returned by the visitor instance callback = leave + */ + public Object walk(Node node, NodeVisitor visitor) + { + if( node!=3Dnull ) + { node.arrive( visitor ); + Object[] results =3D null; + Node[] children =3D node.getChildren(); + if( children!=3Dnull ) + { results =3D new Object[children.length]; + for( int i=3D0; ijav= a=2Elang.Class + * instance which has been supplied by the application. The following nodes + * have type instances as children: + *
  • CandidateClass + *
  • CastExpression + *
  • Declaration + * The result type of a type instance is the wrapped java.lang.Class= + * instance. Type instances are not visible in query tree factory methods = and + * expression factory methods. They are internally created by in implement= ation + * and are walked by a node visitor. + * + * @author Michael Watzek + */ +public interface Type extends Node +{ + /** + * Returns the string representation of the Java class, + * which is wrapped by this instance. + * @return the Java type name + */ + public String getTypeName(); +} Added: incubator/jdo/trunk/ri11/src/java/org/apache/jdo/jdoql/tree/UnaryExp= ression.java URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/ri11/src/java/org/ap= ache/jdo/jdoql/tree/UnaryExpression.java?view=3Dauto&rev=3D158176 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- incubator/jdo/trunk/ri11/src/java/org/apache/jdo/jdoql/tree/UnaryExpres= sion.java (added) +++ incubator/jdo/trunk/ri11/src/java/org/apache/jdo/jdoql/tree/UnaryExpres= sion.java Fri Mar 18 17:02:29 2005 @@ -0,0 +1,33 @@ +/* + * Copyright 2005 The Apache Software Foundation. + *=20 + * Licensed 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=20 + *=20 + * http://www.apache.org/licenses/LICENSE-2.0 + *=20 + * Unless required by applicable law or agreed to in writing, software=20 + * distributed under the License is distributed on an "AS IS" BASIS,=20 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied= .=20 + * See the License for the specific language governing permissions and=20 + * limitations under the License. + */ + +package org.apache.jdo.jdoql.tree; + +/** + * This node represents a unary operator. All unary operators have exactly + * one children. Examples of binary operators + * are ComplementExpression and NotExpression. + * + * @author Michael Watzek + */ +public interface UnaryExpression extends Expression +{ + /** + * Returns the node's expression. + * @return the node's expression + */ + public Expression getExpression(); +} Added: incubator/jdo/trunk/ri11/src/java/org/apache/jdo/jdoql/tree/UnaryMin= usExpression.java URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/ri11/src/java/org/ap= ache/jdo/jdoql/tree/UnaryMinusExpression.java?view=3Dauto&rev=3D158176 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- incubator/jdo/trunk/ri11/src/java/org/apache/jdo/jdoql/tree/UnaryMinusE= xpression.java (added) +++ incubator/jdo/trunk/ri11/src/java/org/apache/jdo/jdoql/tree/UnaryMinusE= xpression.java Fri Mar 18 17:02:29 2005 @@ -0,0 +1,28 @@ +/* + * Copyright 2005 The Apache Software Foundation. + *=20 + * Licensed 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=20 + *=20 + * http://www.apache.org/licenses/LICENSE-2.0 + *=20 + * Unless required by applicable law or agreed to in writing, software=20 + * distributed under the License is distributed on an "AS IS" BASIS,=20 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied= .=20 + * See the License for the specific language governing permissions and=20 + * limitations under the License. + */ + +package org.apache.jdo.jdoql.tree; + +/** + * This node represents a unary minus operator. + * The string representation of this operator is -. + * + * @author Michael Watzek + */ +public interface UnaryMinusExpression extends UnaryExpression +{ +} + Added: incubator/jdo/trunk/ri11/src/java/org/apache/jdo/jdoql/tree/UnaryPlu= sExpression.java URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/ri11/src/java/org/ap= ache/jdo/jdoql/tree/UnaryPlusExpression.java?view=3Dauto&rev=3D158176 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- incubator/jdo/trunk/ri11/src/java/org/apache/jdo/jdoql/tree/UnaryPlusEx= pression.java (added) +++ incubator/jdo/trunk/ri11/src/java/org/apache/jdo/jdoql/tree/UnaryPlusEx= pression.java Fri Mar 18 17:02:29 2005 @@ -0,0 +1,28 @@ +/* + * Copyright 2005 The Apache Software Foundation. + *=20 + * Licensed 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=20 + *=20 + * http://www.apache.org/licenses/LICENSE-2.0 + *=20 + * Unless required by applicable law or agreed to in writing, software=20 + * distributed under the License is distributed on an "AS IS" BASIS,=20 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied= .=20 + * See the License for the specific language governing permissions and=20 + * limitations under the License. + */ + +package org.apache.jdo.jdoql.tree; + +/** + * This node represents a unary plus operator. + * The string representation of this operator is +. + * + * @author Michael Watzek + */ +public interface UnaryPlusExpression extends UnaryExpression +{ +} + Added: incubator/jdo/trunk/ri11/src/java/org/apache/jdo/jdoql/tree/ValueTab= le.java URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/ri11/src/java/org/ap= ache/jdo/jdoql/tree/ValueTable.java?view=3Dauto&rev=3D158176 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- incubator/jdo/trunk/ri11/src/java/org/apache/jdo/jdoql/tree/ValueTable.= java (added) +++ incubator/jdo/trunk/ri11/src/java/org/apache/jdo/jdoql/tree/ValueTable.= java Fri Mar 18 17:02:29 2005 @@ -0,0 +1,63 @@ +/* + * Copyright 2005 The Apache Software Foundation. + *=20 + * Licensed 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=20 + *=20 + * http://www.apache.org/licenses/LICENSE-2.0 + *=20 + * Unless required by applicable law or agreed to in writing, software=20 + * distributed under the License is distributed on an "AS IS" BASIS,=20 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied= .=20 + * See the License for the specific language governing permissions and=20 + * limitations under the License. + */ + +package org.apache.jdo.jdoql.tree; + +/** + * A ValueTable manages values for declared identifiers (such as variables=20 + * or parameters) of a query. It provides methods to declare an identifier= ,=20 + * to set and get its value and check a value to be compaitible with the=20 + * identifier's type. + * + * @author Michael Bouschen + */ +public interface ValueTable +{ + /** + * This method declares an identifier. The methods takes the name of t= he=20 + * declared identifier from the specified declaration node. + * @param decl the declaration node + */ + public void declare(Declaration decl); + + /** + * Sets the value of the specified identifier for later retrieval usin= g=20 + * method {@link #getValue}). The identifier must be declared (see met= hod=20 + * {@link #declare}) prior to a call of this method. + * @param name the name of the identifier + * @param value the new value of the identifier + */ + public void setValue(String name, Object value); + + =20 + /** + * Returns the current value of the specified identifier. The identifi= er=20 + * must be declared using method {@link #declare}) and its value must = be=20 + * set using method {@link #getValue}) prior to a call of this method. + * @param name the name of the identifier + * @return the current value of the identifier + */ + public Object getValue(String name); + + /** + * Checks whether the type of the specified value is compatible with t= he=20 + * type of the identifier. + * @return true if the type of the value is compatible wi= th=20 + * the type of the identifier; false otherwise + */ + public boolean isCompatibleValue(String name, Object value); +} + Added: incubator/jdo/trunk/ri11/src/java/org/apache/jdo/jdoql/tree/Variable= AccessExpression.java URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/ri11/src/java/org/ap= ache/jdo/jdoql/tree/VariableAccessExpression.java?view=3Dauto&rev=3D158176 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- incubator/jdo/trunk/ri11/src/java/org/apache/jdo/jdoql/tree/VariableAcc= essExpression.java (added) +++ incubator/jdo/trunk/ri11/src/java/org/apache/jdo/jdoql/tree/VariableAcc= essExpression.java Fri Mar 18 17:02:29 2005 @@ -0,0 +1,27 @@ +/* + * Copyright 2005 The Apache Software Foundation. + *=20 + * Licensed 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=20 + *=20 + * http://www.apache.org/licenses/LICENSE-2.0 + *=20 + * Unless required by applicable law or agreed to in writing, software=20 + * distributed under the License is distributed on an "AS IS" BASIS,=20 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied= .=20 + * See the License for the specific language governing permissions and=20 + * limitations under the License. + */ + +package org.apache.jdo.jdoql.tree; + +/** + * This node represents a variable access expression. + * It does not have any children. + * + * @author Michael Watzek + */ +public interface VariableAccessExpression extends IdentifierExpression +{ +} Added: incubator/jdo/trunk/ri11/src/java/org/apache/jdo/jdoql/tree/Variable= Declaration.java URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/ri11/src/java/org/ap= ache/jdo/jdoql/tree/VariableDeclaration.java?view=3Dauto&rev=3D158176 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- incubator/jdo/trunk/ri11/src/java/org/apache/jdo/jdoql/tree/VariableDec= laration.java (added) +++ incubator/jdo/trunk/ri11/src/java/org/apache/jdo/jdoql/tree/VariableDec= laration.java Fri Mar 18 17:02:29 2005 @@ -0,0 +1,27 @@ +/* + * Copyright 2005 The Apache Software Foundation. + *=20 + * Licensed 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=20 + *=20 + * http://www.apache.org/licenses/LICENSE-2.0 + *=20 + * Unless required by applicable law or agreed to in writing, software=20 + * distributed under the License is distributed on an "AS IS" BASIS,=20 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied= .=20 + * See the License for the specific language governing permissions and=20 + * limitations under the License. + */ + +package org.apache.jdo.jdoql.tree; + +/** + * This node represents a variable declaration. + * It does not have any children. + * + * @author Michael Watzek + */ +public interface VariableDeclaration extends Declaration +{ +} Added: incubator/jdo/trunk/ri11/src/java/org/apache/jdo/jdoql/tree/package.= html URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/ri11/src/java/org/ap= ache/jdo/jdoql/tree/package.html?view=3Dauto&rev=3D158176 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- incubator/jdo/trunk/ri11/src/java/org/apache/jdo/jdoql/tree/package.htm= l (added) +++ incubator/jdo/trunk/ri11/src/java/org/apache/jdo/jdoql/tree/package.htm= l Fri Mar 18 17:02:29 2005 @@ -0,0 +1,26 @@ + + + + +Package org.apache.jdo.jdoql.tree + + + + +

    This package contains the query tree node interfaces, the node visitor = interface and the tree walker.

    + + Added: incubator/jdo/trunk/ri11/src/java/org/apache/jdo/model/Bundle.proper= ties URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/ri11/src/java/org/ap= ache/jdo/model/Bundle.properties?view=3Dauto&rev=3D158176 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- incubator/jdo/trunk/ri11/src/java/org/apache/jdo/model/Bundle.propertie= s (added) +++ incubator/jdo/trunk/ri11/src/java/org/apache/jdo/model/Bundle.propertie= s Fri Mar 18 17:02:29 2005 @@ -0,0 +1,33 @@ +# +# Copyright 2005 The Apache Software Foundation. +#=20 +# Licensed 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=20 +#=20 +# http://www.apache.org/licenses/LICENSE-2.0 +#=20 +# Unless required by applicable law or agreed to in writing, software=20 +# distributed under the License is distributed on an "AS IS" BASIS,=20 +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.=20 +# See the License for the specific language governing permissions and=20 +# limitations under the License. + +# This file should conform to netbeans standards +# (http://www.netbeans.org/i18n) + +# resource bundle for the messages +# key consists of: +# - any valid prefix like MSG_, EXC_, etc. +# - short description started with the upper case letter and= used +# upper case to represent each next word. + +# ResourceBundle properties file for model + +MSG_OffendingObject=3DOffendingObject: +MSG_CauseThrowable=3DCauseThrowable: +MSG_CauseThrowableStackTrace=3DCauseThrowableStackTrace: + +# General validation messages +# Validation warning prefix (prepended to some of the messages below) +MSG_ValidationWarning=3DWarning:=20 Added: incubator/jdo/trunk/ri11/src/java/org/apache/jdo/model/ModelExceptio= n=2Ejava URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/ri11/src/java/org/ap= ache/jdo/model/ModelException.java?view=3Dauto&rev=3D158176 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- incubator/jdo/trunk/ri11/src/java/org/apache/jdo/model/ModelException.j= ava (added) +++ incubator/jdo/trunk/ri11/src/java/org/apache/jdo/model/ModelException.j= ava Fri Mar 18 17:02:29 2005 @@ -0,0 +1,190 @@ +/* + * Copyright 2005 The Apache Software Foundation. + *=20 + * Licensed 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=20 + *=20 + * http://www.apache.org/licenses/LICENSE-2.0 + *=20 + * Unless required by applicable law or agreed to in writing, software=20 + * distributed under the License is distributed on an "AS IS" BASIS,=20 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied= .=20 + * See the License for the specific language governing permissions and=20 + * limitations under the License. + */ + +package org.apache.jdo.model; + +import org.apache.jdo.util.I18NHelper; + +/** + * This exception indicates a Model problem. It is the root for all + * checked model exceptions. + * + * @author Michael Bouschen + * @since JDO 1.0.1 + */ +public class ModelException=20 + extends Exception +{ + /** The throwable that caused this model exception to be thrown. */ + private Throwable cause; + =20 + /** Flag indicating whether printStackTrace is being executed. */ + private boolean inPrintStackTrace =3D false; + + /** I18N support */ + private static I18NHelper msg =3D=20 + I18NHelper.getInstance(ModelException.class); + + /** + * Creates new ModelException without detail message. + */ + public ModelException()=20 + { + } + =20 + /** + * Constructs a ModelException with the specified detail + * message. + * @param message the detail message. + */ + public ModelException(String message) + { + super(message); + } + + /**=20 + * Constructs a new ModelException with the specified=20 + * detail message and cause. + * @param message the detail message. + * @param cause the cause (which is saved for later retrieval by the + * {@link #getCause()} method). (A null value is permitted, and + * indicates that the cause is nonexistent or unknown.)=20 + */ + public ModelException(String message, Throwable cause)=20 + { + super(message); + this.cause =3D cause; + } + + /**=20 + * Returns the cause of this throwable or null if the cause is + * nonexistent or unknown. (The cause is the throwable that caused thi= s=20 + * throwable to get thrown.)=20 + * @return the cause of this throwable or null if the cause is + * nonexistent or unknown.=20 + */ + public synchronized Throwable getCause()=20 + { + // super.printStackTrace calls getCause to handle the cause.=20 + // Returning null prevents the superclass from handling the cause; + // instead the local implementation of printStackTrace should + // handle the cause. Otherwise, the cause is printed twice. + return inPrintStackTrace ? null : cause; + } + + /** + * Initializes the cause of this throwable to the specified value. (The + * cause is the throwable that caused this throwable to get thrown.)=20 + * @param cause the cause (which is saved for later retrieval by the + * {@link #getCause()} method). (A null value is permitted, and + * indicates that the cause is nonexistent or unknown.) + * @return a reference to this ModelException instance. + */ + public Throwable initCause(Throwable cause) + { + this.cause =3D cause; + return this; + } + =20 + /** + * Returns the error message string of this throwable object. + * @return the error message string of this ModelException + * object if it was created with an error message string, the error=20 + * message of the cause if it was not created a message but the cause + * has a message, or null if neither has an error message= .=20 + */ + public String getMessage() + { + String message =3D super.getMessage(); + if ((message =3D=3D null) || (message.length() =3D=3D 0)) { + // Get the message of the cause Throwable, if this + // ModelException does not have a message + if (cause !=3D null) + message =3D cause.getMessage(); + } + return message; + } + + /**=20 + * The String representation includes the name of the cla= ss, + * the descriptive comment (if any), + * and the String representation of the cause (if any). + * @return the String. + */ + public synchronized String toString()=20 + { + StringBuffer sb =3D new StringBuffer(); + sb.append(super.toString()); + // Do not include cause information, if called by printStackTrace:=20 + // the stacktrace will include the cause anyway. + if ((cause !=3D null) && !inPrintStackTrace) { + sb.append("\n"); //NOI18N + sb.append(msg.msg("MSG_CauseThrowable")); //NOI18N + sb.append("\n"); //NOI18N + sb.append(cause.toString()); //NOI18N + } + return sb.toString(); + } + =20 + /** + * Prints this ModelException and its backtrace to the=20 + * standard error output. + * Print cause Throwable's stack trace as well. + */ + public void printStackTrace() + { + printStackTrace(System.err); + } + + /** + * Prints this ModelException and its backtrace to the=20 + * specified print stream. + * Print cause Throwable's stack trace as well. + * @param s PrintStream to use for output + */ + public synchronized void printStackTrace(java.io.PrintStream s)=20 + {=20 + synchronized (s) { + inPrintStackTrace =3D true; + super.printStackTrace(s); + if (cause !=3D null) { + s.println(msg.msg("MSG_CauseThrowableStackTrace")); //NOI1= 8N + cause.printStackTrace(s); + } + inPrintStackTrace =3D false; + } + } + =20 + /** + * Prints this ModelException and its backtrace to the sp= ecified + * print writer. + * Print cause Throwable' stack trace as well. + * @param s PrintWriter to use for output + */ + public synchronized void printStackTrace(java.io.PrintWriter s)=20 + {=20 + synchronized (s) { + inPrintStackTrace =3D true; + super.printStackTrace(s); + if (cause !=3D null) { + s.println(msg.msg("MSG_CauseThrowableStackTrace")); //NOI1= 8N + cause.printStackTrace(s); + } + inPrintStackTrace =3D false; + } + } + =20 +} Added: incubator/jdo/trunk/ri11/src/java/org/apache/jdo/model/ModelFatalExc= eption.java URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/ri11/src/java/org/ap= ache/jdo/model/ModelFatalException.java?view=3Dauto&rev=3D158176 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- incubator/jdo/trunk/ri11/src/java/org/apache/jdo/model/ModelFatalExcept= ion.java (added) +++ incubator/jdo/trunk/ri11/src/java/org/apache/jdo/model/ModelFatalExcept= ion.java Fri Mar 18 17:02:29 2005 @@ -0,0 +1,191 @@ +/* + * Copyright 2005 The Apache Software Foundation. + *=20 + * Licensed 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=20 + *=20 + * http://www.apache.org/licenses/LICENSE-2.0 + *=20 + * Unless required by applicable law or agreed to in writing, software=20 + * distributed under the License is distributed on an "AS IS" BASIS,=20 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied= .=20 + * See the License for the specific language governing permissions and=20 + * limitations under the License. + */ + +package org.apache.jdo.model; + +import org.apache.jdo.util.I18NHelper; + +/** + * This exception indicates a fatal Model problem. Note this is an + * unchecked exception. + * + * @author Michael Bouschen + * @since JDO 1.0.1 + */ +public class ModelFatalException=20 + extends RuntimeException +{ + /** The throwable that caused this model exception to be thrown. */ + private Throwable cause; + =20 + /** Flag indicating whether printStackTrace is being executed. */ + private boolean inPrintStackTrace =3D false; + + /** I18N support */ + private static I18NHelper msg =3D=20 + I18NHelper.getInstance(ModelFatalException.class); + + /** + * Creates new ModelFatalException without detail + * message.=20 + */ + public ModelFatalException()=20 + { + } + =20 + /** + * Constructs a ModelFatalException with the specified + * detail message. + * @param message the detail message. + */ + public ModelFatalException(String message) + { + super(message); + } + + /**=20 + * Constructs a new ModelFatalException with the specifie= d=20 + * detail message and cause Exception. + * @param message the detail message. + * @param cause the cause (which is saved for later retrieval by the + * {@link #getCause()} method). (A null value is permitted, and + * indicates that the cause is nonexistent or unknown.)=20 + */ + public ModelFatalException(String message, Throwable cause)=20 + { + super(message); + this.cause =3D cause; + } + + /**=20 + * Returns the cause of this throwable or null if the cause is + * nonexistent or unknown. (The cause is the throwable that caused thi= s=20 + * throwable to get thrown.)=20 + * @return the cause of this throwable or null if the cause is + * nonexistent or unknown.=20 + */ + public Throwable getCause()=20 + { + // super.printStackTrace calls getCause to handle the cause.=20 + // Returning null prevents the superclass from handling the cause; + // instead the local implementation of printStackTrace should + // handle the cause. Otherwise, the cause is printed twice. + return inPrintStackTrace ? null : cause; + } + + /** + * Initializes the cause of this throwable to the specified value. (The + * cause is the throwable that caused this throwable to get thrown.)=20 + * @param cause the cause (which is saved for later retrieval by the + * {@link #getCause()} method). (A null value is permitted, and + * indicates that the cause is nonexistent or unknown.) + * @return a reference to this ModelFatalException instan= ce. + */ + public Throwable initCause(Throwable cause) + { + this.cause =3D cause; + return this; + } + =20 + /** + * Returns the error message string of this throwable object. + * @return the error message string of this ModelException + * object if it was created with an error message string, the error=20 + * message of the cause if it was not created a message but the cause + * has a message, or null if neither has an error message= .=20 + */ + public String getMessage() + { + String message =3D super.getMessage(); + if ((message =3D=3D null) || (message.length() =3D=3D 0)) { + // Get the message of the cause Throwable, if this + // ModelException does not have a message + if (cause !=3D null) + message =3D cause.getMessage(); + } + return message; + } + + /**=20 + * The String representation includes the name of the cla= ss, + * the descriptive comment (if any), + * and the String representation of the cause (if any). + * @return the String. + */ + public synchronized String toString()=20 + { + StringBuffer sb =3D new StringBuffer(); + sb.append(super.toString()); + // Do not include cause information, if called by printStackTrace:=20 + // the stacktrace will include the cause anyway. + if ((cause !=3D null) && !inPrintStackTrace) { + sb.append("\n"); //NOI18N + sb.append(msg.msg("MSG_CauseThrowable")); //NOI18N + sb.append("\n"); //NOI18N + sb.append(cause.toString()); //NOI18N + } + return sb.toString(); + } + =20 + /** + * Prints this ModelFatalException and its backtrace to t= he=20 + * standard error output. + * Print cause Throwable's stack trace as well. + */ + public void printStackTrace() + { + printStackTrace(System.err); + } + + /** + * Prints this ModelFatalException and its backtrace to t= he=20 + * specified print stream. + * Print cause Throwable's stack trace as well. + * @param s PrintStream to use for output + */ + public synchronized void printStackTrace(java.io.PrintStream s)=20 + {=20 + synchronized (s) { + inPrintStackTrace =3D true; + super.printStackTrace(s); + if (cause !=3D null) { + s.println(msg.msg("MSG_CauseThrowableStackTrace")); //NOI1= 8N + cause.printStackTrace(s); + } + inPrintStackTrace =3D false; + } + } + =20 + /** + * Prints this ModelFatalException and its backtrace to t= he specified + * print writer. + * Print cause Throwable' stack trace as well. + * @param s PrintWriter to use for output + */ + public void printStackTrace(java.io.PrintWriter s)=20 + {=20 + synchronized (s) { + inPrintStackTrace =3D true; + super.printStackTrace(s); + if (cause !=3D null) { + s.println(msg.msg("MSG_CauseThrowableStackTrace")); //NOI1= 8N + cause.printStackTrace(s); + } + inPrintStackTrace =3D false; + } + } + =20 +} Added: incubator/jdo/trunk/ri11/src/java/org/apache/jdo/model/ModelValidati= onException.java URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/ri11/src/java/org/ap= ache/jdo/model/ModelValidationException.java?view=3Dauto&rev=3D158176 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- incubator/jdo/trunk/ri11/src/java/org/apache/jdo/model/ModelValidationE= xception.java (added) +++ incubator/jdo/trunk/ri11/src/java/org/apache/jdo/model/ModelValidationE= xception.java Fri Mar 18 17:02:29 2005 @@ -0,0 +1,163 @@ +/* + * Copyright 2005 The Apache Software Foundation. + *=20 + * Licensed 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=20 + *=20 + * http://www.apache.org/licenses/LICENSE-2.0 + *=20 + * Unless required by applicable law or agreed to in writing, software=20 + * distributed under the License is distributed on an "AS IS" BASIS,=20 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied= .=20 + * See the License for the specific language governing permissions and=20 + * limitations under the License. + */ + +package org.apache.jdo.model; + +import org.apache.jdo.util.I18NHelper; + +/** + * This exception indicates a problem during model validation. + * + * @author Michael Bouschen + * @since JDO 1.0.1 + */ +public class ModelValidationException=20 + extends ModelException +{ + /** Constant representing an error. */ + public static final int ERROR =3D 0; + + /** Constant representing a warning. */ + public static final int WARNING =3D 1; + + /**=20 + * This field holds the type -- one of {@link #ERROR} or {@link #WARNI= NG} + */ + private int type; + + /**=20 + * This field holds the offending object -- the one being validated=20 + * when the problem occurred + */ + private Object offendingObject; + + /** I18N support */ + private static I18NHelper msg =3D=20 + I18NHelper.getInstance(ModelValidationException.class); + + /** + * Creates new ModelValidationException of type=20 + * {@link #ERROR} with null as the offending object and + * no detail message. + */ + public ModelValidationException()=20 + { + this(ERROR, null, null);=20 + } + =20 + /** + * Constructs a ModelValidationException of type=20 + * {@link #ERROR} with null as the offending object and + * with the specified detail message.=20 + * @param message the detail message. + */ + public ModelValidationException(String message) + { + this(ERROR, null, message); + } + + /** + * Constructs a ModelValidationException of type=20 + * {@link #ERROR} with the specified offending object and no=20 + * detail message. + * @param offendingObject the offending object. + */ + public ModelValidationException (Object offendingObject) + { + this(ERROR, offendingObject, null); + } + + /** + * Constructs a ModelValidationException of type=20 + * {@link #ERROR} with the specified offending object and detail + * message . + * @param offendingObject the offending object. + * @param message the detail message. + */ + public ModelValidationException (Object offendingObject, String message) + { + this(ERROR, offendingObject, message); + } + + /** + * Constructs a ModelValidationException of the specified=20 + * type with the specified detail message and offending object.=20 + * @param errorType the type -- one of {@link #ERROR} or=20 + * {@link #WARNING}.=20 + * @param offendingObject the offending object. + * @param message the detail message. + */ + public ModelValidationException(int errorType, Object offendingObject, + String message) + { + super(message); + this.type =3D errorType; + this.offendingObject =3D offendingObject; + } + + /** + * Get the offending object -- the one being validated when the problem=20 + * occurred. + */ + public Object getOffendingObject ()=20 + {=20 + return offendingObject;=20 + } + + /** + * Get the type -- one of {@link #ERROR} or {@link #WARNING}. + */ + public int getType()=20 + {=20 + return type;=20 + } + + /** + * Returns the error message string of this throwable object. + * @return the error message string of this=20 + * ModelValidationException, prepended with the warning strin= g=20 + * if the type is {@link #WARNING} + * + */ + public String getMessage () + { + String message =3D super.getMessage(); + if ((WARNING =3D=3D getType()) &&=20 + (message !=3D null) && (message.length() > 0)) { + message =3D msg.msg("MSG_OffendingObject") + message; //NOI18N + } + return message; + } + /**=20 + * The String representation includes the name of the cla= ss, + * the descriptive comment (if any), + * and the String representation of the cause (if any). + * @return the String. + */ + public String toString()=20 + { + StringBuffer sb =3D new StringBuffer(); + sb.append(super.toString()); + // include offending object information + if (offendingObject !=3D null) { + sb.append("\n"); //NOI18N + sb.append(msg.msg("MSG_OffendingObject")); //NOI18N + sb.append(offendingObject.toString()); + } + return sb.toString(); + } + =20 +} Added: incubator/jdo/trunk/ri11/src/java/org/apache/jdo/model/ModelVetoExce= ption.java URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/ri11/src/java/org/ap= ache/jdo/model/ModelVetoException.java?view=3Dauto&rev=3D158176 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- incubator/jdo/trunk/ri11/src/java/org/apache/jdo/model/ModelVetoExcepti= on.java (added) +++ incubator/jdo/trunk/ri11/src/java/org/apache/jdo/model/ModelVetoExcepti= on.java Fri Mar 18 17:02:29 2005 @@ -0,0 +1,56 @@ +/* + * Copyright 2005 The Apache Software Foundation. + *=20 + * Licensed 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=20 + *=20 + * http://www.apache.org/licenses/LICENSE-2.0 + *=20 + * Unless required by applicable law or agreed to in writing, software=20 + * distributed under the License is distributed on an "AS IS" BASIS,=20 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied= .=20 + * See the License for the specific language governing permissions and=20 + * limitations under the License. + */ + +package org.apache.jdo.model; + +/** + * This exception indicates a problem during model update. + * + * @author Michael Bouschen + * @since JDO 1.0.1 + */ +public class ModelVetoException=20 + extends ModelException +{ + /** + * Creates new ModelVetoException without detail message. + */ + public ModelVetoException()=20 + { + } + =20 + /** + * Constructs a ModelVetoException with the specified + * detail message. + * @param msg the detail message. + */ + public ModelVetoException(String msg) + { + super(msg); + } + + /**=20 + * Constructs a new ModelVetoException with the specified + * detail message and cause. + * @param msg the detail message. + * @param cause the cause Throwable. + */ + public ModelVetoException(String msg, Throwable cause)=20 + { + super(msg, cause); + } + +} Added: incubator/jdo/trunk/ri11/src/java/org/apache/jdo/model/java/JavaFiel= d=2Ejava URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/ri11/src/java/org/ap= ache/jdo/model/java/JavaField.java?view=3Dauto&rev=3D158176 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- incubator/jdo/trunk/ri11/src/java/org/apache/jdo/model/java/JavaField.j= ava (added) +++ incubator/jdo/trunk/ri11/src/java/org/apache/jdo/model/java/JavaField.j= ava Fri Mar 18 17:02:29 2005 @@ -0,0 +1,85 @@ +/* + * Copyright 2005 The Apache Software Foundation. + *=20 + * Licensed 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=20 + *=20 + * http://www.apache.org/licenses/LICENSE-2.0 + *=20 + * Unless required by applicable law or agreed to in writing, software=20 + * distributed under the License is distributed on an "AS IS" BASIS,=20 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied= .=20 + * See the License for the specific language governing permissions and=20 + * limitations under the License. + */ + +package org.apache.jdo.model.java; + +import org.apache.jdo.model.jdo.JDOField; + +/** + * A JavaField instance represents a field declared by a class. It allows + * to get detailed information about the field such as name, modifiers, + * type, declaring class and the JDO meta data for the field (if + * available).=20 + *

    + * Different environments (runtime, enhancer, development) will have + * different JavaType implementations to provide answers to the various + * methods.=20 + *=20 + * @author Michael Bouschen + * @since JDO 1.0.1 + */ +public interface JavaField=20 +{ + /** + * Returns the name of the field.=20 + * @return field name + */ + public String getName(); + + /** + * Returns the Java language modifiers for the field represented by + * this JavaField, as an integer. The java.lang.reflect.Modifier class + * should be used to decode the modifiers.=20 + * @return the Java language modifiers for this JavaField + * @see java.lang.reflect.Modifier + */ + public int getModifiers(); + + /** + * Returns the JavaType representation of the field type. + * @return field type + */ + public JavaType getType(); + + /** + * Returns the JavaType instance representing the class or interface + * that declares the field represented by this JavaField instance. + * @return the JavaType instance of the declaring class. + */ + public JavaType getDeclaringClass(); =20 + + /** + * Returns the corresponding JDOField instance, if the JDOModel + * provides any JDO metadata for the field represented by this + * JavaField. If there is no corresponding JDOField representation, the + * method returns null.=20 + *

    + * A null result means the declaring class is not + * persistence capable or the field represented by this JavaField is + * not managed. Note, a non-null result does not + * necessarily mean the field is managed. The JDO metadata might define + * the persistence-modifier of this field as none. Then + * the JDOModel provides a JDOField instance which is returned by this + * method. You can call method =20 + * {@link org.apache.jdo.model.jdo.JDOField#isManaged()} on a=20 + * non-null result to verify that this JavaField + * represents a managed field.=20 + * @return the corresponding JDOField instance (if available); + * null otherwise. + */ + public JDOField getJDOField(); + +} Added: incubator/jdo/trunk/ri11/src/java/org/apache/jdo/model/java/JavaMode= l-API.jpg URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/ri11/src/java/org/ap= ache/jdo/model/java/JavaModel-API.jpg?view=3Dauto&rev=3D158176 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D Binary file - no diff available. Propchange: incubator/jdo/trunk/ri11/src/java/org/apache/jdo/model/java/Jav= aModel-API.jpg ---------------------------------------------------------------------------= --- svn:executable =3D * Propchange: incubator/jdo/trunk/ri11/src/java/org/apache/jdo/model/java/Jav= aModel-API.jpg ---------------------------------------------------------------------------= --- svn:mime-type =3D application/octet-stream Added: incubator/jdo/trunk/ri11/src/java/org/apache/jdo/model/java/JavaMode= l=2Ejava URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/ri11/src/java/org/ap= ache/jdo/model/java/JavaModel.java?view=3Dauto&rev=3D158176 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- incubator/jdo/trunk/ri11/src/java/org/apache/jdo/model/java/JavaModel.j= ava (added) +++ incubator/jdo/trunk/ri11/src/java/org/apache/jdo/model/java/JavaModel.j= ava Fri Mar 18 17:02:29 2005 @@ -0,0 +1,115 @@ +/* + * Copyright 2005 The Apache Software Foundation. + *=20 + * Licensed 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=20 + *=20 + * http://www.apache.org/licenses/LICENSE-2.0 + *=20 + * Unless required by applicable law or agreed to in writing, software=20 + * distributed under the License is distributed on an "AS IS" BASIS,=20 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied= .=20 + * See the License for the specific language governing permissions and=20 + * limitations under the License. + */ + +package org.apache.jdo.model.java; + +import java.io.InputStream; + +import org.apache.jdo.model.ModelException; +import org.apache.jdo.model.jdo.JDOModel; + + +/**=20 + * A JavaModel instance bundles a number of JavaType instances and provides + * methods to retrieve JavaType instance by their name. A type name must be + * unique must be unique within a JavaModel instance. If the JavaType + * represents a class or an interface its type name is the fully qualified + * name. The model supports multiple classes or interfaces having the same + * fully qualified name by different JavaModel instances.=20 + * + * @author Michael Bouschen + * @since JDO 1.0.1 + */ +public interface JavaModel +{ + /**=20 + * The method returns the JavaType instance for the specified type + * name. A type name is unique within one JavaModel instance. The + * method returns null if this model instance does not + * know a type with the specified name. + * @param name the name of the type + * @return a JavaType instance for the specified name or + * null if not present in this model instance. + */ + public JavaType getJavaType(String name); + + /**=20 + * The method returns the JavaType instance for the type name of the + * specified class object. This is a convenience method for=20 + * getJavaType(clazz.getName()). The major difference + * between this method and getJavaType taking a type name is that this=20 + * method is supposed to return a non-null value. The + * specified class object describes an existing type. + * @param clazz the Class instance representing the type + * @return a JavaType instance for the name of the specified class + * object. + */ + public JavaType getJavaType(Class clazz); + + /** + * Finds a resource with a given name. A resource is some data that can + * be accessed by class code in a way that is independent of the + * location of the code. The name of a resource is a "/"-separated path + * name that identifies the resource. The method method opens the + * resource for reading and returns an InputStream. It returns=20 + * null if no resource with this name is found or if the=20 + * caller doesn't have adequate privileges to get the resource. + * @param resourceName the resource name + * @return an input stream for reading the resource, or null=20 + * if the resource could not be found or if the caller doesn't have + * adequate privileges to get the resource.=20 + */ + public InputStream getInputStreamForResource(String resourceName); + + /** + * Returns the parent JavaModel instance of this JavaModel. + * @return the parent JavaModel + */ + public JavaModel getParent(); + + /** + * Set the parent JavaModel for this JavaModel. The method + * automatically adds this JavaModel to the collection of children + * of the specified parent JavaModel. + * @param parent the parent JavaModel + * @exception ModelException if impossible + */ + public void setParent(JavaModel parent) + throws ModelException; + + /** + * Returns a collection of child JavaModel instances in the form + * of an array. All instances from the returned array have this + * JavaModel instance as parent. + * @return the child JavaModel instances + */ + public JavaModel[] getChildren(); + + /** + * Returns the corresponding JDOModel instance. + * @return the corresponding JDOModel. + */ + public JDOModel getJDOModel(); + + /** + * Sets the corresponding JDOModel instance.=20 + * @param jdoModel the JDOModel instance + * @exception ModelException if impossible + */ + public void setJDOModel(JDOModel jdoModel) + throws ModelException; + +}