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

cvs commit: xml-xerces/java/src/org/apache/xerces/impl/xs XSDDescription.java

sandygao    2003/01/07 14:47:11

  Modified:    java/src/org/apache/xerces/impl/xs XSDDescription.java
  Log:
  Implement the new grammar description interface for XML Schema grammars.
  
  Revision  Changes    Path
  1.8       +9 -14     xml-xerces/java/src/org/apache/xerces/impl/xs/XSDDescription.java
  
  Index: XSDDescription.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/xs/XSDDescription.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- XSDDescription.java	24 Jun 2002 20:21:40 -0000	1.7
  +++ XSDDescription.java	7 Jan 2003 22:47:11 -0000	1.8
  @@ -57,6 +57,7 @@
   
   package org.apache.xerces.impl.xs;
   
  +import org.apache.xerces.xni.grammars.XMLSchemaDescription;
   import org.apache.xerces.xni.grammars.XMLGrammarDescription;
   import org.apache.xerces.util.XMLResourceIdentifierImpl;
   import org.apache.xerces.xni.QName;
  @@ -71,7 +72,7 @@
    * @version $Id$
    */
   public class XSDDescription extends XMLResourceIdentifierImpl 
  -                implements XMLGrammarDescription {
  +                implements XMLSchemaDescription {
       // used to indicate what triggered the call
       /**
        * Indicate that this description was just initialized. 
  @@ -224,18 +225,12 @@
        * @return     True if they are equal, else false
        */
       public boolean equals(Object descObj) {
  -        if(!(descObj instanceof XMLGrammarDescription)) return false;
  -        XMLGrammarDescription desc = (XMLGrammarDescription)descObj;
  -        if (!getGrammarType().equals(desc.getGrammarType())) {
  -            return false;
  -        }
  -        if (fTargetNamespace != null && fTargetNamespace.equals(((XSDDescription)desc).getTargetNamespace())) {
  -            return true;
  -        }
  -        else if (fTargetNamespace == null && ((XSDDescription)desc).getTargetNamespace() == null) {
  -            return true;
  -        }
  -        return false;
  +        if(!(descObj instanceof XMLSchemaDescription)) return false;
  +        XMLSchemaDescription desc = (XMLSchemaDescription)descObj;
  +        if (fTargetNamespace != null)
  +            return fTargetNamespace.equals(desc.getTargetNamespace());
  +        else // fTargetNamespace == null
  +            return desc.getTargetNamespace() == null;
       }
       
       /**
  
  
  

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