< prev index next >

src/java.xml/share/classes/com/sun/org/apache/xml/internal/dtm/ref/IncrementalSAXSource_Xerces.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.xml.internal.dtm.ref;
  23 
  24 import com.sun.org.apache.xalan.internal.utils.ObjectFactory;
  25 import com.sun.org.apache.xerces.internal.parsers.SAXParser;
  26 import com.sun.org.apache.xml.internal.res.XMLErrorResources;
  27 import com.sun.org.apache.xml.internal.res.XMLMessages;
  28 import java.io.IOException;
  29 import java.lang.reflect.Constructor;
  30 import java.lang.reflect.Method;
  31 import org.xml.sax.InputSource;
  32 import org.xml.sax.SAXException;
  33 import org.xml.sax.XMLReader;
  34 
  35 
  36 /** <p>IncrementalSAXSource_Xerces takes advantage of the fact that Xerces1
  37  * incremental mode is already a coroutine of sorts, and just wraps our
  38  * IncrementalSAXSource API around it.</p>
  39  *
  40  * <p>Usage example: See main().</p>
  41  *
  42  * <p>Status: Passes simple main() unit-test. NEEDS JAVADOC.</p>
  43  * */


  44 public class IncrementalSAXSource_Xerces
  45   implements IncrementalSAXSource
  46 {
  47   //
  48   // Reflection. To allow this to compile with both Xerces1 and Xerces2, which
  49   // require very different methods and objects, we need to avoid static
  50   // references to those APIs. So until Xerces2 is pervasive and we're willing
  51   // to make it a prerequisite, we will rely upon relection.
  52   //
  53   Method fParseSomeSetup=null; // Xerces1 method
  54   Method fParseSome=null; // Xerces1 method
  55   Object fPullParserConfig=null; // Xerces2 pull control object
  56   Method fConfigSetInput=null; // Xerces2 method
  57   Method fConfigParse=null; // Xerces2 method
  58   Method fSetInputSource=null; // Xerces2 pull control method
  59   Constructor<?> fConfigInputSourceCtor=null; // Xerces2 initialization method
  60   Method fConfigSetByteStream=null; // Xerces2 initialization method
  61   Method fConfigSetCharStream=null; // Xerces2 initialization method
  62   Method fConfigSetEncoding=null; // Xerces2 initialization method
  63   Method fReset=null; // Both Xerces1 and Xerces2, but diff. signatures


   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.xml.internal.dtm.ref;
  22 
  23 import com.sun.org.apache.xalan.internal.utils.ObjectFactory;
  24 import com.sun.org.apache.xerces.internal.parsers.SAXParser;
  25 import com.sun.org.apache.xml.internal.res.XMLErrorResources;
  26 import com.sun.org.apache.xml.internal.res.XMLMessages;
  27 import java.io.IOException;
  28 import java.lang.reflect.Constructor;
  29 import java.lang.reflect.Method;
  30 import org.xml.sax.InputSource;
  31 import org.xml.sax.SAXException;
  32 import org.xml.sax.XMLReader;
  33 
  34 
  35 /** <p>IncrementalSAXSource_Xerces takes advantage of the fact that Xerces1
  36  * incremental mode is already a coroutine of sorts, and just wraps our
  37  * IncrementalSAXSource API around it.</p>
  38  *
  39  * <p>Usage example: See main().</p>
  40  *
  41  * <p>Status: Passes simple main() unit-test. NEEDS JAVADOC.</p>
  42  *
  43  * @LastModified: Oct 2017
  44  */
  45 public class IncrementalSAXSource_Xerces
  46   implements IncrementalSAXSource
  47 {
  48   //
  49   // Reflection. To allow this to compile with both Xerces1 and Xerces2, which
  50   // require very different methods and objects, we need to avoid static
  51   // references to those APIs. So until Xerces2 is pervasive and we're willing
  52   // to make it a prerequisite, we will rely upon relection.
  53   //
  54   Method fParseSomeSetup=null; // Xerces1 method
  55   Method fParseSome=null; // Xerces1 method
  56   Object fPullParserConfig=null; // Xerces2 pull control object
  57   Method fConfigSetInput=null; // Xerces2 method
  58   Method fConfigParse=null; // Xerces2 method
  59   Method fSetInputSource=null; // Xerces2 pull control method
  60   Constructor<?> fConfigInputSourceCtor=null; // Xerces2 initialization method
  61   Method fConfigSetByteStream=null; // Xerces2 initialization method
  62   Method fConfigSetCharStream=null; // Xerces2 initialization method
  63   Method fConfigSetEncoding=null; // Xerces2 initialization method
  64   Method fReset=null; // Both Xerces1 and Xerces2, but diff. signatures


< prev index next >