You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xmlbeans-cvs@xml.apache.org by pc...@apache.org on 2004/03/09 20:24:25 UTC

cvs commit: xml-xmlbeans/v2/src/binding/org/apache/xmlbeans/impl/binding/compile BindingCompiler.java

pcal        2004/03/09 11:24:25

  Modified:    v2/src/binding/org/apache/xmlbeans/impl/binding/compile
                        BindingCompiler.java
  Log:
  
  
  Revision  Changes    Path
  1.12      +23 -5     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.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- BindingCompiler.java	12 Feb 2004 20:06:07 -0000	1.11
  +++ BindingCompiler.java	9 Mar 2004 19:24:25 -0000	1.12
  @@ -18,6 +18,7 @@
   import org.apache.xmlbeans.impl.binding.tylar.*;
   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.binding.logger.BindingLogger;
   import org.apache.xmlbeans.impl.jam.JClassLoader;
   import org.apache.xmlbeans.impl.jam.JFactory;
  @@ -51,6 +52,7 @@
   
     private Tylar mBaseTylar = null;
     private boolean mIsCompilationStarted = false;
  +  private BindingLoader mBuiltinBindingLoader = null;
   
     // ========================================================================
     // Constructors
  @@ -196,11 +198,13 @@
      */
     public BindingLoader getBaseBindingLoader() {
       assertCompilationStarted(true);
  -    if (mBaseTylar == null) {
  -      return BuiltinBindingLoader.getInstance();
  -    } else {
  -      return mBaseTylar.getBindingLoader();
  -    }
  +    BindingLoader builtin =
  +      (mBuiltinBindingLoader != null) ? mBuiltinBindingLoader :
  +        BuiltinBindingLoader.getInstance();
  +    if (mBaseTylar == null) return builtin;
  +    BindingLoader[] loaders = new BindingLoader[]
  +    { mBaseTylar.getBindingLoader(), mBuiltinBindingLoader };
  +    return CompositeBindingLoader.forPath(loaders);
     }
   
     /**
  @@ -261,6 +265,20 @@
                  "binding compilation has begun");
       }
     }
  +
  +  /**
  +   * <p>Sets the builtin binding loader to use.  By default, this is
  +   * simply BuiltinBindingLoader.getInstance().  This method should
  +   * remain protected - user code should not be setting this directly,
  +   * though they may set it indirectly via, for example, a 'binding style'
  +   * switch.</p>
  +   * @param bl
  +   */
  +  protected void setBuiltinBindingLoader(BindingLoader bl) {
  +    mBuiltinBindingLoader = bl;
  +  }
  +
  +
   
     // ========================================================================
     // Private methods
  
  
  

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