You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xmlbeans.apache.org by pc...@apache.org on 2004/02/17 02:06:53 UTC
cvs commit: xml-xmlbeans/v2/src/jam/org/apache/xmlbeans/impl/jam/editable EInvokable.java EConstructor.java EMethod.java
pcal 2004/02/16 17:06:53
Modified: v2/src/jam/org/apache/xmlbeans/impl/jam JConstructor.java
JMethod.java
v2/src/jam/org/apache/xmlbeans/impl/jam/editable
EConstructor.java EMethod.java
Added: v2/src/jam/org/apache/xmlbeans/impl/jam JInvokable.java
v2/src/jam/org/apache/xmlbeans/impl/jam/editable
EInvokable.java
Log:
jam: add JInvokable/EInvokable base abstractions
Revision Changes Path
1.3 +2 -15 xml-xmlbeans/v2/src/jam/org/apache/xmlbeans/impl/jam/JConstructor.java
Index: JConstructor.java
===================================================================
RCS file: /home/cvs/xml-xmlbeans/v2/src/jam/org/apache/xmlbeans/impl/jam/JConstructor.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- JConstructor.java 12 Feb 2004 20:06:09 -0000 1.2
+++ JConstructor.java 17 Feb 2004 01:06:51 -0000 1.3
@@ -16,23 +16,10 @@
package org.apache.xmlbeans.impl.jam;
/**
- * Represents a constructor of a java class.
+ * <p>Represents a constructor of a java class.</p>
*
* @author Patrick Calahan <pc...@bea.com>
*/
-public interface JConstructor extends JMember {
+public interface JConstructor extends JInvokable {
- /**
- * <p>Returns representations of the parameters taken by this
- * constructor. Returns an array of length 0 if the constructor
- * takes no parameters.</p>
- */
- public JParameter[] getParameters();
-
- /**
- * <p>Returns representations of the type of each of the exceptions
- * which can be thrown by this constructor. Returns an array of
- * length 0 if the constructor throws no exceptions.</p>
- */
- public JClass[] getExceptionTypes();
}
1.3 +1 -15 xml-xmlbeans/v2/src/jam/org/apache/xmlbeans/impl/jam/JMethod.java
Index: JMethod.java
===================================================================
RCS file: /home/cvs/xml-xmlbeans/v2/src/jam/org/apache/xmlbeans/impl/jam/JMethod.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- JMethod.java 12 Feb 2004 20:06:09 -0000 1.2
+++ JMethod.java 17 Feb 2004 01:06:51 -0000 1.3
@@ -20,21 +20,7 @@
*
* @author Patrick Calahan <pc...@bea.com>
*/
-public interface JMethod extends JMember {
-
- /**
- * <p>Returns representations of the parameters taken by this
- * method. Returns an array of length 0 if the method takes no
- * parameters.</p>
- */
- public JParameter[] getParameters();
-
- /**
- * <p>Returns representations of the type of each of the exceptions
- * which can be thrown by this method. Returns an array of length 0
- * if the method throws no exceptions.</p>
- */
- public JClass[] getExceptionTypes();
+public interface JMethod extends JInvokable {
/**
* Returns a JClass object representing the type of this methods
1.1 xml-xmlbeans/v2/src/jam/org/apache/xmlbeans/impl/jam/JInvokable.java
Index: JInvokable.java
===================================================================
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 2003 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. 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.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Apache" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache
* XMLBeans", nor may "Apache" appear in their name, without prior
* written permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED 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 APACHE SOFTWARE FOUNDATION OR
* ITS 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.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation and was
* originally based on software copyright (c) 2003 BEA Systems
* Inc., <http://www.bea.com/>. For more information on the Apache Software
* Foundation, please see <http://www.apache.org/>.
*/
package org.apache.xmlbeans.impl.jam;
/**
* <p>Base abstraction for something which can be invoked, i.e. a
* JConstructor or JMethod.</p>
*
* @author Patrick Calahan <pc...@bea.com>
*/
public abstract interface JInvokable extends JMember {
/**
* <p>Returns representations of the parameters taken by this
* method. Returns an array of length 0 if the method takes no
* parameters.</p>
*/
public JParameter[] getParameters();
/**
* <p>Returns representations of the type of each of the exceptions
* which can be thrown by this method. Returns an array of length 0
* if the method throws no exceptions.</p>
*/
public JClass[] getExceptionTypes();
}
1.3 +1 -17 xml-xmlbeans/v2/src/jam/org/apache/xmlbeans/impl/jam/editable/EConstructor.java
Index: EConstructor.java
===================================================================
RCS file: /home/cvs/xml-xmlbeans/v2/src/jam/org/apache/xmlbeans/impl/jam/editable/EConstructor.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- EConstructor.java 12 Feb 2004 20:06:10 -0000 1.2
+++ EConstructor.java 17 Feb 2004 01:06:53 -0000 1.3
@@ -23,22 +23,6 @@
*
* @author Patrick Calahan <pc...@bea.com>
*/
-public interface EConstructor extends JConstructor, EMember {
-
- public void addException(String exceptionClassName);
-
- public void addException(JClass exceptionClass);
-
- public void removeException(String exceptionClassName);
-
- public void removeException(JClass exceptionClass);
-
- public EParameter addNewParameter(String typeName, String paramName);
-
- public EParameter addNewParameter(JClass type, String paramName);
-
- public void removeParameter(EParameter parameter);
-
- public EParameter[] getEditableParameters();
+public interface EConstructor extends JConstructor, EInvokable {
}
1.3 +1 -67 xml-xmlbeans/v2/src/jam/org/apache/xmlbeans/impl/jam/editable/EMethod.java
Index: EMethod.java
===================================================================
RCS file: /home/cvs/xml-xmlbeans/v2/src/jam/org/apache/xmlbeans/impl/jam/editable/EMethod.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- EMethod.java 12 Feb 2004 20:06:11 -0000 1.2
+++ EMethod.java 17 Feb 2004 01:06:53 -0000 1.3
@@ -23,7 +23,7 @@
*
* @author Patrick Calahan <pc...@bea.com>
*/
-public interface EMethod extends JMethod, EMember {
+public interface EMethod extends JMethod, EInvokable {
/**
* <p>Sets the type of this method's return value. Null can be passed if
@@ -40,71 +40,5 @@
* calling setReturnType(jclass.getQualifiedName()).</p>
*/
public void setReturnType(JClass c);
-
- /**
- * <p>Adds a declaration of a checked exception of the given type.</p>
- *
- * @throws IllegalArgumentException if the parameter is null or is not
- * a valid class name.
- */
- public void addException(String qualifiedClassName);
-
- /**
- * <p>Adds a declaration of a checked exception of the given type.</p>
- *
- * @throws IllegalArgumentException if the parameter is null or represents
- * a class which does not extend throwable.
- */
- public void addException(JClass exceptionClass);
-
- /**
- * Removes a declaration of a checked exception of the named class. Does
- * nothing if no such declaration exists.
- *
- * @throws IllegalArgumentException if the parameter is null or is not
- * a valid class name.
- */
- public void removeException(String qualifiedClassName);
-
- /**
- * Removes a declaration of a checked exception of the given class. Does
- * nothing if no such declaration exists.
- *
- * @throws IllegalArgumentException if the parameter is null.
- */
- public void removeException(JClass exceptionClass);
-
- /**
- * Creates a new parameter on this method with the given type and name.
- *
- * @throws IllegalArgumentException if either parameter is null, if
- * the type parameter represents 'void', or if the name parameter is not a
- * valid java identifier.
- */
- public EParameter addNewParameter(JClass type, String name);
-
- /**
- * Creates a new parameter on this method with the given type and name.
- *
- * @throws IllegalArgumentException if either parameter is null, if
- * type parameter is not a valid class name, or if the name parameter is
- * not a valid java identifier.
- */
- public EParameter addNewParameter(String qualifiedTypeName, String name);
-
- /**
- * Removes the given parameter. Does nothing if the parameter is not
- * present on this method.
- *
- * @throws IllegalArgumentException if either parameter is null.
- */
- public void removeParameter(EParameter parameter);
-
- /**
- * Returns all of the parameters on this method, or an empty array if there
- * are none. This is simply a more strongly-typed version of
- * getParameters().
- */
- public EParameter[] getEditableParameters();
}
1.1 xml-xmlbeans/v2/src/jam/org/apache/xmlbeans/impl/jam/editable/EInvokable.java
Index: EInvokable.java
===================================================================
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 2003 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. 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.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Apache" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache
* XMLBeans", nor may "Apache" appear in their name, without prior
* written permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED 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 APACHE SOFTWARE FOUNDATION OR
* ITS 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.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation and was
* originally based on software copyright (c) 2003 BEA Systems
* Inc., <http://www.bea.com/>. For more information on the Apache Software
* Foundation, please see <http://www.apache.org/>.
*/
package org.apache.xmlbeans.impl.jam.editable;
import org.apache.xmlbeans.impl.jam.JClass;
import org.apache.xmlbeans.impl.jam.JInvokable;
/**
* <p>Editable representation of a member which can be invoked, i.e.
* and EMethod or an EConstructor.</p>
*
* @author Patrick Calahan <pc...@bea.com>
*/
public interface EInvokable extends JInvokable, EMember {
/**
* <p>Adds a declaration of a checked exception of the given type.</p>
*
* @throws java.lang.IllegalArgumentException if the parameter is null or is not
* a valid class name.
*/
public void addException(String qualifiedClassName);
/**
* <p>Adds a declaration of a checked exception of the given type.</p>
*
* @throws java.lang.IllegalArgumentException if the parameter is null or represents
* a class which does not extend throwable.
*/
public void addException(JClass exceptionClass);
/**
* Removes a declaration of a checked exception of the named class. Does
* nothing if no such declaration exists.
*
* @throws java.lang.IllegalArgumentException if the parameter is null or is not
* a valid class name.
*/
public void removeException(String qualifiedClassName);
/**
* Removes a declaration of a checked exception of the given class. Does
* nothing if no such declaration exists.
*
* @throws java.lang.IllegalArgumentException if the parameter is null.
*/
public void removeException(JClass exceptionClass);
/**
* Creates a new parameter on this method with the given type and name.
*
* @throws java.lang.IllegalArgumentException if either parameter is null, if
* the type parameter represents 'void', or if the name parameter is not a
* valid java identifier.
*/
public EParameter addNewParameter(JClass type, String name);
/**
* Creates a new parameter on this method with the given type and name.
*
* @throws java.lang.IllegalArgumentException if either parameter is null, if
* type parameter is not a valid class name, or if the name parameter is
* not a valid java identifier.
*/
public EParameter addNewParameter(String qualifiedTypeName, String name);
/**
* Removes the given parameter. Does nothing if the parameter is not
* present on this method.
*
* @throws java.lang.IllegalArgumentException if either parameter is null.
*/
public void removeParameter(EParameter parameter);
/**
* Returns all of the parameters on this method, or an empty array if there
* are none. This is simply a more strongly-typed version of
* getParameters().
*/
public EParameter[] getEditableParameters();
}
---------------------------------------------------------------------
To unsubscribe, e-mail: xmlbeans-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xmlbeans-cvs-help@xml.apache.org