You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xmlbeans-cvs@xml.apache.org by pc...@apache.org on 2004/01/30 19:35:20 UTC
cvs commit: xml-xmlbeans/v2/src/jam/org/apache/xmlbeans/impl/jam/spi JClassBuilder.java JSourceParams.java
pcal 2004/01/30 10:35:20
Modified: v2/src/binding/org/apache/xmlbeans/impl/binding/compile
Schema2Java.java
v2/src/jam/org/apache/xmlbeans/impl/jam JClass.java
v2/src/jam/org/apache/xmlbeans/impl/jam/internal
BuiltinJClass.java PrimitiveJClass.java
v2/src/jam/org/apache/xmlbeans/impl/jam/internal/javadoc
JDClass.java
v2/src/jam/org/apache/xmlbeans/impl/jam/internal/reflect
RClass.java
Added: v2/src/jam/org/apache/xmlbeans/impl/jam/spi
JClassBuilder.java JSourceParams.java
Log:
various forgotten changes to jam and schema2java
Revision Changes Path
1.11 +7 -1 xml-xmlbeans/v2/src/binding/org/apache/xmlbeans/impl/binding/compile/Schema2Java.java
Index: Schema2Java.java
===================================================================
RCS file: /home/cvs/xml-xmlbeans/v2/src/binding/org/apache/xmlbeans/impl/binding/compile/Schema2Java.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- Schema2Java.java 20 Jan 2004 21:57:38 -0000 1.10
+++ Schema2Java.java 30 Jan 2004 18:35:19 -0000 1.11
@@ -317,6 +317,10 @@
* process that occurs in dependency order.
*/
private void resolveJavaName(Scratch scratch) {
+ if (scratch == null) {
+ logVerbose("FIXME null scratch, ignoring for now");
+ return;
+ }
if (scratch == null) throw new IllegalArgumentException("null scratch");
logVerbose("Resolving " + scratch.getXmlName());
// already resolved (we recurse to do in dependency order)
@@ -374,7 +378,9 @@
logVerbose("processing element "+scratch.getXmlName());
SchemaType contentType = scratch.getSchemaType().getProperties()[0].getType();
logVerbose("content type is "+contentType.getName());
- if (contentType.isPrimitiveType()) {
+ if (contentType.isPrimitiveType() ||
+ //FIXME why is this not a primitive? gross hack to make things work for now
+ contentType.getName().toString().equals("{http://www.w3.org/2001/XMLSchema}int")) {
//REVIEW this is a quick bug fix for the case where an element
//is of a primitive type. I'm not completely sure it is the right
//thing to do. pcal
1.4 +10 -0 xml-xmlbeans/v2/src/jam/org/apache/xmlbeans/impl/jam/JClass.java
Index: JClass.java
===================================================================
RCS file: /home/cvs/xml-xmlbeans/v2/src/jam/org/apache/xmlbeans/impl/jam/JClass.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- JClass.java 20 Jan 2004 21:57:38 -0000 1.3
+++ JClass.java 30 Jan 2004 18:35:19 -0000 1.4
@@ -220,6 +220,16 @@
public boolean isPrimitive();
/**
+ * If this JClass represents a primitive (isPrimitive() returns true),
+ * this method returns the java.lang.Class representing the class of
+ * the primitive. For example, JClass representing an integer returns
+ * the equivalent of 'int.class' or 'java.lang.Integer.type.'
+ *
+ * @return The primitive class, or null if this is JClass is not primitive.
+ */
+ public Class getPrimitiveClass();
+
+ /**
* Return true if this class is final.
*/
public boolean isFinal();
1.3 +2 -0 xml-xmlbeans/v2/src/jam/org/apache/xmlbeans/impl/jam/internal/BuiltinJClass.java
Index: BuiltinJClass.java
===================================================================
RCS file: /home/cvs/xml-xmlbeans/v2/src/jam/org/apache/xmlbeans/impl/jam/internal/BuiltinJClass.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- BuiltinJClass.java 3 Dec 2003 22:46:15 -0000 1.2
+++ BuiltinJClass.java 30 Jan 2004 18:35:19 -0000 1.3
@@ -162,6 +162,8 @@
public boolean isPrimitive() { return false; }
+ public Class getPrimitiveClass() { return null; }
+
public boolean isObject() { return false; }
public boolean isVoid() { return false; }
1.4 +4 -0 xml-xmlbeans/v2/src/jam/org/apache/xmlbeans/impl/jam/internal/PrimitiveJClass.java
Index: PrimitiveJClass.java
===================================================================
RCS file: /home/cvs/xml-xmlbeans/v2/src/jam/org/apache/xmlbeans/impl/jam/internal/PrimitiveJClass.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- PrimitiveJClass.java 16 Dec 2003 09:55:05 -0000 1.3
+++ PrimitiveJClass.java 30 Jan 2004 18:35:19 -0000 1.4
@@ -198,4 +198,8 @@
public boolean isPrimitive() {
return true;
}
+
+ public Class getPrimitiveClass() {
+ return mClass;
+ }
}
1.3 +4 -0 xml-xmlbeans/v2/src/jam/org/apache/xmlbeans/impl/jam/internal/javadoc/JDClass.java
Index: JDClass.java
===================================================================
RCS file: /home/cvs/xml-xmlbeans/v2/src/jam/org/apache/xmlbeans/impl/jam/internal/javadoc/JDClass.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- JDClass.java 3 Dec 2003 22:46:15 -0000 1.2
+++ JDClass.java 30 Jan 2004 18:35:19 -0000 1.3
@@ -186,6 +186,10 @@
public boolean isPrimitive() { return false; }
+ public Class getPrimitiveClass() {
+ return null;
+ }
+
public boolean isVoid() { return false; }
public boolean isObject() { return false; }
1.3 +7 -1 xml-xmlbeans/v2/src/jam/org/apache/xmlbeans/impl/jam/internal/reflect/RClass.java
Index: RClass.java
===================================================================
RCS file: /home/cvs/xml-xmlbeans/v2/src/jam/org/apache/xmlbeans/impl/jam/internal/reflect/RClass.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- RClass.java 3 Dec 2003 22:46:16 -0000 1.2
+++ RClass.java 30 Jan 2004 18:35:19 -0000 1.3
@@ -197,7 +197,13 @@
}
public boolean isPrimitive() {
- return (PrimitiveJClass.getPrimitiveClass(mClass) != null);
+ return false;
+ //it's always false now, right?
+ //(PrimitiveJClass.getPrimitiveClass(mClass) != null);
+ }
+
+ public Class getPrimitiveClass() {
+ return null;
}
public boolean isVoid() {
1.1 xml-xmlbeans/v2/src/jam/org/apache/xmlbeans/impl/jam/spi/JClassBuilder.java
Index: JClassBuilder.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.spi;
import org.apache.xmlbeans.impl.jam.JClass;
/**
*
* @author Patrick Calahan <pc...@bea.com>
*/
public interface JClassBuilder {
public JClass buildJClass(String qualifiedName);
}
1.1 xml-xmlbeans/v2/src/jam/org/apache/xmlbeans/impl/jam/spi/JSourceParams.java
Index: JSourceParams.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.spi;
import java.io.File;
/**
*
* @author Patrick Calahan <pc...@bea.com>
*/
public /*final*/ class JSourceParams {
public void setFiles(String[] sourceDirs, String[] files) {
}
public void include(File srcRoot, String pattern) {
}
public void exclude(File srcRoot, String pattern) {
}
public void include(File fileOrDir) {
}
public void exclude(File fileOrDir) {
}
public String[] getClassNamesInSet() {
return null;
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: xmlbeans-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xmlbeans-cvs-help@xml.apache.org