< prev index next >

src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDKeyrefTraverser.java

Print this page
rev 2127 : 8048021: Remove @version tag in jaxp repo
Reviewed-by: joehw


  18  * limitations under the License.
  19  */
  20 
  21 package com.sun.org.apache.xerces.internal.impl.xs.traversers;
  22 
  23 import com.sun.org.apache.xerces.internal.impl.xs.SchemaGrammar;
  24 import com.sun.org.apache.xerces.internal.impl.xs.SchemaSymbols;
  25 import com.sun.org.apache.xerces.internal.impl.xs.XSElementDecl;
  26 import com.sun.org.apache.xerces.internal.impl.xs.identity.IdentityConstraint;
  27 import com.sun.org.apache.xerces.internal.impl.xs.identity.KeyRef;
  28 import com.sun.org.apache.xerces.internal.impl.xs.identity.UniqueOrKey;
  29 import com.sun.org.apache.xerces.internal.xni.QName;
  30 import org.w3c.dom.Element;
  31 
  32 /**
  33  * This class contains code that is used to traverse <keyref>s.
  34  *
  35  * @xerces.internal
  36  *
  37  * @author Neil Graham, IBM
  38  * @version $Id: XSDKeyrefTraverser.java,v 1.7 2010-11-01 04:40:02 joehw Exp $
  39  */
  40 class XSDKeyrefTraverser extends XSDAbstractIDConstraintTraverser {
  41 
  42     public XSDKeyrefTraverser (XSDHandler handler,
  43                                   XSAttributeChecker gAttrCheck) {
  44         super(handler, gAttrCheck);
  45     }
  46 
  47     void traverse(Element krElem, XSElementDecl element,
  48             XSDocumentInfo schemaDoc, SchemaGrammar grammar) {
  49 
  50         // General Attribute Checking
  51         Object[] attrValues = fAttrChecker.checkAttributes(krElem, false, schemaDoc);
  52 
  53         // create identity constraint
  54         String krName = (String)attrValues[XSAttributeChecker.ATTIDX_NAME];
  55         if(krName == null){
  56             reportSchemaError("s4s-att-must-appear", new Object [] {SchemaSymbols.ELT_KEYREF , SchemaSymbols.ATT_NAME }, krElem);
  57             //return this array back to pool
  58             fAttrChecker.returnAttrArray(attrValues, schemaDoc);




  18  * limitations under the License.
  19  */
  20 
  21 package com.sun.org.apache.xerces.internal.impl.xs.traversers;
  22 
  23 import com.sun.org.apache.xerces.internal.impl.xs.SchemaGrammar;
  24 import com.sun.org.apache.xerces.internal.impl.xs.SchemaSymbols;
  25 import com.sun.org.apache.xerces.internal.impl.xs.XSElementDecl;
  26 import com.sun.org.apache.xerces.internal.impl.xs.identity.IdentityConstraint;
  27 import com.sun.org.apache.xerces.internal.impl.xs.identity.KeyRef;
  28 import com.sun.org.apache.xerces.internal.impl.xs.identity.UniqueOrKey;
  29 import com.sun.org.apache.xerces.internal.xni.QName;
  30 import org.w3c.dom.Element;
  31 
  32 /**
  33  * This class contains code that is used to traverse <keyref>s.
  34  *
  35  * @xerces.internal
  36  *
  37  * @author Neil Graham, IBM

  38  */
  39 class XSDKeyrefTraverser extends XSDAbstractIDConstraintTraverser {
  40 
  41     public XSDKeyrefTraverser (XSDHandler handler,
  42                                   XSAttributeChecker gAttrCheck) {
  43         super(handler, gAttrCheck);
  44     }
  45 
  46     void traverse(Element krElem, XSElementDecl element,
  47             XSDocumentInfo schemaDoc, SchemaGrammar grammar) {
  48 
  49         // General Attribute Checking
  50         Object[] attrValues = fAttrChecker.checkAttributes(krElem, false, schemaDoc);
  51 
  52         // create identity constraint
  53         String krName = (String)attrValues[XSAttributeChecker.ATTIDX_NAME];
  54         if(krName == null){
  55             reportSchemaError("s4s-att-must-appear", new Object [] {SchemaSymbols.ELT_KEYREF , SchemaSymbols.ATT_NAME }, krElem);
  56             //return this array back to pool
  57             fAttrChecker.returnAttrArray(attrValues, schemaDoc);


< prev index next >