286N/A/*
286N/A * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
286N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
286N/A *
286N/A * This code is free software; you can redistribute it and/or modify it
286N/A * under the terms of the GNU General Public License version 2 only, as
286N/A * published by the Free Software Foundation. Oracle designates this
286N/A * particular file as subject to the "Classpath" exception as provided
286N/A * by Oracle in the LICENSE file that accompanied this code.
286N/A *
286N/A * This code is distributed in the hope that it will be useful, but WITHOUT
286N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
286N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
286N/A * version 2 for more details (a copy is included in the LICENSE file that
286N/A * accompanied this code).
286N/A *
286N/A * You should have received a copy of the GNU General Public License version
286N/A * 2 along with this work; if not, write to the Free Software Foundation,
286N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
286N/A *
286N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
286N/A * or visit www.oracle.com if you need additional information or have any
286N/A * questions.
286N/A */
286N/A
286N/Apackage com.sun.xml.internal.stream;
286N/A
286N/Aimport javax.xml.stream.XMLEventReader;
286N/Aimport javax.xml.stream.XMLStreamReader;
286N/Aimport com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource;
286N/A
286N/A/**
286N/A *
286N/A * @author Neeraj
286N/A *
286N/A * This class wraps XMLInputSource and is also capable of telling wether application
286N/A * returned XMLStreamReader or not when XMLResolver.resolveEnity
286N/A * was called.
286N/A */
286N/Apublic class StaxXMLInputSource {
286N/A
286N/A XMLStreamReader fStreamReader ;
286N/A XMLEventReader fEventReader ;
286N/A XMLInputSource fInputSource ;
286N/A
559N/A //indicate if the source is resolved by a resolver
559N/A boolean fHasResolver = false;
559N/A
286N/A /** Creates a new instance of StaxXMLInputSource */
286N/A public StaxXMLInputSource(XMLStreamReader streamReader) {
286N/A fStreamReader = streamReader ;
286N/A }
286N/A
286N/A /** Creates a new instance of StaxXMLInputSource */
286N/A public StaxXMLInputSource(XMLEventReader eventReader) {
286N/A fEventReader = eventReader ;
286N/A }
286N/A
286N/A public StaxXMLInputSource(XMLInputSource inputSource){
286N/A fInputSource = inputSource ;
286N/A
286N/A }
559N/A
559N/A public StaxXMLInputSource(XMLInputSource inputSource, boolean hasResolver){
559N/A fInputSource = inputSource ;
559N/A fHasResolver = hasResolver;
559N/A }
559N/A
286N/A public XMLStreamReader getXMLStreamReader(){
286N/A return fStreamReader ;
286N/A }
286N/A
286N/A public XMLEventReader getXMLEventReader(){
286N/A return fEventReader ;
286N/A }
286N/A
286N/A public XMLInputSource getXMLInputSource(){
286N/A return fInputSource ;
286N/A }
286N/A
286N/A public boolean hasXMLStreamOrXMLEventReader(){
286N/A return (fStreamReader == null) && (fEventReader == null) ? false : true ;
286N/A }
559N/A
559N/A public boolean hasResolver() {
559N/A return fHasResolver;
559N/A }
286N/A}