You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by ne...@apache.org on 2003/01/17 11:12:33 UTC

cvs commit: xml-xerces/java/src/org/apache/xerces/impl/xs/models CMNodeFactory.java CMBuilder.java

neeraj      2003/01/17 02:12:33

  Modified:    java/src/org/apache/xerces/impl/xs/models CMNodeFactory.java
                        CMBuilder.java
  Log:
  Function to create instances of different node types should return CMNode type. Resetting the node counter
  once we are finished building content model.
  
  Revision  Changes    Path
  1.2       +9 -4      xml-xerces/java/src/org/apache/xerces/impl/xs/models/CMNodeFactory.java
  
  Index: CMNodeFactory.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/xs/models/CMNodeFactory.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- CMNodeFactory.java	16 Jan 2003 18:33:01 -0000	1.1
  +++ CMNodeFactory.java	17 Jan 2003 10:12:33 -0000	1.2
  @@ -111,7 +111,7 @@
       }
       
       public void reset(XMLComponentManager componentManager){
  -            fErrorReporter = (XMLErrorReporter)componentManager.getProperty(ERROR_REPORTER);
  +        fErrorReporter = (XMLErrorReporter)componentManager.getProperty(ERROR_REPORTER);
           try {
               fSecurityManager = (SecurityManager)componentManager.getProperty(SECURITY_MANAGER);
               //we are setting the limit of number of nodes to 3times the maxOccur value..
  @@ -122,19 +122,20 @@
           catch (XMLConfigurationException e) {
               fSecurityManager = null;
           }
  +        
       }//reset()
       
  -    public XSCMLeaf getCMLeafNode(int type, Object leaf, int id, int position) {
  +    public CMNode getCMLeafNode(int type, Object leaf, int id, int position) {
           nodeCountCheck() ;
           return new XSCMLeaf(type, leaf, id, position) ;
       }
       
  -    public XSCMUniOp getCMUniOpNode(int type, CMNode childNode) {
  +    public CMNode getCMUniOpNode(int type, CMNode childNode) {
           nodeCountCheck();
           return new XSCMUniOp(type, childNode) ;
       }
       
  -    public XSCMBinOp getCMBinOpNode(int type, CMNode leftNode, CMNode rightNode) {
  +    public CMNode getCMBinOpNode(int type, CMNode leftNode, CMNode rightNode) {
           nodeCountCheck() ;
           return new XSCMBinOp(type, leftNode, rightNode) ;
       }
  @@ -150,6 +151,10 @@
           
       }//nodeCountCheck()
   
  +    //reset the node count
  +    public void resetNodeCount(){
  +        nodeCount = 0 ;
  +    }
           /**
        * Sets the value of a property. This method is called by the component
        * manager any time after reset when a property changes value.
  
  
  
  1.16      +5 -1      xml-xerces/java/src/org/apache/xerces/impl/xs/models/CMBuilder.java
  
  Index: CMBuilder.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/xs/models/CMBuilder.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- CMBuilder.java	16 Jan 2003 18:40:29 -0000	1.15
  +++ CMBuilder.java	17 Jan 2003 10:12:33 -0000	1.16
  @@ -142,6 +142,10 @@
               cmValidator = createDFACM(particle);
           }
   
  +        //now we are throught building content model and have passed sucessfully of the nodecount check
  +        //if set by the application        
  +        fNodeFactory.resetNodeCount() ;
  +        
           // if the validator returned is null, it means there is nothing in
           // the content model, so we return the empty content model.
           if (cmValidator == null)
  
  
  

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