villard     2003/07/31 08:56:30

  Modified:    java/xpath_rwapi/src2/org/apache/xpath/impl/parser Tag:
                        xslt20 XPathVisitor.java XPathTreeConstants.java
                        XPath.java NodeFactory.java SimpleNode.java
               java/xpath_rwapi/grammar Tag: xslt20 etree.xsl
  Added:       java/xpath_rwapi/src2/org/apache/xpath/impl/parser Tag:
                        xslt20 DefaultNodeFactory.java .cvsignore
               java/xpath_rwapi Tag: xslt20 .cvsignore
  Removed:     java/xpath_rwapi/src2/org/apache/xpath/impl Tag: xslt20
                        DefaultNodeFactory.java
  Log:
  Cleaner way to create application node factory. (see javadoc for more details)
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.6   +1 -1      
xml-xalan/java/xpath_rwapi/src2/org/apache/xpath/impl/parser/Attic/XPathVisitor.java
  
  Index: XPathVisitor.java
  ===================================================================
  RCS file: 
/home/cvs//xml-xalan/java/xpath_rwapi/src2/org/apache/xpath/impl/parser/Attic/XPathVisitor.java,v
  retrieving revision 1.1.2.5
  retrieving revision 1.1.2.6
  diff -u -r1.1.2.5 -r1.1.2.6
  --- XPathVisitor.java 31 Jul 2003 03:03:30 -0000      1.1.2.5
  +++ XPathVisitor.java 31 Jul 2003 15:56:29 -0000      1.1.2.6
  @@ -1,4 +1,4 @@
  -/* Generated By:JJTree: Do not edit this line. 
F:/projets/xml-xalan-xslt20/xml-xalan/java/xpath_rwapi/src2/org/apache/xpath/impl/parser\XPathVisitor.java
 */
  +/* Generated By:JJTree: Do not edit this line. 
D:/projects/xml-xalan-xslt20/xpath_rwapi/src2/org/apache/xpath/impl/parser\XPathVisitor.java
 */
   
   package org.apache.xpath.impl.parser;
   
  
  
  
  1.1.2.7   +1 -1      
xml-xalan/java/xpath_rwapi/src2/org/apache/xpath/impl/parser/Attic/XPathTreeConstants.java
  
  Index: XPathTreeConstants.java
  ===================================================================
  RCS file: 
/home/cvs//xml-xalan/java/xpath_rwapi/src2/org/apache/xpath/impl/parser/Attic/XPathTreeConstants.java,v
  retrieving revision 1.1.2.6
  retrieving revision 1.1.2.7
  diff -u -r1.1.2.6 -r1.1.2.7
  --- XPathTreeConstants.java   31 Jul 2003 03:03:30 -0000      1.1.2.6
  +++ XPathTreeConstants.java   31 Jul 2003 15:56:29 -0000      1.1.2.7
  @@ -1,4 +1,4 @@
  -/* Generated By:JJTree: Do not edit this line. 
F:/projets/xml-xalan-xslt20/xml-xalan/java/xpath_rwapi/src2/org/apache/xpath/impl/parser\XPathTreeConstants.java
 */
  +/* Generated By:JJTree: Do not edit this line. 
D:/projects/xml-xalan-xslt20/xpath_rwapi/src2/org/apache/xpath/impl/parser\XPathTreeConstants.java
 */
   
   package org.apache.xpath.impl.parser;
   
  
  
  
  1.1.2.8   +5 -9      
xml-xalan/java/xpath_rwapi/src2/org/apache/xpath/impl/parser/Attic/XPath.java
  
  Index: XPath.java
  ===================================================================
  RCS file: 
/home/cvs//xml-xalan/java/xpath_rwapi/src2/org/apache/xpath/impl/parser/Attic/XPath.java,v
  retrieving revision 1.1.2.7
  retrieving revision 1.1.2.8
  diff -u -r1.1.2.7 -r1.1.2.8
  --- XPath.java        31 Jul 2003 03:03:30 -0000      1.1.2.7
  +++ XPath.java        31 Jul 2003 15:56:29 -0000      1.1.2.8
  @@ -13,21 +13,17 @@
       /**
        * Node factory for customized parser.  
        */
  -    NodeFactory m_nodeFactory;
  -
  -    /**
  -     * Sets the node factory.  
  -     * @param nodeFactory to use.
  -     */
  -    public void setNodeFactory(NodeFactory nodeFactory) {
  -        m_nodeFactory = nodeFactory;
  -    }
  +    private NodeFactory m_nodeFactory;
   
       /**
        * Returns the node factory.  
        * @return NodeFactory
        */
       public NodeFactory getNodeFactory() {
  +        if (m_nodeFactory == null)
  +        {
  +                m_nodeFactory = DefaultNodeFactory.createNodeFactory();
  +        }
           return m_nodeFactory;
       }
   
  
  
  
  1.1.2.5   +1 -0      
xml-xalan/java/xpath_rwapi/src2/org/apache/xpath/impl/parser/Attic/NodeFactory.java
  
  Index: NodeFactory.java
  ===================================================================
  RCS file: 
/home/cvs//xml-xalan/java/xpath_rwapi/src2/org/apache/xpath/impl/parser/Attic/NodeFactory.java,v
  retrieving revision 1.1.2.4
  retrieving revision 1.1.2.5
  diff -u -r1.1.2.4 -r1.1.2.5
  --- NodeFactory.java  31 Jul 2003 02:29:28 -0000      1.1.2.4
  +++ NodeFactory.java  31 Jul 2003 15:56:29 -0000      1.1.2.5
  @@ -69,6 +69,7 @@
   /**
    * Applications which want to generate their own AST need to implement this
    * interface.
  + * <p></p>
    *
    * @see org.apache.xpath.impl.parser.XPathTreeConstants
    */
  
  
  
  1.1.2.15  +11 -29    
xml-xalan/java/xpath_rwapi/src2/org/apache/xpath/impl/parser/Attic/SimpleNode.java
  
  Index: SimpleNode.java
  ===================================================================
  RCS file: 
/home/cvs//xml-xalan/java/xpath_rwapi/src2/org/apache/xpath/impl/parser/Attic/SimpleNode.java,v
  retrieving revision 1.1.2.14
  retrieving revision 1.1.2.15
  diff -u -r1.1.2.14 -r1.1.2.15
  --- SimpleNode.java   31 Jul 2003 02:29:28 -0000      1.1.2.14
  +++ SimpleNode.java   31 Jul 2003 15:56:29 -0000      1.1.2.15
  @@ -5,7 +5,6 @@
   import org.apache.xpath.impl.CastOrTreatAsExprImpl;
   import org.apache.xpath.impl.CastableAsExprImpl;
   import org.apache.xpath.impl.ConditionalExprImpl;
  -import org.apache.xpath.impl.DefaultNodeFactory;
   import org.apache.xpath.impl.ExpressionFactoryImpl;
   import org.apache.xpath.impl.ForAndQuantifiedExprImpl;
   import org.apache.xpath.impl.FunctionCallImpl;
  @@ -27,23 +26,25 @@
   {
       public static boolean PRODUCE_RAW_TREE = false;
       
  -    final static private NodeFactory DEFAULT_NODE_FACTORY = new 
DefaultNodeFactory();
  -    
  -    /**
  -     * List of child nodes
  -     */
  -    protected Node[] m_children; 
  +     static ExpressionFactory m_exprFact = new ExpressionFactoryImpl();
  +
  +    protected Node[] m_children; // to remove
       
       protected int id; // to remove
   
  +     protected static ExpressionFactory getExpressionFactory()
  +     {
  +             return m_exprFact;
  +     }
  +
  +     // Constructors
  +
       protected SimpleNode()
       {
       }
   
       /**
        * Creates a new SimpleNode object.
  -     *
  -     * @param i DOCUMENT ME!
        */
       public SimpleNode(int i)
       {
  @@ -52,30 +53,12 @@
   
       /**
        * Creates a new SimpleNode object.
  -     *
  -     * @param p DOCUMENT ME!
  -     * @param i DOCUMENT ME!
        */
       public SimpleNode(XPath p, int i)
       {
           this(i);
       }
   
  -     static ExpressionFactory m_exprFact = new ExpressionFactoryImpl();
  -
  -     protected static ExpressionFactory getExpressionFactory()
  -     {
  -             return m_exprFact;
  -     }
  -
  -    /**
  -     * DOCUMENT ME!
  -     *
  -     * @param p DOCUMENT ME!
  -     * @param id DOCUMENT ME!
  -     *
  -     * @return DOCUMENT ME!
  -     */
       public static Node jjtCreate(XPath p, int id)
       {
           if (PRODUCE_RAW_TREE)
  @@ -84,8 +67,7 @@
           }
   
           Node newNode;
  -        NodeFactory nodeFactory = (p.m_nodeFactory == null)
  -            ? DEFAULT_NODE_FACTORY : p.m_nodeFactory;
  +        NodeFactory nodeFactory = p.getNodeFactory();
   
           switch (id)
           {
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.5   +52 -39    
xml-xalan/java/xpath_rwapi/src2/org/apache/xpath/impl/parser/Attic/DefaultNodeFactory.java
  
  
  
  
  1.1.2.1   +1 -0      
xml-xalan/java/xpath_rwapi/src2/org/apache/xpath/impl/parser/Attic/.cvsignore
  
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.1   +1 -0      xml-xalan/java/xpath_rwapi/Attic/.cvsignore
  
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.6   +5 -9      xml-xalan/java/xpath_rwapi/grammar/Attic/etree.xsl
  
  Index: etree.xsl
  ===================================================================
  RCS file: /home/cvs//xml-xalan/java/xpath_rwapi/grammar/Attic/etree.xsl,v
  retrieving revision 1.1.2.5
  retrieving revision 1.1.2.6
  diff -u -r1.1.2.5 -r1.1.2.6
  --- etree.xsl 31 Jul 2003 03:03:30 -0000      1.1.2.5
  +++ etree.xsl 31 Jul 2003 15:56:30 -0000      1.1.2.6
  @@ -31,21 +31,17 @@
       /**
        * Node factory for customized parser.  
        */
  -    NodeFactory m_nodeFactory;
  -
  -    /**
  -     * Sets the node factory.  
  -     * @param nodeFactory to use.
  -     */
  -    public void setNodeFactory(NodeFactory nodeFactory) {                    
  -     m_nodeFactory = nodeFactory;
  -    }
  +    private NodeFactory m_nodeFactory;
   
       /**
        * Returns the node factory.  
        * @return NodeFactory
        */
       public NodeFactory getNodeFactory() {
  +     if (m_nodeFactory == null)
  +     {
  +             m_nodeFactory = DefaultNodeFactory.createNodeFactory();
  +     }
        return m_nodeFactory;
       }
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to