< prev index next >

src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDSimpleTypeTraverser.java

Print this page


   1 /*
   2  * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
   3  * @LastModified: Nov 2017
   4  */
   5 /*
   6  * Licensed to the Apache Software Foundation (ASF) under one or more
   7  * contributor license agreements.  See the NOTICE file distributed with
   8  * this work for additional information regarding copyright ownership.
   9  * The ASF licenses this file to You under the Apache License, Version 2.0
  10  * (the "License"); you may not use this file except in compliance with
  11  * the License.  You may obtain a copy of the License at
  12  *
  13  *      http://www.apache.org/licenses/LICENSE-2.0
  14  *
  15  * Unless required by applicable law or agreed to in writing, software
  16  * distributed under the License is distributed on an "AS IS" BASIS,
  17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  18  * See the License for the specific language governing permissions and
  19  * limitations under the License.
  20  */
  21 
  22 package com.sun.org.apache.xerces.internal.impl.xs.traversers;
  23 


  60  * <list
  61  *   id = ID
  62  *   itemType = QName
  63  *   {any attributes with non-schema namespace . . .}>
  64  *   Content: (annotation?, (simpleType?))
  65  * </list>
  66  *
  67  * <union
  68  *   id = ID
  69  *   memberTypes = List of QName
  70  *   {any attributes with non-schema namespace . . .}>
  71  *   Content: (annotation?, (simpleType*))
  72  * </union>
  73  *
  74  * @xerces.internal
  75  *
  76  * @author Elena Litani, IBM
  77  * @author Neeraj Bajaj, Sun Microsystems, Inc.
  78  * @author Sandy Gao, IBM
  79  *

  80  */
  81 class XSDSimpleTypeTraverser extends XSDAbstractTraverser {
  82 
  83     // whether the type being parsed is a S4S built-in type.
  84     private boolean fIsBuiltIn = false;
  85 
  86     XSDSimpleTypeTraverser (XSDHandler handler,
  87             XSAttributeChecker gAttrCheck) {
  88         super(handler, gAttrCheck);
  89     }
  90 
  91     //return qualified name of simpleType or empty string if error occured
  92     XSSimpleType traverseGlobal(Element elmNode,
  93             XSDocumentInfo schemaDoc,
  94             SchemaGrammar grammar) {
  95 
  96         // General Attribute Checking
  97         Object[] attrValues = fAttrChecker.checkAttributes(elmNode, true, schemaDoc);
  98         String nameAtt = (String)attrValues[XSAttributeChecker.ATTIDX_NAME];
  99         if (nameAtt == null) {


   1 /*
   2  * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.

   3  */
   4 /*
   5  * Licensed to the Apache Software Foundation (ASF) under one or more
   6  * contributor license agreements.  See the NOTICE file distributed with
   7  * this work for additional information regarding copyright ownership.
   8  * The ASF licenses this file to You under the Apache License, Version 2.0
   9  * (the "License"); you may not use this file except in compliance with
  10  * the License.  You may obtain a copy of the License at
  11  *
  12  *      http://www.apache.org/licenses/LICENSE-2.0
  13  *
  14  * Unless required by applicable law or agreed to in writing, software
  15  * distributed under the License is distributed on an "AS IS" BASIS,
  16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  17  * See the License for the specific language governing permissions and
  18  * limitations under the License.
  19  */
  20 
  21 package com.sun.org.apache.xerces.internal.impl.xs.traversers;
  22 


  59  * <list
  60  *   id = ID
  61  *   itemType = QName
  62  *   {any attributes with non-schema namespace . . .}>
  63  *   Content: (annotation?, (simpleType?))
  64  * </list>
  65  *
  66  * <union
  67  *   id = ID
  68  *   memberTypes = List of QName
  69  *   {any attributes with non-schema namespace . . .}>
  70  *   Content: (annotation?, (simpleType*))
  71  * </union>
  72  *
  73  * @xerces.internal
  74  *
  75  * @author Elena Litani, IBM
  76  * @author Neeraj Bajaj, Sun Microsystems, Inc.
  77  * @author Sandy Gao, IBM
  78  *
  79  * @LastModified: Nov 2017
  80  */
  81 class XSDSimpleTypeTraverser extends XSDAbstractTraverser {
  82 
  83     // whether the type being parsed is a S4S built-in type.
  84     private boolean fIsBuiltIn = false;
  85 
  86     XSDSimpleTypeTraverser (XSDHandler handler,
  87             XSAttributeChecker gAttrCheck) {
  88         super(handler, gAttrCheck);
  89     }
  90 
  91     //return qualified name of simpleType or empty string if error occured
  92     XSSimpleType traverseGlobal(Element elmNode,
  93             XSDocumentInfo schemaDoc,
  94             SchemaGrammar grammar) {
  95 
  96         // General Attribute Checking
  97         Object[] attrValues = fAttrChecker.checkAttributes(elmNode, true, schemaDoc);
  98         String nameAtt = (String)attrValues[XSAttributeChecker.ATTIDX_NAME];
  99         if (nameAtt == null) {


< prev index next >