< prev index next >

src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/StAXSchemaParser.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.traversers;
  23 


  36 import java.util.Iterator;
  37 import java.util.List;
  38 import javax.xml.stream.XMLEventReader;
  39 import javax.xml.stream.XMLStreamConstants;
  40 import javax.xml.stream.XMLStreamException;
  41 import javax.xml.stream.XMLStreamReader;
  42 import javax.xml.stream.events.Attribute;
  43 import javax.xml.stream.events.EndElement;
  44 import javax.xml.stream.events.Namespace;
  45 import javax.xml.stream.events.ProcessingInstruction;
  46 import javax.xml.stream.events.StartElement;
  47 import javax.xml.stream.events.XMLEvent;
  48 import org.w3c.dom.Document;
  49 
  50 /**
  51  * <p>StAXSchemaParser reads StAX events, converts them into XNI events
  52  * and passes them directly to the SchemaDOMParser.</p>
  53  *
  54  * @xerces.internal
  55  *

  56  */
  57 final class StAXSchemaParser {
  58 
  59     /** Chunk size (1024). */
  60     private static final int CHUNK_SIZE = (1 << 10);
  61 
  62     /** Chunk mask (CHUNK_SIZE - 1). */
  63     private static final int CHUNK_MASK = CHUNK_SIZE - 1;
  64 
  65     /** Array for holding character data. **/
  66     private final char [] fCharBuffer = new char[CHUNK_SIZE];
  67 
  68     /** Symbol table **/
  69     private SymbolTable fSymbolTable;
  70 
  71     /** SchemaDOMParser, events will be delegated to SchemaDOMParser to pass */
  72     private SchemaDOMParser fSchemaDOMParser;
  73 
  74     /** XML Locator wrapper for SAX. **/
  75     private final StAXLocationWrapper fLocationWrapper = new StAXLocationWrapper();


   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 


  35 import java.util.Iterator;
  36 import java.util.List;
  37 import javax.xml.stream.XMLEventReader;
  38 import javax.xml.stream.XMLStreamConstants;
  39 import javax.xml.stream.XMLStreamException;
  40 import javax.xml.stream.XMLStreamReader;
  41 import javax.xml.stream.events.Attribute;
  42 import javax.xml.stream.events.EndElement;
  43 import javax.xml.stream.events.Namespace;
  44 import javax.xml.stream.events.ProcessingInstruction;
  45 import javax.xml.stream.events.StartElement;
  46 import javax.xml.stream.events.XMLEvent;
  47 import org.w3c.dom.Document;
  48 
  49 /**
  50  * <p>StAXSchemaParser reads StAX events, converts them into XNI events
  51  * and passes them directly to the SchemaDOMParser.</p>
  52  *
  53  * @xerces.internal
  54  *
  55  * @LastModified: Oct 2017
  56  */
  57 final class StAXSchemaParser {
  58 
  59     /** Chunk size (1024). */
  60     private static final int CHUNK_SIZE = (1 << 10);
  61 
  62     /** Chunk mask (CHUNK_SIZE - 1). */
  63     private static final int CHUNK_MASK = CHUNK_SIZE - 1;
  64 
  65     /** Array for holding character data. **/
  66     private final char [] fCharBuffer = new char[CHUNK_SIZE];
  67 
  68     /** Symbol table **/
  69     private SymbolTable fSymbolTable;
  70 
  71     /** SchemaDOMParser, events will be delegated to SchemaDOMParser to pass */
  72     private SchemaDOMParser fSchemaDOMParser;
  73 
  74     /** XML Locator wrapper for SAX. **/
  75     private final StAXLocationWrapper fLocationWrapper = new StAXLocationWrapper();


< prev index next >