xml-xmlbeans-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p...@apache.org
Subject cvs commit: xml-xmlbeans/v2/src/binding/org/apache/xmlbeans/impl/binding/compile Java2Schema.java
Date Sat, 06 Mar 2004 09:32:20 GMT
pcal        2004/03/06 01:32:20

  Modified:    v2/src/binding/org/apache/xmlbeans/impl/binding/compile
                        Java2Schema.java
  Log:
  assortment of java2schema tweaks
  
  Revision  Changes    Path
  1.34      +15 -2     xml-xmlbeans/v2/src/binding/org/apache/xmlbeans/impl/binding/compile/Java2Schema.java
  
  Index: Java2Schema.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/src/binding/org/apache/xmlbeans/impl/binding/compile/Java2Schema.java,v
  retrieving revision 1.33
  retrieving revision 1.34
  diff -u -r1.33 -r1.34
  --- Java2Schema.java	3 Mar 2004 01:48:57 -0000	1.33
  +++ Java2Schema.java	6 Mar 2004 09:32:20 -0000	1.34
  @@ -46,9 +46,11 @@
     private static final String JAVA_PACKAGE_PREFIX  = "java.";
   
     public static final String TAG_CT               = "xsdgen:complexType";
  +  public static final String TAG_CT_EXCLUDE       = TAG_CT+".exclude";
     public static final String TAG_CT_TYPENAME      = TAG_CT+".typeName";
     public static final String TAG_CT_TARGETNS      = TAG_CT+".targetNamespace";
     public static final String TAG_CT_ROOT          = TAG_CT+".rootElement";
  +  public static final String TAG_CT_IGNORESUPER   = TAG_CT+".ignoreSuper";
   
     private static final String TAG_EL               = "xsdgen:element";
   
  @@ -123,7 +125,11 @@
         mSchema.setTargetNamespace(getTargetNamespace(mClasses[0]));
       }
       //This does the binding
  -    for(int i=0; i<mClasses.length; i++) getBindingTypeFor(mClasses[i]);
  +    for(int i=0; i<mClasses.length; i++) {
  +      if (!getAnnotation(mClasses[i],TAG_CT_EXCLUDE,false)) {
  +        getBindingTypeFor(mClasses[i]);
  +      }
  +    }
       //
       try {
         writer.writeBindingFile(mBindingFile);
  @@ -165,7 +171,8 @@
       xsType.setName(xsdName);
       // deal with inheritance - see if it extends anything
       JClass superclass = clazz.getSuperclass();
  -    if (superclass != null && !superclass.isObject()) {
  +    if (superclass != null && !superclass.isObject() &&
  +            !getAnnotation(superclass,TAG_CT_IGNORESUPER,false)) {
         // FIXME we're ignoring interfaces at the moment
         BindingType superBindingType = getBindingTypeFor(superclass);
         ComplexContentDocument.ComplexContent ccd = xsType.addNewComplexContent();
  @@ -246,6 +253,12 @@
           if (annotatedType == null) {
             facade.setType(propType = props[i].getType());
           } else {
  +          if (!props[i].getType().isArray()) {
  +            //THIS IS A QUICK GROSS HACK THAT SHOULD BE REMOVED.
  +            //IF SOMEONE WANTS TO AS TYPE AN ARRAY PROPERTY, THEY NEED
  +            //TO ASTYPE IT TO THE ARRAY TYPE THEMSELVES
  +            annotatedType = "[L"+annotatedType+";";
  +          }
             propType = props[i].getType().forName(annotatedType);
             if (propType.isUnresolved()) {
               logError("Could not find class named '"+
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xmlbeans-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xmlbeans-cvs-help@xml.apache.org


Mime
View raw message