xmlbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p...@apache.org
Subject cvs commit: xml-xmlbeans/v2/test/src/drt/drtcases MarshalTests.java
Date Tue, 25 May 2004 20:44:46 GMT
pcal        2004/05/25 13:44:46

  Modified:    v2       build.xml
               v2/jam/src/org/apache/xmlbeans/impl/jam
                        JamServiceParams.java
               v2/jam/src/org/apache/xmlbeans/impl/jam/internal
                        JamServiceContextImpl.java
               v2/jam/src/org/apache/xmlbeans/impl/jam/internal/elements
                        AnnotatedElementImpl.java
               v2/jam/src/org/apache/xmlbeans/impl/jam/internal/java15
                        Javadoc15DelegateImpl.java
                        Reflect15DelegateImpl.java
               v2/jam/src/org/apache/xmlbeans/impl/jam/internal/javadoc
                        Javadoc15Delegate.java JavadocClassBuilder.java
               v2/jam/src/org/apache/xmlbeans/impl/jam/mutable
                        MAnnotatedElement.java
               v2/jam/src/org/apache/xmlbeans/impl/jam/visitor
                        CommentInitializer.java
               v2/jam/src/org/apache/xmlbeans/impl/jam/xml
                        JamXmlReader.java
               v2/src/binding/org/apache/xmlbeans/impl/binding/compile
                        BindingCompiler.java BindingCompilerTask.java
               v2/src/binding/org/apache/xmlbeans/impl/binding/tylar
                        BaseTylarImpl.java CompositeTylar.java
                        DebugTylarWriter.java DefaultTylarLoader.java
                        ExplodedTylarImpl.java Tylar.java
                        TylarConstants.java TylarImpl.java TylarLoader.java
               v2/src/marshal/org/apache/xmlbeans/impl/marshal
                        BindingContextFactoryImpl.java
                        TylarSchemaTypeLoaderProvider.java
               v2/src/xmlpublic/org/apache/xmlbeans
                        BindingContextFactory.java
               v2/test/src/drt/drtcases MarshalTests.java
  Added:       v2/jam/src/org/apache/xmlbeans/impl/jam/annotation
                        LineDelimitedTagParser.java TagParser.java
                        WhitespaceDelimitedTagParser.java
               v2/src/binding/org/apache/xmlbeans/impl/binding/tylar
                        RuntimeTylar.java
  Removed:     v2/jam_old build.xml
               v2/jam_old/docs faq.html jam.css javadocTo175.html
                        stylesheet.css typedMetadata.html
               v2/jam_old/external/lib antlr-runtime.jar antlr.jar
                        junit.jar parseview.jar
               v2/jam_old/src java.g
               v2/jam_old/src/org/apache/xmlbeans/impl/jam_old
                        JAnnotation.java JAnnotationDefinition.java
                        JAnnotationLoader.java JAnnotationMember.java
                        JAnnotationMemberDefinition.java JClass.java
                        JClassIterator.java JClassLoader.java JComment.java
                        JConstructor.java JElement.java JFactory.java
                        JField.java JFileSet.java JInvokable.java
                        JMember.java JMethod.java JPackage.java
                        JParameter.java JProperty.java JService.java
                        JServiceFactory.java JServiceParams.java
                        JSourcePosition.java package.html
               v2/jam_old/src/org/apache/xmlbeans/impl/jam_old/editable
                        EAnnotation.java EAnnotationDefinition.java
                        EAnnotationMember.java
                        EAnnotationMemberDefinition.java EClass.java
                        EComment.java EConstructor.java EElement.java
                        EElementVisitor.java EField.java EInvokable.java
                        EMember.java EMethod.java EParameter.java
                        EService.java EServiceFactory.java
                        EServiceParams.java ESourcePosition.java
               v2/jam_old/src/org/apache/xmlbeans/impl/jam_old/editable/impl
                        EAnnotationDefinitionImpl.java EAnnotationImpl.java
                        EAnnotationMemberDefinitionImpl.java
                        EAnnotationMemberImpl.java EClassImpl.java
                        ECommentImpl.java EConstructorImpl.java
                        EElementImpl.java EFieldImpl.java
                        EInvokableImpl.java EMemberImpl.java
                        EMethodImpl.java EParameterImpl.java
                        EServiceImpl.java EServiceParamsImpl.java
                        ESourcePositionImpl.java
               v2/jam_old/src/org/apache/xmlbeans/impl/jam_old/editable/impl/ref
                        DirectJClassRef.java JClassRef.java
                        JClassRefContext.java QualifiedJClassRef.java
                        UnqualifiedJClassRef.java
               v2/jam_old/src/org/apache/xmlbeans/impl/jam_old/internal
                        ArrayJClass.java BaseJAnnotation.java
                        BaseJClassLoader.java BaseJElement.java
                        BaseJMember.java BuiltinJClass.java
                        DirectoryScanner.java InternalJPackage.java
                        JClassHelper.java JClassLoaderImpl.java
                        JFileSetImpl.java JPackageImpl.java
                        JPropertyImpl.java JamPrinter.java
                        ObjectJClass.java PrimitiveJClass.java
                        RootJClassLoader.java UnresolvedJClass.java
                        VoidJClass.java package.html
               v2/jam_old/src/org/apache/xmlbeans/impl/jam_old/internal/javadoc
                        JDAnnotation.java JDClass.java JDClassLoader.java
                        JDClassLoaderFactory.java JDComment.java
                        JDConstructor.java JDExecutableMember.java
                        JDFactory.java JDField.java JDMember.java
                        JDMethod.java JDParameter.java
                        JDSourcePosition.java JavadocResults.java
                        package.html
               v2/jam_old/src/org/apache/xmlbeans/impl/jam_old/internal/parser
                        ParamStruct.java ParamStructPool.java
                        ParserClassBuilder.java
               v2/jam_old/src/org/apache/xmlbeans/impl/jam_old/provider
                        CompositeClassBuilder.java
                        CompositeClassInitializer.java
                        DefaultCommentProcessor.java
                        DefaultJServiceFactory.java EClassBuilder.java
                        EClassInitializer.java ElementProcessor.java
                        ElementWalker.java JPath.java JServiceImpl.java
                        JServiceParamsImpl.java JStore.java
                        JStoreParams.java NewJServiceFactory.java
                        ReflectionClassBuilder.java
               v2/jam_old/test build.xml
               v2/jam_old/test/dummy15classes/org/apache/xmlbeans/test/jam/dummyclasses/jsr175
                        AnnotatedClass.java RFEAnnotation.java
                        RFEAnnotationImpl.java
               v2/jam_old/test/dummyclasses/org/apache/xmlbeans/test/jam/dummyclasses
                        Base.java Baz.java Foo.java FooImpl.java
                        HeavilyCommented.java MyException.java
               v2/jam_old/test/dummyclasses/org/apache/xmlbeans/test/jam/dummyclasses/ejb
                        IEnv.java MyEjbException.java TradeResult.java
                        TraderEJB.java
               v2/jam_old/test/tests/org/apache/xmlbeans/test/jam
                        ClassesJamTest.java GoldenInvokable.java
                        ImplComparisonTest.java JElementComparator.java
                        JamTestBase.java ModifierHelper.java
                        ParserJamTest.java SourcesJamTest.java
  Log:
  finally remove jam_old
  make loading of tylar resources more lazy
  
  Revision  Changes    Path
  1.63      +1 -12     xml-xmlbeans/v2/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/build.xml,v
  retrieving revision 1.62
  retrieving revision 1.63
  diff -u -r1.62 -r1.63
  --- build.xml	21 May 2004 19:21:31 -0000	1.62
  +++ build.xml	25 May 2004 20:44:43 -0000	1.63
  @@ -2,7 +2,7 @@
   
     <property name="build.compiler" value="javac1.4"/>
     <property name="product.version" value="1.0.0"/>
  -  <property name="jam_root" value="jam_old"/>
  +  <property name="jam_root" value="jam"/>
   
     <target name="usage">
       <echo message="The following ant targets are defined:"/>
  @@ -974,17 +974,6 @@
         <fileset dir="build/${jam_root}/classes" />
       </move>
       <delete dir='build/${jam_root}'/>
  -
  -<!-- build new jam as well -->
  -<!-- remove this once jam_old is dead and jam_root is just 'jam' -->
  -    <ant dir='jam' target='clean' inheritAll='false' />
  -    <ant dir='jam' target='all' inheritAll='false' />
  -    <move todir="build/classes/jam">
  -      <fileset dir="build/jam/classes" />
  -    </move>
  -    <delete dir='build/jam'/>
  -
  -
     </target>
   
     <!-- marshal target =============================================== -->
  
  
  
  1.11      +4 -0      xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/JamServiceParams.java
  
  Index: JamServiceParams.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/JamServiceParams.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- JamServiceParams.java	12 Apr 2004 21:06:57 -0000	1.10
  +++ JamServiceParams.java	25 May 2004 20:44:43 -0000	1.11
  @@ -16,6 +16,7 @@
   package org.apache.xmlbeans.impl.jam;
   
   import org.apache.xmlbeans.impl.jam.visitor.MVisitor;
  +import org.apache.xmlbeans.impl.jam.annotation.TagParser;
   
   import java.io.File;
   import java.io.PrintWriter;
  @@ -313,6 +314,9 @@
   
     //DOCME
     public void addInitializer(MVisitor initializer);
  +
  +  //DOCME
  +  public void setTagParser(TagParser tp);
   
   
     /**
  
  
  
  1.1                  xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/annotation/LineDelimitedTagParser.java
  
  Index: LineDelimitedTagParser.java
  ===================================================================
  /*   Copyright 2004 The Apache Software Foundation
   *
   *   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
   *
   *       http://www.apache.org/licenses/LICENSE-2.0
   *
   *   Unless required by applicable law or agreed to in writing, software
   *   distributed under the License is distributed on an "AS IS" BASIS,
   *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   *   See the License for the specific language governing permissions and
   *  limitations under the License.
   */
  package org.apache.xmlbeans.impl.jam.annotation;
  
  import org.apache.xmlbeans.impl.jam.mutable.MAnnotatedElement;
  import org.apache.xmlbeans.impl.jam.mutable.MAnnotation;
  import org.apache.xmlbeans.impl.jam.JClass;
  import org.apache.xmlbeans.impl.jam.JAnnotation;
  import org.apache.xmlbeans.impl.jam.internal.elements.ElementContext;
  
  import java.util.Properties;
  import java.util.Enumeration;
  import java.util.StringTokenizer;
  import java.io.StringWriter;
  
  /**
   * <p>Attempts to parse tag contents as a series of line-delimited name-value
   * pairs.</p>
   *
   * @author Patrick Calahan &lt;email: pcal-at-bea-dot-com&gt;
   */
  public class LineDelimitedTagParser extends TagParser {
  
    // ========================================================================
    // Constants
  
    private static final String VALUE_QUOTE = "\"";
    private static final String LINE_DELIMS = "\n\f\r";
  
    // ========================================================================
    // TagParser implementation
  
    public void parse(MAnnotatedElement target,
                        String tagName,
                        String tagText)
    {
      if (tagText == null) throw new IllegalArgumentException("null tagText");
      if (tagName == null) throw new IllegalArgumentException("null tagName");
      if (target == null) throw new IllegalArgumentException("null target");
      MAnnotation ann = createAnnotation(target,tagName);
      tagText = tagText.trim();
      if (tagText.length() == 0) return;
      ann.setSimpleValue(JAnnotation.SINGLE_VALUE_NAME,tagText,getStringType());
      StringTokenizer st = new StringTokenizer(tagText, LINE_DELIMS);
      while (st.hasMoreTokens()) {
        String pair = st.nextToken();
        int eq = pair.indexOf('=');
        if (eq <= 0) continue; // if abstent or is first character
        String name = pair.substring(0, eq).trim();
        if (eq < pair.length() - 1) {
          String value = pair.substring(eq + 1).trim();
          if (value.startsWith(VALUE_QUOTE)) {
            value = parseQuotedValue(value.substring(1),st);
          }
          setValue(ann,name,value);
        }
      }
    }
  
    // ========================================================================
    // Protected methods
  
    protected MAnnotation createAnnotation(MAnnotatedElement target,
                                           String tagName) {
      return target.findOrCreateAnnotation(tagName);
    }
  
    protected void setValue(MAnnotation ann,
                            String memberName,
                            String value) {
      ann.setSimpleValue(memberName,value,getStringType());
    }
  
    // ========================================================================
    // Private methods
  
    private String parseQuotedValue(String line, StringTokenizer st) {
      StringWriter out = new StringWriter();
      while(true) {
        int endQuote = line.indexOf(VALUE_QUOTE);
        if (endQuote == -1) {
          out.write(line);
          if (!st.hasMoreTokens()) return out.toString();
          out.write('\n');
          line = st.nextToken().trim();
          continue;
        } else {
          out.write(line.substring(0,endQuote).trim());
          return out.toString();
        }
      }
    }
  
  }
  
  
  
  1.1                  xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/annotation/TagParser.java
  
  Index: TagParser.java
  ===================================================================
  /*   Copyright 2004 The Apache Software Foundation
   *
   *   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
   *
   *       http://www.apache.org/licenses/LICENSE-2.0
   *
   *   Unless required by applicable law or agreed to in writing, software
   *   distributed under the License is distributed on an "AS IS" BASIS,
   *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   *   See the License for the specific language governing permissions and
   *  limitations under the License.
   */
  package org.apache.xmlbeans.impl.jam.annotation;
  
  import org.apache.xmlbeans.impl.jam.mutable.MAnnotatedElement;
  import org.apache.xmlbeans.impl.jam.provider.JamServiceContext;
  import org.apache.xmlbeans.impl.jam.provider.JamLogger;
  import org.apache.xmlbeans.impl.jam.JClass;
  import org.apache.xmlbeans.impl.jam.internal.elements.ElementContext;
  
  /**
   * @author Patrick Calahan &lt;email: pcal-at-bea-dot-com&gt;
   */
  public abstract class TagParser {
  
    // ========================================================================
    // Variables
  
    private JamServiceContext mContext = null;
  
    // ========================================================================
    // Public methods
  
    /**
     * <p>Called by JAM to initialize the proxy.  Do not try to call this
     * yourself.</p>
     */
    public void init(JamServiceContext ctx) {
      if (ctx == null) throw new IllegalArgumentException("null logger");
      if (mContext != null) throw new IllegalStateException
        ("TagParser.init() called twice");
      mContext = ctx;
    }
  
    // ========================================================================
    // Abstract methods
  
    public abstract void parse(MAnnotatedElement target,
                                 String tagName,
                                 String tagText);
  
    // ========================================================================
    // Protected methods
  
    protected JamLogger getLogger() { return mContext.getLogger(); }
  
    protected JClass getStringType() {
      return ((ElementContext)mContext).getClassLoader().
        loadClass("java.lang.String");
    }
  }
  
  
  
  1.1                  xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/annotation/WhitespaceDelimitedTagParser.java
  
  Index: WhitespaceDelimitedTagParser.java
  ===================================================================
  /*   Copyright 2004 The Apache Software Foundation
   *
   *   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
   *
   *       http://www.apache.org/licenses/LICENSE-2.0
   *
   *   Unless required by applicable law or agreed to in writing, software
   *   distributed under the License is distributed on an "AS IS" BASIS,
   *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   *   See the License for the specific language governing permissions and
   *  limitations under the License.
   */
  package org.apache.xmlbeans.impl.jam.annotation;
  
  import org.apache.xmlbeans.impl.jam.mutable.MAnnotatedElement;
  import org.apache.xmlbeans.impl.jam.mutable.MAnnotation;
  import org.apache.xmlbeans.impl.jam.JClass;
  import org.apache.xmlbeans.impl.jam.JAnnotation;
  import org.apache.xmlbeans.impl.jam.internal.elements.ElementContext;
  
  import java.util.Properties;
  import java.util.Enumeration;
  
  /**
   * @author Patrick Calahan &lt;email: pcal-at-bea-dot-com&gt;
   */
  public class WhitespaceDelimitedTagParser extends TagParser {
  
    public void parse(MAnnotatedElement target,
                        String tagName,
                        String tagText)
    {
      //FIXME AND REVIEW so we're saying that tag values are always strings,
      //at least by default.  not clear that we can do any better than that.
      //even if so, the way this is implemented here with this cast
      //is somewhat gross
      JClass type = getStringType();
      if (tagText == null) throw new IllegalArgumentException("null tagText");
      tagText = tagText.trim();
      if (tagText.length() == 0) return;
      Properties props = new Properties();
      parseAssignments(props,tagText);
  
      MAnnotation ann = target.findOrCreateAnnotation(tagName);
      if (props.size() == 0) {
        // if there are no name-value pairs, then just make a single value
        // named 'value' with a value equal to the contents of the tag.
        ann.setSimpleValue(JAnnotation.SINGLE_VALUE_NAME,tagText, type);
      } else {
        Enumeration names = props.propertyNames();
        while(names.hasMoreElements()) {
          String name = (String)names.nextElement();
          ann.setSimpleValue(name,props.getProperty(name), type);
        }
      }
  
    }
  
  // ========================================================================
    // Private methods
  
    //REVIEW the comment parsing logic here should be factored and made pluggable
  
    /**
     * Parse a line that contains assignments, taking into account
     * - newlines (ignore them)
     * - double quotes (the value is everything in-between)
     * - // (everything after is ignored)
     * - multiple assignments on the same line
     *
     * @param out This variable will contain a list of properties
     * representing the line once parsed.
     * @param line The line to be parsed
     *
     * This method contributed by Cedric Beust
     */
    private void parseAssignments(Properties out, String line) {
      getLogger().verbose("PARSING LINE " + line,this);
      String originalLine = line;
      line = removeComments(line);
      while (null != line && -1 != line.indexOf("=")) {
        int keyStart = -1;
        int keyEnd = -1;
        int ind = 0;
        // Skip stuff before the key
        char c = line.charAt(ind);
        while (isBlank(c)) {
          ind++;
          c = line.charAt(ind);
        }
        keyStart = ind;
        while (isLegal(line.charAt(ind))) ind++;
        keyEnd = ind;
        String key = line.substring(keyStart, keyEnd);
        ind = line.indexOf("=");
        if (ind == -1) {
          return; //FIXME let's be a little conservative, just for now
          //throw new IllegalStateException("'=' expected: "+line);
        }
        ind++;
        // Skip stuff after the equal sign
        try {
          c = line.charAt(ind);
        }
        catch(StringIndexOutOfBoundsException ex){
          ex.printStackTrace();
        }
        while (isBlank(c)) {
          ind++;
          c = line.charAt(ind);
        }
  
        String value;
        int valueStart = -1;
        int valueEnd = -1;
        if (c == '"') {
          valueStart = ++ind;
          while ('"' != line.charAt(ind)) {
            ind++;
            if (ind >= line.length()) {
              getLogger().verbose("missing double quotes on line "+line,this);
            }
          }
          valueEnd = ind;
        }
        else {
          valueStart = ind++;
          while (ind < line.length() && isLegal(line.charAt(ind))) ind++;
          valueEnd = ind;
        }
        value = line.substring(valueStart, valueEnd);
        if (ind < line.length()) {
          line = line.substring(ind + 1);
        }
        else {
          line = null;
        }
        getLogger().verbose("SETTING KEY:"+key+" VALUE:"+value,this);
        out.setProperty(key, value);
      }
    }
  
    /**
     * Remove all the texts between "//" and '\n'
     *
     * This method contributed by Cedric Beust
     */
    private String removeComments(String value) {
      String result = new String();
      int size = value.length();
      String current = value;
  
      int currentIndex = 0;
  
      int beginning = current.indexOf("//");
  
      //
      // Ignore // if it's between double quotes
      //
      int doubleQuotesIndex = current.indexOf("\"");
      if (-1 != doubleQuotesIndex && doubleQuotesIndex < beginning) {
        // do nothing
        result = value;
      }
      else {
        while (currentIndex < size && beginning != -1) {
          beginning = value.indexOf("//", currentIndex);
          if (-1 != beginning) {
            if (beginning > 0 && value.charAt(beginning-1) == ':') {
              //this is a quick fix for problem of unquoted url values.  for
              //now, just say it's not a comment if preceded by ':'.  should
              //review this later
              currentIndex = beginning+2;
              continue;
            }
            int end = value.indexOf('\n', beginning);
            if (-1 == end) end = size;
            // We have identified a portion to remove, copy the one we want to
            // keep
            result = result + value.substring(currentIndex, beginning).trim() + "\n";
            current = value.substring(end);
            currentIndex = end;
          }
        }
        result += current;
      }
  
      return result.trim();
    }
  
    private boolean isBlank(char c) {
      return c == ' ' || c == '\t' || c == '\n';
    }
  
    private boolean isLegal(char c) {
      return (! isBlank(c)) && c != '=';
  //     return Character.isJavaIdentifierStart(c) || c == '-' || Character.isDigit(c) || c == '.';
    }
  
    /*
    OLD TAG PARSING CODE
  
    public void initFromJavadocTag(String tagline) {
      if (tagline == null) throw new IllegalArgumentException("null tagline");
      StringTokenizer st = new StringTokenizer(tagline, mNvPairDelims);
      while (st.hasMoreTokens()) {
        String pair = st.nextToken();
        int eq = pair.indexOf('=');
        if (eq <= 0) continue; // if not there or is first character
        String name = pair.substring(0, eq).trim();
        if (eq < pair.length() - 1) {
          String value = pair.substring(eq + 1).trim();
          if (value.startsWith(VALUE_QUOTE)) {
            value = parseQuotedValue(value.substring(1),st);
          }
          setValue(name,value);
        }
      }
    }
  
    private String parseQuotedValue(String line, StringTokenizer st) {
      StringWriter out = new StringWriter();
      while(true) {
        int endQuote = line.indexOf(VALUE_QUOTE);
        if (endQuote == -1) {
          out.write(line);
          if (!st.hasMoreTokens()) return out.toString();
          out.write('\n');
          line = st.nextToken().trim();
          continue;
        } else {
          out.write(line.substring(0,endQuote).trim());
          return out.toString();
        }
      }
    }
    */
  
    /**
     * <p>Called by JAM to initialize this proxy's properties using a
     * JSR175 annotation instnce.  The value is guaranteed to be an instance
     * of the 1.5-specific <code>java.lang.annotation.Annotation</code>
     * marker interface.  (It's typed as <code>Object</code> in order to
     * preserve pre-1.5 compatibility).</p>
     *
     * <p>The implementation of this method introspects the given object
     * for JSR175 annotation member methods, invokes them, and then calls
     * <code>setMemberValue</code> using the method's name and invocation
     * result as the name and value.</p>
     *
     * <p>Extending classes are free to override this method if different
     * behavior is required.</p>
  
    public void initFromAnnotationInstance(Class annType,
                                           Object jsr175annotationObject) {
      if (jsr175annotationObject == null) throw new IllegalArgumentException();
      //FIXME this is a bit clumsy right now - I think we need to be a little
      // more surgical in identifying the annotation member methods
      Method[] methods = annType.getMethods();
      for(int i=0; i<methods.length; i++) {
        int mods = methods[i].getModifiers();
        if (Modifier.isStatic(mods)) continue;
        if (!Modifier.isPublic(mods)) continue;
        if (methods[i].getParameterTypes().length > 0) continue;
        {
          // try to limit it to real annotation methods.
          // FIXME seems like this could be better
          Class c = methods[i].getDeclaringClass();
          String name = c.getName();
          if (name.equals("java.lang.Object") ||
            name.equals("java.lang.annotation.Annotation")) {
            continue;
          }
        }
        try {
          setValue(methods[i].getName(),
                   methods[i].invoke(jsr175annotationObject,null), null);
        } catch (IllegalAccessException e) {
          //getLogger().warning(e);
        } catch (InvocationTargetException e) {
          //getLogger().warning(e);
        }
      }
    }
     */
  
  
  }
  
  
  
  1.15      +7 -0      xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/internal/JamServiceContextImpl.java
  
  Index: JamServiceContextImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/internal/JamServiceContextImpl.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- JamServiceContextImpl.java	15 Apr 2004 01:50:06 -0000	1.14
  +++ JamServiceContextImpl.java	25 May 2004 20:44:43 -0000	1.15
  @@ -19,6 +19,8 @@
   import org.apache.xmlbeans.impl.jam.JamServiceParams;
   import org.apache.xmlbeans.impl.jam.annotation.AnnotationProxy;
   import org.apache.xmlbeans.impl.jam.annotation.DefaultAnnotationProxy;
  +import org.apache.xmlbeans.impl.jam.annotation.TagParser;
  +import org.apache.xmlbeans.impl.jam.annotation.TagParser;
   import org.apache.xmlbeans.impl.jam.internal.elements.ClassImpl;
   import org.apache.xmlbeans.impl.jam.internal.elements.ElementContext;
   import org.apache.xmlbeans.impl.jam.visitor.*;
  @@ -66,6 +68,7 @@
     private boolean mUseSystemClasspath = true;
   
   
  +  private TagParser mTagParser = null;
     private MVisitor mCommentInitializer = null;
     private MVisitor mPropertyInitializer = new PropertyInitializer();
     private List mOtherInitializers = null;
  @@ -261,6 +264,10 @@
       mOtherInitializers.add(initializer);
     }
   
  +  //DOCME
  +  public void setTagParser(TagParser tp) {
  +    mTagParser = tp;
  +  }
   
     public void includeSourceFile(File file) {
       if (file == null) throw new IllegalArgumentException("null file");
  
  
  
  1.16      +6 -17     xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/internal/elements/AnnotatedElementImpl.java
  
  Index: AnnotatedElementImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/internal/elements/AnnotatedElementImpl.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- AnnotatedElementImpl.java	2 Apr 2004 02:41:06 -0000	1.15
  +++ AnnotatedElementImpl.java	25 May 2004 20:44:43 -0000	1.16
  @@ -128,7 +128,7 @@
       return (MAnnotation)mName2Annotation.get(proxyClass.getName());
     }
   
  -  public MAnnotation addAnnotationForTag(String tagName) {
  +  public MAnnotation addAnnotation(String tagName) {
       if (tagName == null) throw new IllegalArgumentException("null tagname");
       tagName = tagName.trim();
       {
  @@ -176,24 +176,13 @@
     }
   
   
  -
  -  public MAnnotation addAnnotationForType(String jsr175annotationClassname) {
  -    ClassImpl.validateClassName(jsr175annotationClassname);
  -    MAnnotation ann = getMutableAnnotation(jsr175annotationClassname);
  +  public MAnnotation findOrCreateAnnotation(String annotationName) {
  +    ClassImpl.validateClassName(annotationName);
  +    MAnnotation ann = getMutableAnnotation(annotationName);
       if (ann != null) return ann; //REVIEW weird case again
       AnnotationProxy proxy = getContext().
  -      createProxyForAnnotationType(jsr175annotationClassname);
  -    ann = new AnnotationImpl(getContext(),proxy,jsr175annotationClassname);
  -    addAnnotation(ann);
  -    return ann;
  -  }
  -
  -  public MAnnotation addAnnotationForProxy(AnnotationProxy proxy) {
  -    if (proxy == null) throw new IllegalArgumentException("null proxy");
  -    String name = proxy.getClass().getName();
  -    MAnnotation ann = getMutableAnnotation(name);
  -    if (ann != null) return ann; //REVIEW weird case yet again
  -    ann = new AnnotationImpl(getContext(),proxy,name);
  +      createProxyForAnnotationType(annotationName);
  +    ann = new AnnotationImpl(getContext(),proxy,annotationName);
       addAnnotation(ann);
       return ann;
     }
  
  
  
  1.6       +13 -6     xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/internal/java15/Javadoc15DelegateImpl.java
  
  Index: Javadoc15DelegateImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/internal/java15/Javadoc15DelegateImpl.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Javadoc15DelegateImpl.java	12 May 2004 23:14:18 -0000	1.5
  +++ Javadoc15DelegateImpl.java	25 May 2004 20:44:43 -0000	1.6
  @@ -30,6 +30,7 @@
   import com.sun.javadoc.SourcePosition;
   // import com.sun.javadoc.AnnotationTypeElementDoc;
   import com.sun.javadoc.AnnotationTypeMemberDoc;
  +import com.sun.javadoc.ExecutableMemberDoc;
   
   
   
  @@ -61,11 +62,17 @@
       extractAnnotations(dest,src.annotations(),src.position());
     }
   
  -  public void extractAnnotations(MAnnotatedElement dest, Parameter src) {
  -    //FIXME javadoc doesn't yet support parameter annotations
  -    //pcal 3/15/04
  -    //
  -    //extractAnnotations(dest,src.annotations());
  +  public void extractAnnotations(MAnnotatedElement dest,
  +                                 ExecutableMemberDoc method,
  +                                 Parameter src)
  +  {
  +//    extractAnnotations(dest,src.annotations(),method.position());
  +
  +//FIXME uncomment when SUN implements Parameter.annotations()
  +//
  +//  [java] Exception in thread "main" java.lang.UnsupportedOperationException:
  +// Not implemented in this release
  +// [java]     at com.sun.tools.javadoc.ParameterImpl.annotations(ParameterImpl.java:83)
     }
   
     public boolean isEnum(ClassDoc cd) {
  @@ -81,7 +88,7 @@
     {
       if (anns == null) return; //?
       for(int i=0; i<anns.length; i++) {
  -      MAnnotation destAnn = dest.addAnnotationForType
  +      MAnnotation destAnn = dest.findOrCreateAnnotation
           (anns[i].annotationType().asClassDoc().qualifiedName());
         populateAnnotation(destAnn,anns[i],sp);
       }
  
  
  
  1.6       +1 -1      xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/internal/java15/Reflect15DelegateImpl.java
  
  Index: Reflect15DelegateImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/internal/java15/Reflect15DelegateImpl.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Reflect15DelegateImpl.java	12 May 2004 23:14:18 -0000	1.5
  +++ Reflect15DelegateImpl.java	25 May 2004 20:44:43 -0000	1.6
  @@ -137,7 +137,7 @@
     {
       if (anns == null || anns.length == 0) return;
       for(int i=0; i<anns.length; i++) {
  -      MAnnotation destAnn = dest.addAnnotationForType
  +      MAnnotation destAnn = dest.findOrCreateAnnotation
           (anns[i].annotationType().getName());
         destAnn.setAnnotationInstance(anns[i]);
         populateAnnotation(destAnn,anns[i]);
  
  
  
  1.2       +2 -0      xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/internal/javadoc/Javadoc15Delegate.java
  
  Index: Javadoc15Delegate.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/internal/javadoc/Javadoc15Delegate.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Javadoc15Delegate.java	2 Apr 2004 02:41:07 -0000	1.1
  +++ Javadoc15Delegate.java	25 May 2004 20:44:43 -0000	1.2
  @@ -19,6 +19,7 @@
   import com.sun.javadoc.ProgramElementDoc;
   import com.sun.javadoc.Parameter;
   import com.sun.javadoc.ClassDoc;
  +import com.sun.javadoc.ExecutableMemberDoc;
   
   /**
    * Provides an interface to 1.5-specific functionality.  The impl of
  @@ -34,6 +35,7 @@
                                    ProgramElementDoc src);
   
     public void extractAnnotations(MAnnotatedElement dest,
  +                                 ExecutableMemberDoc method,
                                    Parameter src);
   
     /**
  
  
  
  1.25      +3 -3      xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/internal/javadoc/JavadocClassBuilder.java
  
  Index: JavadocClassBuilder.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/internal/javadoc/JavadocClassBuilder.java,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- JavadocClassBuilder.java	17 May 2004 18:59:33 -0000	1.24
  +++ JavadocClassBuilder.java	25 May 2004 20:44:43 -0000	1.25
  @@ -263,17 +263,17 @@
       }
       Parameter[] params = src.parameters();
       for(int i=0; i<params.length; i++) {
  -      populate(dest.addNewParameter(),params[i]);
  +      populate(dest.addNewParameter(),src,params[i]);
       }
       addAnnotations(dest, src);
       addSourcePosition(dest,src);
     }
   
  -  private void populate(MParameter dest, Parameter src) {
  +  private void populate(MParameter dest, ExecutableMemberDoc method, Parameter src) {
       dest.setArtifact(src);
       dest.setSimpleName(src.name());
       dest.setType(getFdFor(src.type()));
  -    if (mDelegate != null) mDelegate.extractAnnotations(dest,src);
  +    if (mDelegate != null) mDelegate.extractAnnotations(dest,method,src);
     }
   
   
  
  
  
  1.5       +15 -24    xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/mutable/MAnnotatedElement.java
  
  Index: MAnnotatedElement.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/mutable/MAnnotatedElement.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- MAnnotatedElement.java	2 Apr 2004 02:41:07 -0000	1.4
  +++ MAnnotatedElement.java	25 May 2004 20:44:44 -0000	1.5
  @@ -12,33 +12,13 @@
   public interface MAnnotatedElement extends MElement, JAnnotatedElement {
   
     /**
  -   * <p>Creates an annotation to expose the metadata in a javadoc tag.
  -   * You should subsequently call <code>setMemberValue()</code> on
  -   * the returned object to populate the annotation's values.</p>
  -   *
  -   * @param tagName name of the javadoc tag to be represented.
  -   * @return
  +   * Returns the annotation having the given name, creating it if it doesn't
  +   * exist.
      */
  -  public MAnnotation addAnnotationForTag(String tagName);
  -
  -  /**
  -   * <p>Creates an annotation to expose the metadata in a javadoc tag.</p>
  -   *
  -   * @param tagName
  -   * @param tagContents
  -   * @return
  -   */
  -  public MAnnotation addAnnotationForTag(String tagName, String tagContents);
  +  public MAnnotation findOrCreateAnnotation(String annotationName);
   
     //DOCME
  -  //public MAnnotation addAnnotationForInstance(Class annotationType,
  -  //                                          /*Annotation*/ Object jsr175annotationInstance);
  -
  -  //DOCME
  -  public MAnnotation addAnnotationForType(String jsr175annotationClassname);
  -
  -  //DOCME actually not entirely clear we ever want to be able to do this
  -  public MAnnotation addAnnotationForProxy(AnnotationProxy proxy);
  +  public MAnnotation addAnnotation(String annotationName);
   
   
     public MAnnotation[] getMutableAnnotations();
  @@ -58,4 +38,15 @@
   
     //DOCME
     public void removeComment();
  +
  +
  +
  +
  +  /**
  +   * @deprecated
  +   */
  +  public MAnnotation addAnnotationForTag(String tagName, String tagContents);
  +
  +
  +
   }
  
  
  
  1.6       +1 -1      xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/visitor/CommentInitializer.java
  
  Index: CommentInitializer.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/visitor/CommentInitializer.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- CommentInitializer.java	11 Mar 2004 23:01:42 -0000	1.5
  +++ CommentInitializer.java	25 May 2004 20:44:44 -0000	1.6
  @@ -158,7 +158,7 @@
       }
       if (tagname == null) { // empty tag
         tagname = tagtext.substring(1);
  -      element.addAnnotationForTag(tagtext);
  +      element.addAnnotation(tagtext);
       } else {
         tagtext = tagtext.substring(offset).trim();
         element.addAnnotationForTag(tagname,tagtext);
  
  
  
  1.5       +1 -1      xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/xml/JamXmlReader.java
  
  Index: JamXmlReader.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/xml/JamXmlReader.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- JamXmlReader.java	10 May 2004 22:54:02 -0000	1.4
  +++ JamXmlReader.java	25 May 2004 20:44:44 -0000	1.5
  @@ -201,7 +201,7 @@
         nextElement();
         //REVIEW creating ann for tag is not the right thing to do here.
         //we may need to store more info about exactly what the annotation was
  -      MAnnotation ann = element.addAnnotationForTag(assertCurrentString(NAME));
  +      MAnnotation ann = element.addAnnotation(assertCurrentString(NAME));
         while(ANNOTATIONVALUE.equals(getElementName())) {
           nextElement();
           String name = assertCurrentString(NAME);
  
  
  
  1.19      +15 -6     xml-xmlbeans/v2/src/binding/org/apache/xmlbeans/impl/binding/compile/BindingCompiler.java
  
  Index: BindingCompiler.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/src/binding/org/apache/xmlbeans/impl/binding/compile/BindingCompiler.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- BindingCompiler.java	8 Apr 2004 20:01:00 -0000	1.18
  +++ BindingCompiler.java	25 May 2004 20:44:45 -0000	1.19
  @@ -238,9 +238,13 @@
         (mBuiltinBindingLoader != null) ? mBuiltinBindingLoader :
           BuiltinBindingLoader.getBuiltinBindingLoader(false);
       if (mBaseTylar == null) return builtin;
  -    BindingLoader[] loaders = new BindingLoader[]
  -    { mBaseTylar.getBindingLoader(), builtin };
  -    return CompositeBindingLoader.forPath(loaders);
  +    BindingLoader[] loaders = null;
  +    try {
  +      loaders = new BindingLoader[]{ mBaseTylar.getBindingLoader(), builtin };
  +    } catch(IOException ioe) { logError(ioe);
  +    } catch(XmlException xe) { logError(xe);
  +    }
  +    return (loaders == null) ? builtin : CompositeBindingLoader.forPath(loaders);
     }
   
     /**
  @@ -256,11 +260,16 @@
     public SchemaTypeLoader getBaseSchemaTypeLoader()
     {
       assertCompilationStarted(true);
  -    if (mBaseTylar == null) {
  -      return XmlBeans.getBuiltinTypeSystem();
  +    if (mBaseTylar != null) {
       } else {
  -      return mBaseTylar.getSchemaTypeLoader();
  +      try {
  +        return mBaseTylar.getSchemaTypeLoader();
  +      } catch(IOException ioe) { logError(ioe);
  +      } catch(XmlException xe) { logError(xe);
  +      }
       }
  +    return XmlBeans.getBuiltinTypeSystem();
  +
     }
   
     /**
  
  
  
  1.13      +1 -1      xml-xmlbeans/v2/src/binding/org/apache/xmlbeans/impl/binding/compile/BindingCompilerTask.java
  
  Index: BindingCompilerTask.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/src/binding/org/apache/xmlbeans/impl/binding/compile/BindingCompilerTask.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- BindingCompilerTask.java	15 Apr 2004 20:49:17 -0000	1.12
  +++ BindingCompilerTask.java	25 May 2004 20:44:45 -0000	1.13
  @@ -123,7 +123,7 @@
         throw new BuildException("fatal errors encountered, "+
                                  "see log for details.");
       }
  -    log("binding task complete, output at "+tylar.getLocation());
  +    log("binding task complete, output at "+tylar.getLocations());
     }
   
     // ========================================================================
  
  
  
  1.8       +7 -9      xml-xmlbeans/v2/src/binding/org/apache/xmlbeans/impl/binding/tylar/BaseTylarImpl.java
  
  Index: BaseTylarImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/src/binding/org/apache/xmlbeans/impl/binding/tylar/BaseTylarImpl.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- BaseTylarImpl.java	7 Apr 2004 04:18:10 -0000	1.7
  +++ BaseTylarImpl.java	25 May 2004 20:44:45 -0000	1.8
  @@ -24,9 +24,11 @@
   import org.apache.xmlbeans.*;
   import org.w3.x2001.xmlSchema.SchemaDocument;
   import java.net.URI;
  +import java.net.URL;
  +import java.io.IOException;
   
   /**
  - * <p>Base class for simplifying implementation of the Tylar interface.</p>
  + * @deprecated phasing this out in favor of RuntimeTylar and BuildtimeTylar.
    *
    * @author Patrick Calahan <pcal@bea.com>
    */
  @@ -36,16 +38,14 @@
     // Partial default Tylar implementation
   
     public String getDescription() {
  -    URI uri = getLocation();
  -    if (uri != null) return uri.toString();
       return "["+this.getClass().getName()+"]";
     }
   
  -  public URI getLocation() {
  +  public URL[] getLocations() {
       return null;
     }
   
  -  public BindingLoader getBindingLoader() {
  +  public BindingLoader getBindingLoader() throws IOException, XmlException {
       //REVIEW should consider caching this result
       BindingFile[] bfs = getBindingFiles();
       BindingLoader[] loaders = new BindingLoader[bfs.length+1];
  @@ -56,10 +56,7 @@
   
     public JamClassLoader getJamClassLoader()
     {
  -    // REVIEW should consider caching this result
  -    // create a classloader chain that runs throw all of the base tylars
  -    ClassLoader cl = createClassLoader(ClassLoader.getSystemClassLoader());
  -    return JamServiceFactory.getInstance().createJamClassLoader(cl);
  +    return JamServiceFactory.getInstance().createSystemJamClassLoader();
     }
   
     // ========================================================================
  @@ -73,6 +70,7 @@
      * @return
      */
     protected SchemaTypeSystem getDefaultSchemaTypeSystem()
  +    throws IOException, XmlException
     {
       SchemaDocument[] xsds = getSchemas();
       XmlObject[] xxds = new XmlObject[xsds.length];
  
  
  
  1.4       +6 -12     xml-xmlbeans/v2/src/binding/org/apache/xmlbeans/impl/binding/tylar/CompositeTylar.java
  
  Index: CompositeTylar.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/src/binding/org/apache/xmlbeans/impl/binding/tylar/CompositeTylar.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- CompositeTylar.java	7 Apr 2004 04:18:10 -0000	1.3
  +++ CompositeTylar.java	25 May 2004 20:44:45 -0000	1.4
  @@ -18,15 +18,17 @@
   import org.apache.xmlbeans.impl.binding.bts.BindingFile;
   import org.apache.xmlbeans.XmlBeans;
   import org.apache.xmlbeans.SchemaTypeLoader;
  +import org.apache.xmlbeans.XmlException;
   import org.w3.x2001.xmlSchema.SchemaDocument;
   
   import java.util.Collection;
   import java.util.ArrayList;
   import java.util.Arrays;
   import java.util.Iterator;
  +import java.io.IOException;
   
   /**
  - * Implementation of Tylar which is a composition of other Tylars.
  + * @deprecated I think we'd like to eliminate this class if possible.
    *
    * @author Patrick Calahan <pcal@bea.com>
    */
  @@ -80,7 +82,7 @@
       return "CompositeTylar containing "+mTylars.length+" tylars";
     }
   
  -  public BindingFile[] getBindingFiles() {
  +  public BindingFile[] getBindingFiles() throws IOException, XmlException {
       //REVIEW consider caching
       Collection all = new ArrayList();
       for(int i=0; i<mTylars.length; i++) {
  @@ -91,7 +93,7 @@
       return out;
     }
   
  -  public SchemaDocument[] getSchemas() {
  +  public SchemaDocument[] getSchemas() throws IOException, XmlException {
       //REVIEW consider caching
       Collection all = new ArrayList();
       for(int i=0; i<mTylars.length; i++) {
  @@ -102,7 +104,7 @@
       return out;
     }
   
  -  public SchemaTypeLoader getSchemaTypeLoader() {
  +  public SchemaTypeLoader getSchemaTypeLoader() throws IOException, XmlException {
       if (mTylars.length == 0) return XmlBeans.getBuiltinTypeSystem();
       if (mTylars.length == 1) return mTylars[0].getSchemaTypeLoader();
       SchemaTypeLoader[] sts = new SchemaTypeLoader[mTylars.length];
  @@ -110,13 +112,5 @@
       return XmlBeans.typeLoaderUnion(sts);
   
   
  -  }
  -
  -  public ClassLoader createClassLoader(ClassLoader cl) {
  -    //REVIEW consider caching
  -    for(int i=0; i<mTylars.length; i++) {
  -      cl = mTylars[i].createClassLoader(cl);
  -    }
  -    return cl;
     }
   }
  
  
  
  1.6       +22 -14    xml-xmlbeans/v2/src/binding/org/apache/xmlbeans/impl/binding/tylar/DebugTylarWriter.java
  
  Index: DebugTylarWriter.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/src/binding/org/apache/xmlbeans/impl/binding/tylar/DebugTylarWriter.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- DebugTylarWriter.java	15 Apr 2004 01:50:06 -0000	1.5
  +++ DebugTylarWriter.java	25 May 2004 20:44:45 -0000	1.6
  @@ -21,12 +21,14 @@
   import org.apache.xmlbeans.impl.binding.joust.WriterFactory;
   import org.apache.xmlbeans.XmlOptions;
   import org.apache.xmlbeans.SchemaTypeSystem;
  +import org.apache.xmlbeans.XmlException;
   import org.w3.x2001.xmlSchema.SchemaDocument;
   
   import java.io.IOException;
   import java.io.PrintWriter;
   import java.io.Writer;
   import java.io.File;
  +import java.net.URL;
   
   /**
    * Implementation of TylarWriter which simply dumps everything it gets to some
  @@ -69,21 +71,27 @@
      * @throws IOException
      */
     public void write(Tylar t) throws IOException {
  -    mOut.println("==== Dumping Type Library contents... =================");
  -    mOut.println("location = "+t.getLocation());
  -    mOut.println("description = "+t.getDescription());
  -    BindingFile[] bfs = t.getBindingFiles();
  -    for(int i=0; i<bfs.length; i++) {
  -      mOut.println("---- Binding File -------------------------------------");
  -      writeBindingFile(bfs[i]);
  -    }
  -    SchemaDocument[] xsds = t.getSchemas();
  -    for(int i=0; i<xsds.length; i++) {
  -      mOut.println("---- Schema -------------------------------------------");
  -      writeSchema(xsds[i],null);
  +    try {
  +      mOut.println("==== Dumping Type Library contents... =================");
  +      mOut.println("location = "+t.getLocations());
  +      mOut.println("description = "+t.getDescription());
  +      BindingFile[] bfs = t.getBindingFiles();
  +      for(int i=0; i<bfs.length; i++) {
  +        mOut.println("---- Binding File -------------------------------------");
  +        writeBindingFile(bfs[i]);
  +      }
  +      SchemaDocument[] xsds = t.getSchemas();
  +      for(int i=0; i<xsds.length; i++) {
  +        mOut.println("---- Schema -------------------------------------------");
  +        writeSchema(xsds[i],null);
  +      }
  +      mOut.println("==== End Type Library contents ========================");
  +    } catch(XmlException xe) {
  +      xe.printStackTrace();
  +      throw new IOException(xe.getMessage());
       }
  -    mOut.println("==== End Type Library contents ========================");
       mOut.flush();
  +
     }
   
     // ========================================================================
  @@ -123,7 +131,7 @@
     public static void main(String[] args) {
       try {
         TylarLoader loader = DefaultTylarLoader.getInstance();
  -      Tylar tylar = loader.load(new File(args[0]).toURI());
  +      Tylar tylar = loader.load(new URL[]{new File(args[0]).toURL()});
         new DebugTylarWriter().write(tylar);
       } catch(Exception e) {
         e.printStackTrace();
  
  
  
  1.16      +45 -42    xml-xmlbeans/v2/src/binding/org/apache/xmlbeans/impl/binding/tylar/DefaultTylarLoader.java
  
  Index: DefaultTylarLoader.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/src/binding/org/apache/xmlbeans/impl/binding/tylar/DefaultTylarLoader.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- DefaultTylarLoader.java	13 May 2004 16:41:57 -0000	1.15
  +++ DefaultTylarLoader.java	25 May 2004 20:44:45 -0000	1.16
  @@ -40,16 +40,14 @@
   
     // ========================================================================
     // Constants
  -
  -  private static final String FILE_SCHEME = "file";
  -
  +/*
     private static final char[] OTHER_SEPCHARS = {'\\'};
   
     private static final char SEPCHAR = '/';
   
     private static final boolean VERBOSE = false;
   
  -  private static final String BINDING_FILE_JARENTRY =
  + private static final String BINDING_FILE_JARENTRY =
             normalizeEntryName(TylarConstants.BINDING_FILE).toLowerCase();
   
     private static final String SCHEMA_DIR_JARENTRY =
  @@ -58,6 +56,7 @@
     private static final String SCHEMA_EXT = ".xsd";
   
     private static final String STS_PREFIX = "schema"+SEPCHAR+"system"+SEPCHAR;
  +  */
   
     // ========================================================================
     // Singleton
  @@ -91,43 +90,17 @@
     // ========================================================================
     // Public methods
   
  -  /**
  -   * Loads the tylar from the given uri.
  -   *
  -   * @param uri uri of where the tylar is stored.
  -   * @return
  -   * @throws IOException if an i/o error occurs while processing
  -   * @throws XmlException if an error occurs parsing the contents of the tylar.
  -   */
  -  public Tylar load(URI uri) throws IOException, XmlException
  -  {
  -    if (uri == null) throw new IllegalArgumentException("null uri");
  -    //String scheme = uri.getScheme();
  -    File file = null;
  -    try {
  -      file = new File(uri);
  -    } catch(Exception ignore) {}
  -    if (file != null && file.exists() && file.isDirectory()) {
  -      return ExplodedTylarImpl.load(file);
  -    } else {
  -      return loadFromJar(new JarInputStream(uri.toURL().openStream()),uri);
  -    }
  -  }
  -
  -  public Tylar load(URI[] uris) throws IOException, XmlException {
  -    Tylar[] tylars = new Tylar[uris.length];
  -    for(int i=0; i<tylars.length; i++) {
  -      tylars[i] = load(uris[i]);
  -    }
  -    return new CompositeTylar(tylars);
  +  public Tylar load(URL[] urls) throws IOException, XmlException {
  +    if (urls == null) throw new IllegalArgumentException("null urls");
  +    return new RuntimeTylar(new URLClassLoader(urls),urls);
     }
   
     /**
  -   * @deprecated
  +   *
      */
  -  public Tylar load(JarInputStream jar) throws IOException, XmlException {
  -    if (jar == null) throw new IllegalArgumentException("null stream");
  -    return loadFromJar(jar,null);
  +  public Tylar load(ClassLoader cl) throws IOException, XmlException {
  +    if (cl == null) throw new IllegalArgumentException("null stream");
  +    return new RuntimeTylar(cl);
     }
   
     // ========================================================================
  @@ -145,7 +118,7 @@
      * for informational purposes only and is not required.
      * @return Handle to the tylar
      * @throws IOException
  -   */
  +
     protected static Tylar loadFromJar(JarInputStream jin, URI source)
             throws IOException, XmlException
     {
  @@ -210,14 +183,44 @@
       }
       return new TylarImpl(source,bf,schemas,sts);
     }
  +   */
  +
     // ========================================================================
     // Private methods
  +/*
  +  private static Tylar load(ClassLoader loader,
  +                            String stsName,
  +                            String[] xsds,
  +                            URI source)
  +    throws XmlException, IOException
  +  {
  +    SchemaTypeSystem sts = null;
  +    BindingFile bf = null;
  +    {
  +      InputStream in = loader.getResourceAsStream(BINDING_FILE_JARENTRY);
  +      bf = BindingFile.forDoc(BindingConfigDocument.Factory.parse(in));
  +    }
  +    if (stsName != null) {
  +      try {
  +      sts = SchemaTypeSystemImpl.forName(stsName,loader);
  +      } catch(Exception e) {
  +        ExplodedTylarImpl.showXsbError(e,source,"read",TylarConstants.SHOW_XSB_ERRORS);
  +      }
  +    }
  +    if (sts == null) {
  +
  +    }
  +
  +
  +
  +  }
  +  */
   
     /**
      * Canonicalizes the given zip entry path so that we can look for what
      * we want without having to worry about different slashes or
      * leading slashes or anything else that can go wrong.
  -   */
  +
     private static final String normalizeEntryName(String name) {
       name = name.trim();
       for(int i=0; i<OTHER_SEPCHARS.length; i++) {
  @@ -226,7 +229,7 @@
       if (name.charAt(0) == SEPCHAR) name = name.substring(1);
       return name;
     }
  -
  +   */
   
     /**
      * This is another hack around what I believe is an xbeans bug - it
  @@ -234,7 +237,7 @@
      * to parse a whole bunch of files from the same stream - this class
      * just intercepts the close() call and ignores it until we call
      * reallyClose().
  -   */
  +
     private static class StubbornInputStream extends FilterInputStream {
   
       StubbornInputStream(InputStream in) { super(in); }
  @@ -245,7 +248,7 @@
         super.close();
       }
     }
  -
  +   */
     /**
      * Grab the contents of the current entry and stuffs them into a string -
      * sometimes useful for debugging.
  
  
  
  1.16      +2 -6      xml-xmlbeans/v2/src/binding/org/apache/xmlbeans/impl/binding/tylar/ExplodedTylarImpl.java
  
  Index: ExplodedTylarImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/src/binding/org/apache/xmlbeans/impl/binding/tylar/ExplodedTylarImpl.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- ExplodedTylarImpl.java	15 Apr 2004 22:58:45 -0000	1.15
  +++ ExplodedTylarImpl.java	25 May 2004 20:44:45 -0000	1.16
  @@ -233,17 +233,13 @@
       return out;
     }
   
  -  public SchemaTypeLoader getSchemaTypeLoader() {
  +  public SchemaTypeLoader getSchemaTypeLoader() throws IOException, XmlException {
       if (mSchemaTypeSystem == null) {
         mSchemaTypeSystem = getDefaultSchemaTypeSystem();
       }
       return mSchemaTypeSystem;
     }
   
  -  public URI getLocation() {
  -    return mRootDir.toURI();
  -  }
  -
     //not sure we ever need this
     public void resetCaches() {
       mSchemaDocuments = null;
  @@ -265,7 +261,7 @@
       JarHelper j = new JarHelper();
       jarfile.getParentFile().mkdirs(); //make sure the path exists
       j.jarDir(mRootDir,jarfile);
  -    return new TylarImpl(jarfile.toURI(),mBindingFile,mSchemaDocuments);
  +    return new TylarImpl(new URL[]{jarfile.toURL()},mBindingFile,mSchemaDocuments);
     }
   
     public File getSourceDir() {
  
  
  
  1.9       +23 -24    xml-xmlbeans/v2/src/binding/org/apache/xmlbeans/impl/binding/tylar/Tylar.java
  
  Index: Tylar.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/src/binding/org/apache/xmlbeans/impl/binding/tylar/Tylar.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- Tylar.java	7 Apr 2004 04:18:10 -0000	1.8
  +++ Tylar.java	25 May 2004 20:44:45 -0000	1.9
  @@ -16,10 +16,14 @@
   package org.apache.xmlbeans.impl.binding.tylar;
   
   import java.net.URI;
  +import java.net.URL;
  +import java.io.IOException;
  +
   import org.apache.xmlbeans.impl.binding.bts.BindingFile;
   import org.apache.xmlbeans.impl.binding.bts.BindingLoader;
   import org.apache.xmlbeans.impl.jam.JamClassLoader;
   import org.apache.xmlbeans.SchemaTypeLoader;
  +import org.apache.xmlbeans.XmlException;
   import org.w3.x2001.xmlSchema.SchemaDocument;
   
   /**
  @@ -35,33 +39,24 @@
     // Public methods
   
     /**
  -   * Returns a short textual description of this tylar.  This is primarily
  -   * useful for logging and debugging.
  -   */
  -  public String getDescription();
  -
  -  /**
  -   * Returns a URI describing the location of the physical store from
  -   * which this Tylar was loaded.  This is useful for logging purposes.
  -   */
  -  public URI getLocation();
  -
  -  /**
      * Returns the binding files contained in this Tylar.
      */
  -  public BindingFile[] getBindingFiles();
  +  public BindingFile[] getBindingFiles() throws IOException, XmlException;
   
     /**
  -   * Returns the schema documents contained in this Tylar.
  +   * Returns the schema documents contained in this Tylar.  Note that this
  +   * is an optional operation; Tylars used at runtime (i.e. created by
  +   * a TylarLoader) will typically throw UnsupportedOperationException
  +   * in the implementation of this method.
      */
  -  public SchemaDocument[] getSchemas();
  +  public SchemaDocument[] getSchemas() throws IOException, XmlException;
   
     /**
      * Returns a BindingLoader for the bindings in this tylar.  This is really
      * just a convenience method; it simply returns a composite of the binding
      * files returned by getBindingFiles() plus the BuiltinBindingLoader.
      */
  -  public BindingLoader getBindingLoader();
  +  public BindingLoader getBindingLoader() throws IOException, XmlException;
   
     /**
      * Returns a BindingLoader for the bindings in this tylar.  This is really
  @@ -69,7 +64,7 @@
      * that results from compiling all of the schemas returned by getSchemas()
      * plus the BuiltinSchemaTypeSystem.
      */
  -  public SchemaTypeLoader getSchemaTypeLoader();
  +  public SchemaTypeLoader getSchemaTypeLoader() throws IOException, XmlException;
   
   
     /**
  @@ -78,13 +73,17 @@
      */
     public JamClassLoader getJamClassLoader();
   
  +
  +  /**
  +   * Returns a short textual description of this tylar.  This is primarily
  +   * useful for logging and debugging.
  +   */
  +  public String getDescription();
  +
     /**
  -   * Returns a new ClassLoader that can load any class files contained in
  -   * this tylar.  Returns null if this tylar contains no class resources.
  -   *
  -   * REVIEW are we sure this method is needed?
  -   *
  -   * @param parent The parent for new classloader.
  +   * Returns an array of URLs describing where the tylar resources are being
  +   * loaded from.  This is generally only useful for debugging purposes.
  +   * This method may return null.
      */
  -  public ClassLoader createClassLoader(ClassLoader parent);
  +  public URL[] getLocations();
   }
  
  
  
  1.7       +1 -1      xml-xmlbeans/v2/src/binding/org/apache/xmlbeans/impl/binding/tylar/TylarConstants.java
  
  Index: TylarConstants.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/src/binding/org/apache/xmlbeans/impl/binding/tylar/TylarConstants.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- TylarConstants.java	15 Apr 2004 01:50:06 -0000	1.6
  +++ TylarConstants.java	25 May 2004 20:44:45 -0000	1.7
  @@ -29,7 +29,7 @@
     // ========================================================================
     // Constants
   
  -  public static final char SEP = File.separatorChar;
  +  public static final char SEP = '/';
   
     public static final String SRC_ROOT     = "META-INF"+SEP+"src";
     public static final String BINDING_FILE = "META-INF"+SEP+"binding-file.xml";
  
  
  
  1.8       +12 -18    xml-xmlbeans/v2/src/binding/org/apache/xmlbeans/impl/binding/tylar/TylarImpl.java
  
  Index: TylarImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/src/binding/org/apache/xmlbeans/impl/binding/tylar/TylarImpl.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- TylarImpl.java	15 Apr 2004 01:50:06 -0000	1.7
  +++ TylarImpl.java	25 May 2004 20:44:45 -0000	1.8
  @@ -21,15 +21,17 @@
   import java.net.URLClassLoader;
   import java.util.Collection;
   import java.util.ArrayList;
  +import java.io.IOException;
   
   import org.apache.xmlbeans.impl.binding.bts.BindingFile;
   import org.apache.xmlbeans.impl.binding.joust.JavaOutputStream;
   import org.apache.xmlbeans.SchemaTypeSystem;
   import org.apache.xmlbeans.SchemaTypeLoader;
  +import org.apache.xmlbeans.XmlException;
   import org.w3.x2001.xmlSchema.SchemaDocument;
   
   /**
  - * Simple implementation of Tylar.
  + * @deprecated phasing this out in favor of RuntimeTylar and BuildtimeTylar.
    *
    * @author Patrick Calahan <pcal@bea.com>
    */
  @@ -38,7 +40,7 @@
     // ========================================================================
     // Variables
   
  -  private URI mSourceURI;
  +  private URL[] mLocations;
     private BindingFile mBindingFile = null;
     private Collection mSchemas = null;
     private SchemaTypeSystem mSts = null;
  @@ -50,17 +52,17 @@
   
   
     /**
  -   * @param sourceUri source uri or null
  +   * @param locations source uri or null
      * @param bf the binding file
      * @param schemas the schemas
      * @param sts schema type system (or null)
      */
  -  public TylarImpl(URI sourceUri,
  +  public TylarImpl(URL[] locations,
                      BindingFile bf,
                      Collection schemas,
                      SchemaTypeSystem sts)
     {
  -    mSourceURI = sourceUri;
  +    mLocations = locations;
       mBindingFile = bf;
       mSchemas = schemas;
       mSts = sts;
  @@ -80,23 +82,15 @@
       return out;
     }
   
  -  public SchemaTypeLoader getSchemaTypeLoader() {
  +  public SchemaTypeLoader getSchemaTypeLoader() throws IOException, XmlException {
       if (mSts == null) {
         mSts = getDefaultSchemaTypeSystem();
       }
       return mSts;
     }
   
  -  public URI getLocation() {
  -    return mSourceURI;
  -  }
  -
  -  public ClassLoader createClassLoader(ClassLoader parent) {
  -    try {
  -      return new URLClassLoader(new URL[] {mSourceURI.toURL()},parent);
  -    } catch(MalformedURLException mue){
  -      throw new RuntimeException(mue); //FIXME this is bad
  -    }
  +  public URL[] getLocations() {
  +    return mLocations;
     }
   
     // ========================================================================
  @@ -131,11 +125,11 @@
     /**
      * @deprecated
      */
  -  public TylarImpl(URI sourceUri,
  +  public TylarImpl(URL[] sourceUrls,
                      BindingFile bf,
                      Collection schemas)
     {
  -    this(sourceUri,bf,schemas,null);
  +    this(sourceUrls,bf,schemas,null);
     }
   
   }
  
  
  
  1.6       +6 -21     xml-xmlbeans/v2/src/binding/org/apache/xmlbeans/impl/binding/tylar/TylarLoader.java
  
  Index: TylarLoader.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/src/binding/org/apache/xmlbeans/impl/binding/tylar/TylarLoader.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- TylarLoader.java	12 Feb 2004 20:06:08 -0000	1.5
  +++ TylarLoader.java	25 May 2004 20:44:45 -0000	1.6
  @@ -16,8 +16,7 @@
   package org.apache.xmlbeans.impl.binding.tylar;
   
   import java.io.IOException;
  -import java.net.URI;
  -import java.util.jar.JarInputStream;
  +import java.net.URL;
   
   import org.apache.xmlbeans.XmlException;
   
  @@ -30,40 +29,26 @@
   public interface TylarLoader {
   
     /**
  -   * Loads a single tylar from the given URI.
  +   * Loads a single tylar out of the given ClassLoader.
      *
  -   * @param uri pointing to where the tylar is stored.
  +   * @param cl ClassLoader from which to load the tylar
      * @return
      * @throws IOException if an i/o error occurs while processing
      * @throws XmlException if an error occurs parsing the contents of the tylar.
      */
  -  public Tylar load(URI uri) throws IOException, XmlException;
  +  public Tylar load(ClassLoader cl) throws IOException, XmlException;
   
     /**
      * Returns a composition of the set of tylars at the given URIs.  Tylars
      * will be consulted in the order in which they appear in this array when
      * resolving bindings and types; first one wins.
      *
  -   * @param uris pointing to where the tylars are stored.
  +   * @param urls pointing to where the tylars are stored.
      * @return
      * @throws IOException if an i/o error occurs while processing
      * @throws XmlException if an error occurs parsing the contents of the
      * tylars.
      */
  -  public Tylar load(URI[] uris) throws IOException, XmlException;
  -
  -  /**
  -   * Loads a single tylar from the given JarInputStream.
  -   *
  -   * @param jar input stream on the tylar jar.
  -   * @return
  -   * @throws IOException if an i/o error occurs while processing
  -   * @throws XmlException if an error occurs parsing the contents of the
  -   * tylars.
  -   */
  -  public Tylar load(JarInputStream jar) throws IOException, XmlException;
  -
  -
  -
  +  public Tylar load(URL[] urls) throws IOException, XmlException;
   
   }
  
  
  
  1.1                  xml-xmlbeans/v2/src/binding/org/apache/xmlbeans/impl/binding/tylar/RuntimeTylar.java
  
  Index: RuntimeTylar.java
  ===================================================================
  /*   Copyright 2004 The Apache Software Foundation
   *
   *   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
   *
   *       http://www.apache.org/licenses/LICENSE-2.0
   *
   *   Unless required by applicable law or agreed to in writing, software
   *   distributed under the License is distributed on an "AS IS" BASIS,
   *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   *   See the License for the specific language governing permissions and
   *  limitations under the License.
   */
  package org.apache.xmlbeans.impl.binding.tylar;
  
  import org.apache.xmlbeans.impl.binding.bts.BindingFile;
  import org.apache.xmlbeans.impl.binding.bts.BindingLoader;
  import org.apache.xmlbeans.impl.binding.bts.BuiltinBindingLoader;
  import org.apache.xmlbeans.impl.binding.bts.CompositeBindingLoader;
  import org.apache.xmlbeans.impl.jam.JamClassLoader;
  import org.apache.xmlbeans.impl.jam.JamServiceFactory;
  import org.apache.xmlbeans.impl.schema.SchemaTypeLoaderImpl;
  import org.apache.xmlbeans.impl.schema.BuiltinSchemaTypeSystem;
  import org.apache.xmlbeans.SchemaTypeLoader;
  import org.apache.xmlbeans.XmlException;
  import org.apache.xml.xmlbeans.bindingConfig.BindingConfigDocument;
  import org.w3.x2001.xmlSchema.SchemaDocument;
  
  import java.net.URI;
  import java.net.URL;
  import java.io.IOException;
  import java.io.InputStream;
  import java.util.Enumeration;
  import java.util.List;
  import java.util.ArrayList;
  
  /**
   * <p>An implementation of the Tylar interface which is designed to be used
   * at runtime (i.e. by the Un/Marshallers).  This implementation is as
   * possible about loading resources from a given classloader.  Note that it
   * is strictly read-only; a RuntimeTylar subclass should not try to also
   * implement TylarWriter.</p>
   *
   * <p>RuntimeTylar is optimized for the case where getSchemas() and
   * getBindingFiles() never get called, which is typical of the runtime
   * scenario.  Implementing these methods requires being able to scan the
   * contents of a given directory in the resource path, something not provided
   * by ClassLoader; here, that ability is delegated to subclasses who must
   * implement the abstract method listResourcesInPath().</p>
   *
   * @author Patrick Calahan &lt;email: pcal-at-bea-dot-com&gt;
   */
  public class RuntimeTylar implements Tylar, TylarConstants {
  
    // ========================================================================
    // Variables
  
    private ClassLoader mClassLoader = null;
    private String mDescription = null;
    private URL[] mLocations = null;
    private BindingFile[] mBindingFiles = null;
    private SchemaTypeLoader mSchemaTypeLoader = null;
    private BindingLoader mBindingLoader = null;
    private JamClassLoader mJamClassLoader = null;
  
    // ========================================================================
    // Constructors
  
    /*package*/ RuntimeTylar(ClassLoader loader) {
      if (loader == null) throw new IllegalArgumentException("null loader");
      mClassLoader = loader;
      mLocations = new URL[0];
      mDescription = "loaded from "+loader.toString();
    }
  
  
    /*package*/ RuntimeTylar(ClassLoader loader, URL[] locs)
    {
      if (loader == null) throw new IllegalArgumentException("null loader");
      if (locs == null) throw new IllegalArgumentException("null locs");
      mClassLoader = loader;
      mLocations = locs;
      mDescription = "loaded from "+locs;
    }
  
    // ========================================================================
    // Tylar implementation
  
    public String getDescription() { return mDescription; }
  
    public URL[] getLocations() { return mLocations; }
  
    public BindingLoader getBindingLoader() throws IOException, XmlException {
      if (mBindingLoader == null) {
        BindingFile[] bfs = getBindingFiles();
        BindingLoader[] loaders = new BindingLoader[bfs.length+1];
        System.arraycopy(bfs,0,loaders,0,bfs.length);
        loaders[loaders.length-1] = BuiltinBindingLoader.getBuiltinBindingLoader(false);
        mBindingLoader = CompositeBindingLoader.forPath(loaders);
      }
      return mBindingLoader;
    }
  
    public BindingFile[] getBindingFiles() throws IOException, XmlException {
      if (mBindingFiles == null) {
        List list = new ArrayList();
        Enumeration urls = mClassLoader.getResources(BINDING_FILE);
        while(urls.hasMoreElements()) {
          URL next = (URL)urls.nextElement();
          InputStream in = null;
          try {
            in = next.openStream();
            list.add(BindingFile.forDoc(BindingConfigDocument.Factory.parse(in)));
          } catch(IOException ioe) {
            throw ioe;
          } finally {
            if (in != null) in.close();
          }
        }
        mBindingFiles = new BindingFile[list.size()];
        list.toArray(mBindingFiles);
      }
      return mBindingFiles;
    }
  
    public SchemaDocument[] getSchemas() {
      // if we ever need to implement this, we should probably do it by
      // adding an index file to the schema dir that we can read to see what
      // schema files are out there.  don't think this should ever be needed,
      // though.
      throw new UnsupportedOperationException
        ("SchemaDocuments cannot be retrieved at runtime.");
    }
  
    public SchemaTypeLoader getSchemaTypeLoader() {
      if (mSchemaTypeLoader == null) {
        mSchemaTypeLoader= SchemaTypeLoaderImpl.build
          (new SchemaTypeLoader[] { BuiltinSchemaTypeSystem.get() } ,
           null,
           mClassLoader);
      }
      return mSchemaTypeLoader;
    }
  
    public JamClassLoader getJamClassLoader() {
      if (mJamClassLoader == null) {
       mJamClassLoader =
         JamServiceFactory.getInstance().createJamClassLoader(mClassLoader);
      }
      return mJamClassLoader;
    }
  }
  
  
  1.16      +12 -19    xml-xmlbeans/v2/src/marshal/org/apache/xmlbeans/impl/marshal/BindingContextFactoryImpl.java
  
  Index: BindingContextFactoryImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/src/marshal/org/apache/xmlbeans/impl/marshal/BindingContextFactoryImpl.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- BindingContextFactoryImpl.java	16 Mar 2004 00:55:01 -0000	1.15
  +++ BindingContextFactoryImpl.java	25 May 2004 20:44:46 -0000	1.16
  @@ -30,6 +30,7 @@
   import java.io.File;
   import java.io.IOException;
   import java.net.URI;
  +import java.net.URL;
   import java.util.jar.JarInputStream;
   
   /**
  @@ -38,30 +39,22 @@
   public final class BindingContextFactoryImpl extends BindingContextFactory
   {
   
  -    public BindingContext createBindingContext(URI tylarUri)
  -        throws IOException, XmlException
  -    {
  -        return createBindingContext(new URI[]{tylarUri});
  -    }
  +  public BindingContext createBindingContext(ClassLoader cl) throws IOException, XmlException {
  +    if (cl == null) throw new IllegalArgumentException("null uris");
  +    //FIXME loader class needs to be pluggable
  +    TylarLoader loader = DefaultTylarLoader.getInstance();
  +    if (loader == null) throw new IllegalStateException("null loader");
  +    return createBindingContext(loader.load(cl));
  +  }
   
  -    public BindingContext createBindingContext(URI[] tylarUris)
  +  public BindingContext createBindingContext(URL[] tylarUrls)
           throws IOException, XmlException
       {
  -        if (tylarUris == null) throw new IllegalArgumentException("null uris");
  +        if (tylarUrls == null) throw new IllegalArgumentException("null uris");
           //FIXME loader class needs to be pluggable
           TylarLoader loader = DefaultTylarLoader.getInstance();
           if (loader == null) throw new IllegalStateException("null loader");
  -        return createBindingContext(loader.load(tylarUris));
  -    }
  -
  -    public BindingContext createBindingContext(JarInputStream jar)
  -        throws IOException, XmlException
  -    {
  -        if (jar == null) throw new IllegalArgumentException("null InputStream");
  -        //FIXME loader class needs to be pluggable
  -        TylarLoader loader = DefaultTylarLoader.getInstance();
  -        if (loader == null) throw new IllegalStateException("null TylarLoader");
  -        return createBindingContext(loader.load(jar));
  +        return createBindingContext(loader.load(tylarUrls));
       }
   
       // REVIEW It's unfortunate that we can't expose this method to the public
  @@ -70,6 +63,7 @@
       // Of course, exposing it means we expose Tylar to the public as well,
       // and this should be done with caution.
       public BindingContext createBindingContext(Tylar tylar)
  +      throws IOException, XmlException
       {
           // build the loader chain - this is the binding files plus
           // the builtin loader
  @@ -120,6 +114,5 @@
               UnusedSchemaTypeLoaderProvider.getInstance();
           return createBindingContext(bf, provider);
       }
  -
   
   }
  
  
  
  1.4       +12 -1     xml-xmlbeans/v2/src/marshal/org/apache/xmlbeans/impl/marshal/TylarSchemaTypeLoaderProvider.java
  
  Index: TylarSchemaTypeLoaderProvider.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/src/marshal/org/apache/xmlbeans/impl/marshal/TylarSchemaTypeLoaderProvider.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- TylarSchemaTypeLoaderProvider.java	18 Apr 2004 19:28:31 -0000	1.3
  +++ TylarSchemaTypeLoaderProvider.java	25 May 2004 20:44:46 -0000	1.4
  @@ -16,8 +16,11 @@
   package org.apache.xmlbeans.impl.marshal;
   
   import org.apache.xmlbeans.SchemaTypeLoader;
  +import org.apache.xmlbeans.XmlException;
   import org.apache.xmlbeans.impl.binding.tylar.Tylar;
   
  +import java.io.IOException;
  +
   final class TylarSchemaTypeLoaderProvider
       implements SchemaTypeLoaderProvider
   {
  @@ -32,7 +35,15 @@
       public SchemaTypeLoader getSchemaTypeLoader()
       {
           if (schemaTypeLoader == null) {
  -            schemaTypeLoader = tylar.getSchemaTypeLoader();
  +            try {
  +              schemaTypeLoader = tylar.getSchemaTypeLoader();
  +              //REVIEW - Scott: this method throws now, not sure how you
  +              //want to handle it.
  +            } catch(IOException ioe) {
  +              ioe.printStackTrace();
  +            } catch(XmlException xe) {
  +              xe.printStackTrace();
  +            }
           }
           assert schemaTypeLoader != null;
           return schemaTypeLoader;
  
  
  
  1.8       +39 -21    xml-xmlbeans/v2/src/xmlpublic/org/apache/xmlbeans/BindingContextFactory.java
  
  Index: BindingContextFactory.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/src/xmlpublic/org/apache/xmlbeans/BindingContextFactory.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- BindingContextFactory.java	12 Feb 2004 20:06:27 -0000	1.7
  +++ BindingContextFactory.java	25 May 2004 20:44:46 -0000	1.8
  @@ -18,6 +18,7 @@
   
   import java.io.IOException;
   import java.net.URI;
  +import java.net.URL;
   import java.util.jar.JarInputStream;
   
   /**
  @@ -38,42 +39,27 @@
      * The order in which tylars appear in the array determines their precedence
      * for loading types.
      *
  -   * @param tylarUris An array of URIs which identify the tylars to be used
  +   * @param tylarUrls An array of URLs which identify the tylars to be used
      * in the BindingContext.
      * @return The BindingContext
      * @throws IOException if a problem occurs while opening or parsing the
      * contents of the tylars.
      */
  -  public abstract BindingContext createBindingContext(URI[] tylarUris)
  +  public abstract BindingContext createBindingContext(URL[] tylarUrls)
             throws IOException, XmlException;
   
     /**
  -   * Creates a BindingContext from a tylar located at the given URI.
  -   * The order in which tylars appear in the array determines their precedence
  -   * for loading types.
  +   * Creates a BindingContext which loads tylar resources out of the
  +   * given ClassLoader.
      *
  -   * @param tylarUri A URIs to the tylar to be used in the BindingContext.
  -   * @return The BindingContext
  +   * @param cl the classloader on which the tylar(s) can be loaded.
      * @throws IOException if a problem occurs while opening or parsing the
      * contents of the tylars.
      */
  -  public abstract BindingContext createBindingContext(URI tylarUri)
  -          throws IOException, XmlException;
  -
  -  /**
  -   * Creates a BindingContext given an input stream on a type library.
  -   *
  -   * @param jar Input stream on the type library jar.
  -   * @return
  -   * @throws IOException If an error occurs reading the stream.
  -   * @throws XmlException If an error occurs parsing the contents of the
  -   * type library.
  -   */
  -  public abstract BindingContext createBindingContext(JarInputStream jar)
  +  public abstract BindingContext createBindingContext(ClassLoader cl)
             throws IOException, XmlException;
   
   
  -
     protected final static String DEFAULT_IMPL =
             "org.apache.xmlbeans.impl.marshal.BindingContextFactoryImpl";
   
  @@ -95,5 +81,37 @@
         throw new XmlRuntimeException(e);
       }
     }
  +
  +
  +  // ========================================================================
  +  // deprecated methods
  +
  +  /**
  +   * @deprecated
  +   */
  +  public BindingContext createBindingContext(URI[] tylarUris)
  +    throws IOException, XmlException {
  +    URL[] urls = new URL[tylarUris.length];
  +    for(int i=0; i<urls.length; i++) urls[i] = new URL(tylarUris.toString());
  +    return createBindingContext(urls);
  +  }
  +
  +  /**
  +   * @deprecated
  +   */ 
  +  public BindingContext createBindingContext(URI tylarUri)
  +    throws IOException, XmlException {
  +    return createBindingContext(new URI[]{tylarUri});
  +  }
  +
  +  /**
  +   * @deprecated
  +   */
  +  public BindingContext createBindingContext(JarInputStream jar)
  +          throws IOException, XmlException {
  +    throw new UnsupportedOperationException
  +      ("Creating a BindingContext from a JarInputStream is no longer supported.");
  +  }
  +
   
   }
  
  
  
  1.66      +3 -3      xml-xmlbeans/v2/test/src/drt/drtcases/MarshalTests.java
  
  Index: MarshalTests.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/test/src/drt/drtcases/MarshalTests.java,v
  retrieving revision 1.65
  retrieving revision 1.66
  diff -u -r1.65 -r1.66
  --- MarshalTests.java	21 May 2004 01:20:09 -0000	1.65
  +++ MarshalTests.java	25 May 2004 20:44:46 -0000	1.66
  @@ -1603,19 +1603,19 @@
           s2j.bindAsExplodedTylar(tmpfile);
   
   
  -        final URI tylar_uri = tmpfile.toURI();
  +        final URL tylar_url = tmpfile.toURL();
   
           //add tylar to classpath so we can load classes out of it
           final Thread thread = Thread.currentThread();
           final ClassLoader curr_cl = thread.getContextClassLoader();
           final URLClassLoader cl =
  -            new URLClassLoader(new URL[]{tylar_uri.toURL()}, curr_cl);
  +            new URLClassLoader(new URL[]{tylar_url}, curr_cl);
           thread.setContextClassLoader(cl);
   
           try {
               final BindingContextFactory bcf = BindingContextFactory.newInstance();
               final BindingContext binding_context =
  -                bcf.createBindingContext(tylar_uri);
  +                bcf.createBindingContext(new URL[]{tylar_url});
               final Unmarshaller um = binding_context.createUnmarshaller();
               InputStream is = new FileInputStream(instance);
               XmlOptions opts_validation_on = new XmlOptions();
  
  
  

---------------------------------------------------------------------
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