xmlbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kkro...@apache.org
Subject cvs commit: xml-xmlbeans/v2/src/typeimpl/org/apache/xmlbeans/impl/schema FilerImpl.java SchemaTypeSystemImpl.java
Date Tue, 07 Dec 2004 00:37:10 GMT
kkrouse     2004/12/06 16:37:10

  Modified:    v2       build.xml
               v2/external/lib oldxbean.jar
               v2/src/typeimpl/org/apache/xmlbeans/impl/schema
                        FilerImpl.java SchemaTypeSystemImpl.java
  Log:
  repackage generated TypeSystemHolder class
  
  Revision  Changes    Path
  1.93      +12 -0     xml-xmlbeans/v2/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/build.xml,v
  retrieving revision 1.92
  retrieving revision 1.93
  diff -u -r1.92 -r1.93
  --- build.xml	3 Dec 2004 00:15:19 -0000	1.92
  +++ build.xml	7 Dec 2004 00:37:04 -0000	1.93
  @@ -789,6 +789,18 @@
           </antcall>
   
   
  +        <!-- apply the repachage_spec on old typeholder.name and get the result in new_typeholder.name
property -->
  +        <java classpath="build/classes/repackage" classname="repackage.Repackage"  failonerror="true"
  +            inputstring="${typeholder.name}" outputproperty="new_typeholder.name">
  +            <arg line="${new_repackage_arg}"/>
  +        </java>
  +        <!-- modify the new build script with the new property -->
  +        <antcall target="edit_build_script">
  +            <param name="token"       value="typeholder.name"/>
  +            <param name="replacement" value="${new_typeholder.name}"/>
  +        </antcall>
  +
  +
           <!-- apply the repachage_spec on old schema_compiler and get the result in new_schema_compiler
property -->
           <java classpath="build/classes/repackage" classname="repackage.Repackage"  failonerror="true"
               inputstring="${schema_compiler}" outputproperty="new_schema_compiler">
  
  
  
  1.16      +5038 -5078xml-xmlbeans/v2/external/lib/oldxbean.jar
  
  	<<Binary file>>
  
  
  1.2       +5 -0      xml-xmlbeans/v2/src/typeimpl/org/apache/xmlbeans/impl/schema/FilerImpl.java
  
  Index: FilerImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/src/typeimpl/org/apache/xmlbeans/impl/schema/FilerImpl.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- FilerImpl.java	19 Nov 2004 23:52:33 -0000	1.1
  +++ FilerImpl.java	7 Dec 2004 00:37:10 -0000	1.2
  @@ -120,6 +120,11 @@
           return new ArrayList(sourceFiles);
       }
   
  +    public Repackager getRepackager()
  +    {
  +        return repackager;
  +    }
  +
       static class RepackagingWriter extends StringWriter
       {
           public RepackagingWriter ( File file, Repackager repackager )
  
  
  
  1.18      +21 -11    xml-xmlbeans/v2/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeSystemImpl.java
  
  Index: SchemaTypeSystemImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeSystemImpl.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- SchemaTypeSystemImpl.java	3 Dec 2004 00:15:22 -0000	1.17
  +++ SchemaTypeSystemImpl.java	7 Dec 2004 00:37:10 -0000	1.18
  @@ -75,6 +75,8 @@
   import org.w3.x2001.xmlSchema.DocumentationDocument;
   import org.w3.x2001.xmlSchema.SchemaDocument.Schema;
   
  +import repackage.Repackager;
  +
   public class SchemaTypeSystemImpl extends SchemaTypeLoaderBase implements SchemaTypeSystem
   {
       public static final int DATA_BABE = 0xDA7ABABE;
  @@ -377,12 +379,18 @@
       {
           String indexClassName = SchemaTypeCodePrinter.indexClassForSystem(this);
           String[] replace = makeClassStrings(indexClassName);
  +        assert replace.length == HOLDER_TEMPLATE_NAMES.length;
   
           InputStream is = null;
           OutputStream os = null;
   
           DataInputStream in = null;
           DataOutputStream out = null;
  +
  +        Repackager repackager = null;
  +        if (_filer instanceof FilerImpl)
  +            repackager = ((FilerImpl)_filer).getRepackager();
  +
           try
           {
               is = SchemaTypeSystemImpl.class.getResourceAsStream(HOLDER_TEMPLATE_CLASSFILE);
  @@ -413,17 +421,7 @@
                   {
                       case CONSTANT_UTF8:
                           String value = in.readUTF();
  -                        int j = 0;
  -                        inner: for (; j < HOLDER_TEMPLATE_NAMES.length; j++)
  -                        {
  -                            if (HOLDER_TEMPLATE_NAMES[j].equals(value))
  -                            {
  -                                out.writeUTF(replace[j]);
  -                                break inner;
  -                            }
  -                        }
  -                        if (j == HOLDER_TEMPLATE_NAMES.length)
  -                            out.writeUTF(value);
  +                        out.writeUTF(repackageConstant(value, replace, repackager));
                           break;
   
                       case CONSTANT_CLASS:
  @@ -497,6 +495,18 @@
       private static final int CONSTANT_INTERFACEMETHOD = 11;
       private static final int CONSTANT_NAMEANDTYPE = 12;
   
  +
  +    private static String repackageConstant(String value, String[] replace, Repackager
repackager)
  +    {
  +        for (int i = 0; i < HOLDER_TEMPLATE_NAMES.length; i++)
  +            if (HOLDER_TEMPLATE_NAMES[i].equals(value))
  +                return replace[i];
  +
  +        if (repackager != null)
  +            return repackager.repackage(new StringBuffer(value)).toString();
  +
  +        return value;
  +    }
   
       /**
        * Construct an array of Strings found in a class file for a classname.
  
  
  

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


Mime
View raw message