< prev index next >

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

Print this page


   1 /*
   2  * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
   3  * @LastModified: Oct 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;
  23 


  41 import com.sun.org.apache.xerces.internal.xs.XSNamespaceItemList;
  42 import com.sun.org.apache.xerces.internal.xs.XSNotationDeclaration;
  43 import com.sun.org.apache.xerces.internal.xs.XSObject;
  44 import com.sun.org.apache.xerces.internal.xs.XSObjectList;
  45 import com.sun.org.apache.xerces.internal.xs.XSTypeDefinition;
  46 import java.lang.reflect.Array;
  47 import java.util.AbstractList;
  48 import java.util.Iterator;
  49 import java.util.List;
  50 import java.util.ListIterator;
  51 import java.util.NoSuchElementException;
  52 
  53 /**
  54  * Implements XSModel:  a read-only interface that represents an XML Schema,
  55  * which could be components from different namespaces.
  56  *
  57  * @xerces.internal
  58  *
  59  * @author Sandy Gao, IBM
  60  *

  61  */
  62 @SuppressWarnings("unchecked") // method <T>toArray(T[])
  63 public final class XSModelImpl extends AbstractList<XSNamespaceItem> implements XSModel, XSNamespaceItemList {
  64 
  65     // the max index / the max value of XSObject type
  66     private static final short MAX_COMP_IDX = XSTypeDefinition.SIMPLE_TYPE;
  67     private static final boolean[] GLOBAL_COMP = {false,    // null
  68                                                   true,     // attribute
  69                                                   true,     // element
  70                                                   true,     // type
  71                                                   false,    // attribute use
  72                                                   true,     // attribute group
  73                                                   true,     // group
  74                                                   false,    // model group
  75                                                   false,    // particle
  76                                                   false,    // wildcard
  77                                                   true,    // idc
  78                                                   true,     // notation
  79                                                   false,    // annotation
  80                                                   false,    // facet


   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;
  22 


  40 import com.sun.org.apache.xerces.internal.xs.XSNamespaceItemList;
  41 import com.sun.org.apache.xerces.internal.xs.XSNotationDeclaration;
  42 import com.sun.org.apache.xerces.internal.xs.XSObject;
  43 import com.sun.org.apache.xerces.internal.xs.XSObjectList;
  44 import com.sun.org.apache.xerces.internal.xs.XSTypeDefinition;
  45 import java.lang.reflect.Array;
  46 import java.util.AbstractList;
  47 import java.util.Iterator;
  48 import java.util.List;
  49 import java.util.ListIterator;
  50 import java.util.NoSuchElementException;
  51 
  52 /**
  53  * Implements XSModel:  a read-only interface that represents an XML Schema,
  54  * which could be components from different namespaces.
  55  *
  56  * @xerces.internal
  57  *
  58  * @author Sandy Gao, IBM
  59  *
  60  * @LastModified: Oct 2017
  61  */
  62 @SuppressWarnings("unchecked") // method <T>toArray(T[])
  63 public final class XSModelImpl extends AbstractList<XSNamespaceItem> implements XSModel, XSNamespaceItemList {
  64 
  65     // the max index / the max value of XSObject type
  66     private static final short MAX_COMP_IDX = XSTypeDefinition.SIMPLE_TYPE;
  67     private static final boolean[] GLOBAL_COMP = {false,    // null
  68                                                   true,     // attribute
  69                                                   true,     // element
  70                                                   true,     // type
  71                                                   false,    // attribute use
  72                                                   true,     // attribute group
  73                                                   true,     // group
  74                                                   false,    // model group
  75                                                   false,    // particle
  76                                                   false,    // wildcard
  77                                                   true,    // idc
  78                                                   true,     // notation
  79                                                   false,    // annotation
  80                                                   false,    // facet


< prev index next >