com.sun.org.apache.xerces.internal.parsers.SAXParser Java Examples

The following examples show how to use com.sun.org.apache.xerces.internal.parsers.SAXParser. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: IncrementalSAXSource_Xerces.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/** Create a IncrementalSAXSource_Xerces wrapped around
 * an existing SAXParser. Currently this works only for recent
 * releases of Xerces-1.  Xerces-2 incremental is currently possible
 * only if we are allowed to create the parser instance, due to
 * limitations in the API exposed by Xerces-2 Beta 3; see the
 * no-args constructor for that code.
 *
 * @exception if the SAXParser class doesn't support the Xerces
 * incremental parse operations. In that case, caller should
 * fall back upon the IncrementalSAXSource_Filter approach.
 * */
public IncrementalSAXSource_Xerces(SAXParser parser)
  throws NoSuchMethodException
{
              // Reflection is used to allow us to compile against
              // Xerces2. If/when we can abandon the older versions of the parser,
              // this constructor will simply have to fail until/unless the
              // Xerces2 incremental support is made available on previously
              // constructed SAXParser instances.
  fIncrementalParser=parser;
              Class me=parser.getClass();
  Class[] parms={InputSource.class};
  fParseSomeSetup=me.getMethod("parseSomeSetup",parms);
  parms=new Class[0];
  fParseSome=me.getMethod("parseSome",parms);
  // Fallback if this fails (implemented in createIncrementalSAXSource) is
  // to use IncrementalSAXSource_Filter rather than Xerces-specific code.
}
 
Example #2
Source File: XSAnnotationImpl.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
private synchronized void writeToSAX(ContentHandler handler) {
    // nothing must go wrong with this parse...
    SAXParser parser = fGrammar.getSAXParser();
    StringReader aReader = new StringReader(fData);
    InputSource aSource = new InputSource(aReader);
    parser.setContentHandler(handler);
    try {
        parser.parse(aSource);
    }
    catch (SAXException e) {
        // this should never happen!
        // REVISIT:  what to do with this?; should really not
        // eat it...
    }
    catch (IOException i) {
        // ditto with above
    }
    // Release the reference to the user's ContentHandler.
    parser.setContentHandler(null);
}
 
Example #3
Source File: XSAnnotationImpl.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
private synchronized void writeToSAX(ContentHandler handler) {
    // nothing must go wrong with this parse...
    SAXParser parser = fGrammar.getSAXParser();
    StringReader aReader = new StringReader(fData);
    InputSource aSource = new InputSource(aReader);
    parser.setContentHandler(handler);
    try {
        parser.parse(aSource);
    }
    catch (SAXException e) {
        // this should never happen!
        // REVISIT:  what to do with this?; should really not
        // eat it...
    }
    catch (IOException i) {
        // ditto with above
    }
    // Release the reference to the user's ContentHandler.
    parser.setContentHandler(null);
}
 
Example #4
Source File: IncrementalSAXSource_Xerces.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/** Create a IncrementalSAXSource_Xerces wrapped around
 * an existing SAXParser. Currently this works only for recent
 * releases of Xerces-1.  Xerces-2 incremental is currently possible
 * only if we are allowed to create the parser instance, due to
 * limitations in the API exposed by Xerces-2 Beta 3; see the
 * no-args constructor for that code.
 *
 * @exception if the SAXParser class doesn't support the Xerces
 * incremental parse operations. In that case, caller should
 * fall back upon the IncrementalSAXSource_Filter approach.
 * */
public IncrementalSAXSource_Xerces(SAXParser parser)
  throws NoSuchMethodException
{
              // Reflection is used to allow us to compile against
              // Xerces2. If/when we can abandon the older versions of the parser,
              // this constructor will simply have to fail until/unless the
              // Xerces2 incremental support is made available on previously
              // constructed SAXParser instances.
  fIncrementalParser=parser;
              Class me=parser.getClass();
  Class[] parms={InputSource.class};
  fParseSomeSetup=me.getMethod("parseSomeSetup",parms);
  parms=new Class[0];
  fParseSome=me.getMethod("parseSome",parms);
  // Fallback if this fails (implemented in createIncrementalSAXSource) is
  // to use IncrementalSAXSource_Filter rather than Xerces-specific code.
}
 
Example #5
Source File: IncrementalSAXSource_Xerces.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/** Create a IncrementalSAXSource_Xerces wrapped around
 * an existing SAXParser. Currently this works only for recent
 * releases of Xerces-1.  Xerces-2 incremental is currently possible
 * only if we are allowed to create the parser instance, due to
 * limitations in the API exposed by Xerces-2 Beta 3; see the
 * no-args constructor for that code.
 *
 * @exception if the SAXParser class doesn't support the Xerces
 * incremental parse operations. In that case, caller should
 * fall back upon the IncrementalSAXSource_Filter approach.
 * */
public IncrementalSAXSource_Xerces(SAXParser parser)
  throws NoSuchMethodException
{
              // Reflection is used to allow us to compile against
              // Xerces2. If/when we can abandon the older versions of the parser,
              // this constructor will simply have to fail until/unless the
              // Xerces2 incremental support is made available on previously
              // constructed SAXParser instances.
  fIncrementalParser=parser;
              Class me=parser.getClass();
  Class[] parms={InputSource.class};
  fParseSomeSetup=me.getMethod("parseSomeSetup",parms);
  parms=new Class[0];
  fParseSome=me.getMethod("parseSome",parms);
  // Fallback if this fails (implemented in createIncrementalSAXSource) is
  // to use IncrementalSAXSource_Filter rather than Xerces-specific code.
}
 
Example #6
Source File: IncrementalSAXSource_Xerces.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
/** Create a IncrementalSAXSource_Xerces wrapped around
 * an existing SAXParser. Currently this works only for recent
 * releases of Xerces-1.  Xerces-2 incremental is currently possible
 * only if we are allowed to create the parser instance, due to
 * limitations in the API exposed by Xerces-2 Beta 3; see the
 * no-args constructor for that code.
 *
 * @exception if the SAXParser class doesn't support the Xerces
 * incremental parse operations. In that case, caller should
 * fall back upon the IncrementalSAXSource_Filter approach.
 * */
public IncrementalSAXSource_Xerces(SAXParser parser)
  throws NoSuchMethodException
{
              // Reflection is used to allow us to compile against
              // Xerces2. If/when we can abandon the older versions of the parser,
              // this constructor will simply have to fail until/unless the
              // Xerces2 incremental support is made available on previously
              // constructed SAXParser instances.
  fIncrementalParser=parser;
              Class me=parser.getClass();
  Class[] parms={InputSource.class};
  fParseSomeSetup=me.getMethod("parseSomeSetup",parms);
  parms=new Class[0];
  fParseSome=me.getMethod("parseSome",parms);
  // Fallback if this fails (implemented in createIncrementalSAXSource) is
  // to use IncrementalSAXSource_Filter rather than Xerces-specific code.
}
 
Example #7
Source File: XSAnnotationImpl.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
private synchronized void writeToSAX(ContentHandler handler) {
    // nothing must go wrong with this parse...
    SAXParser parser = fGrammar.getSAXParser();
    StringReader aReader = new StringReader(fData);
    InputSource aSource = new InputSource(aReader);
    parser.setContentHandler(handler);
    try {
        parser.parse(aSource);
    }
    catch (SAXException e) {
        // this should never happen!
        // REVISIT:  what to do with this?; should really not
        // eat it...
    }
    catch (IOException i) {
        // ditto with above
    }
    // Release the reference to the user's ContentHandler.
    parser.setContentHandler(null);
}
 
Example #8
Source File: IncrementalSAXSource_Xerces.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/** Create a IncrementalSAXSource_Xerces wrapped around
 * an existing SAXParser. Currently this works only for recent
 * releases of Xerces-1.  Xerces-2 incremental is currently possible
 * only if we are allowed to create the parser instance, due to
 * limitations in the API exposed by Xerces-2 Beta 3; see the
 * no-args constructor for that code.
 *
 * @exception if the SAXParser class doesn't support the Xerces
 * incremental parse operations. In that case, caller should
 * fall back upon the IncrementalSAXSource_Filter approach.
 * */
public IncrementalSAXSource_Xerces(SAXParser parser)
  throws NoSuchMethodException
{
              // Reflection is used to allow us to compile against
              // Xerces2. If/when we can abandon the older versions of the parser,
              // this constructor will simply have to fail until/unless the
              // Xerces2 incremental support is made available on previously
              // constructed SAXParser instances.
  fIncrementalParser=parser;
              Class me=parser.getClass();
  Class[] parms={InputSource.class};
  fParseSomeSetup=me.getMethod("parseSomeSetup",parms);
  parms=new Class[0];
  fParseSome=me.getMethod("parseSome",parms);
  // Fallback if this fails (implemented in createIncrementalSAXSource) is
  // to use IncrementalSAXSource_Filter rather than Xerces-specific code.
}
 
Example #9
Source File: IncrementalSAXSource_Xerces.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/** Create a IncrementalSAXSource_Xerces wrapped around
 * an existing SAXParser. Currently this works only for recent
 * releases of Xerces-1.  Xerces-2 incremental is currently possible
 * only if we are allowed to create the parser instance, due to
 * limitations in the API exposed by Xerces-2 Beta 3; see the
 * no-args constructor for that code.
 *
 * @exception if the SAXParser class doesn't support the Xerces
 * incremental parse operations. In that case, caller should
 * fall back upon the IncrementalSAXSource_Filter approach.
 * */
public IncrementalSAXSource_Xerces(SAXParser parser)
  throws NoSuchMethodException
{
              // Reflection is used to allow us to compile against
              // Xerces2. If/when we can abandon the older versions of the parser,
              // this constructor will simply have to fail until/unless the
              // Xerces2 incremental support is made available on previously
              // constructed SAXParser instances.
  fIncrementalParser=parser;
              Class me=parser.getClass();
  Class[] parms={InputSource.class};
  fParseSomeSetup=me.getMethod("parseSomeSetup",parms);
  parms=new Class[0];
  fParseSome=me.getMethod("parseSome",parms);
  // Fallback if this fails (implemented in createIncrementalSAXSource) is
  // to use IncrementalSAXSource_Filter rather than Xerces-specific code.
}
 
Example #10
Source File: XSAnnotationImpl.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
private synchronized void writeToSAX(ContentHandler handler) {
    // nothing must go wrong with this parse...
    SAXParser parser = fGrammar.getSAXParser();
    StringReader aReader = new StringReader(fData);
    InputSource aSource = new InputSource(aReader);
    parser.setContentHandler(handler);
    try {
        parser.parse(aSource);
    }
    catch (SAXException e) {
        // this should never happen!
        // REVISIT:  what to do with this?; should really not
        // eat it...
    }
    catch (IOException i) {
        // ditto with above
    }
    // Release the reference to the user's ContentHandler.
    parser.setContentHandler(null);
}
 
Example #11
Source File: XSAnnotationImpl.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
private synchronized void writeToSAX(ContentHandler handler) {
    // nothing must go wrong with this parse...
    SAXParser parser = fGrammar.getSAXParser();
    StringReader aReader = new StringReader(fData);
    InputSource aSource = new InputSource(aReader);
    parser.setContentHandler(handler);
    try {
        parser.parse(aSource);
    }
    catch (SAXException e) {
        // this should never happen!
        // REVISIT:  what to do with this?; should really not
        // eat it...
    }
    catch (IOException i) {
        // ditto with above
    }
    // Release the reference to the user's ContentHandler.
    parser.setContentHandler(null);
}
 
Example #12
Source File: XSAnnotationImpl.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
private synchronized void writeToSAX(ContentHandler handler) {
    // nothing must go wrong with this parse...
    SAXParser parser = fGrammar.getSAXParser();
    StringReader aReader = new StringReader(fData);
    InputSource aSource = new InputSource(aReader);
    parser.setContentHandler(handler);
    try {
        parser.parse(aSource);
    }
    catch (SAXException e) {
        // this should never happen!
        // REVISIT:  what to do with this?; should really not
        // eat it...
    }
    catch (IOException i) {
        // ditto with above
    }
    // Release the reference to the user's ContentHandler.
    parser.setContentHandler(null);
}
 
Example #13
Source File: XSAnnotationImpl.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
private synchronized void writeToSAX(ContentHandler handler) {
    // nothing must go wrong with this parse...
    SAXParser parser = fGrammar.getSAXParser();
    StringReader aReader = new StringReader(fData);
    InputSource aSource = new InputSource(aReader);
    parser.setContentHandler(handler);
    try {
        parser.parse(aSource);
    }
    catch (SAXException e) {
        // this should never happen!
        // REVISIT:  what to do with this?; should really not
        // eat it...
    }
    catch (IOException i) {
        // ditto with above
    }
    // Release the reference to the user's ContentHandler.
    parser.setContentHandler(null);
}
 
Example #14
Source File: IncrementalSAXSource_Xerces.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
/** Create a IncrementalSAXSource_Xerces wrapped around
 * an existing SAXParser. Currently this works only for recent
 * releases of Xerces-1.  Xerces-2 incremental is currently possible
 * only if we are allowed to create the parser instance, due to
 * limitations in the API exposed by Xerces-2 Beta 3; see the
 * no-args constructor for that code.
 *
 * @exception if the SAXParser class doesn't support the Xerces
 * incremental parse operations. In that case, caller should
 * fall back upon the IncrementalSAXSource_Filter approach.
 * */
public IncrementalSAXSource_Xerces(SAXParser parser)
  throws NoSuchMethodException
{
              // Reflection is used to allow us to compile against
              // Xerces2. If/when we can abandon the older versions of the parser,
              // this constructor will simply have to fail until/unless the
              // Xerces2 incremental support is made available on previously
              // constructed SAXParser instances.
  fIncrementalParser=parser;
              Class me=parser.getClass();
  Class[] parms={InputSource.class};
  fParseSomeSetup=me.getMethod("parseSomeSetup",parms);
  parms=new Class[0];
  fParseSome=me.getMethod("parseSome",parms);
  // Fallback if this fails (implemented in createIncrementalSAXSource) is
  // to use IncrementalSAXSource_Filter rather than Xerces-specific code.
}
 
Example #15
Source File: IncrementalSAXSource_Xerces.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/** Create a IncrementalSAXSource_Xerces wrapped around
 * an existing SAXParser. Currently this works only for recent
 * releases of Xerces-1.  Xerces-2 incremental is currently possible
 * only if we are allowed to create the parser instance, due to
 * limitations in the API exposed by Xerces-2 Beta 3; see the
 * no-args constructor for that code.
 *
 * @exception if the SAXParser class doesn't support the Xerces
 * incremental parse operations. In that case, caller should
 * fall back upon the IncrementalSAXSource_Filter approach.
 * */
public IncrementalSAXSource_Xerces(SAXParser parser)
  throws NoSuchMethodException
{
              // Reflection is used to allow us to compile against
              // Xerces2. If/when we can abandon the older versions of the parser,
              // this constructor will simply have to fail until/unless the
              // Xerces2 incremental support is made available on previously
              // constructed SAXParser instances.
  fIncrementalParser=parser;
              Class me=parser.getClass();
  Class[] parms={InputSource.class};
  fParseSomeSetup=me.getMethod("parseSomeSetup",parms);
  parms=new Class[0];
  fParseSome=me.getMethod("parseSome",parms);
  // Fallback if this fails (implemented in createIncrementalSAXSource) is
  // to use IncrementalSAXSource_Filter rather than Xerces-specific code.
}
 
Example #16
Source File: XSAnnotationImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
private synchronized void writeToSAX(ContentHandler handler) {
    // nothing must go wrong with this parse...
    SAXParser parser = fGrammar.getSAXParser();
    StringReader aReader = new StringReader(fData);
    InputSource aSource = new InputSource(aReader);
    parser.setContentHandler(handler);
    try {
        parser.parse(aSource);
    }
    catch (SAXException e) {
        // this should never happen!
        // REVISIT:  what to do with this?; should really not
        // eat it...
    }
    catch (IOException i) {
        // ditto with above
    }
    // Release the reference to the user's ContentHandler.
    parser.setContentHandler(null);
}
 
Example #17
Source File: XSAnnotationImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
private synchronized void writeToSAX(ContentHandler handler) {
    // nothing must go wrong with this parse...
    SAXParser parser = fGrammar.getSAXParser();
    StringReader aReader = new StringReader(fData);
    InputSource aSource = new InputSource(aReader);
    parser.setContentHandler(handler);
    try {
        parser.parse(aSource);
    }
    catch (SAXException e) {
        // this should never happen!
        // REVISIT:  what to do with this?; should really not
        // eat it...
    }
    catch (IOException i) {
        // ditto with above
    }
    // Release the reference to the user's ContentHandler.
    parser.setContentHandler(null);
}
 
Example #18
Source File: IncrementalSAXSource_Xerces.java    From Bytecoder with Apache License 2.0 6 votes vote down vote up
/** Create a IncrementalSAXSource_Xerces wrapped around
 * an existing SAXParser. Currently this works only for recent
 * releases of Xerces-1.  Xerces-2 incremental is currently possible
 * only if we are allowed to create the parser instance, due to
 * limitations in the API exposed by Xerces-2 Beta 3; see the
 * no-args constructor for that code.
 *
 * @exception if the SAXParser class doesn't support the Xerces
 * incremental parse operations. In that case, caller should
 * fall back upon the IncrementalSAXSource_Filter approach.
 * */
public IncrementalSAXSource_Xerces(SAXParser parser)
  throws NoSuchMethodException
{
              // Reflection is used to allow us to compile against
              // Xerces2. If/when we can abandon the older versions of the parser,
              // this constructor will simply have to fail until/unless the
              // Xerces2 incremental support is made available on previously
              // constructed SAXParser instances.
  fIncrementalParser=parser;
              Class<?> me=parser.getClass();
  Class<?>[] parms={InputSource.class};
  fParseSomeSetup=me.getMethod("parseSomeSetup",parms);
  parms=new Class<?>[0];
  fParseSome=me.getMethod("parseSome",parms);
  // Fallback if this fails (implemented in createIncrementalSAXSource) is
  // to use IncrementalSAXSource_Filter rather than Xerces-specific code.
}
 
Example #19
Source File: IncrementalSAXSource_Xerces.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/** Create a IncrementalSAXSource_Xerces wrapped around
 * an existing SAXParser. Currently this works only for recent
 * releases of Xerces-1.  Xerces-2 incremental is currently possible
 * only if we are allowed to create the parser instance, due to
 * limitations in the API exposed by Xerces-2 Beta 3; see the
 * no-args constructor for that code.
 *
 * @exception if the SAXParser class doesn't support the Xerces
 * incremental parse operations. In that case, caller should
 * fall back upon the IncrementalSAXSource_Filter approach.
 * */
public IncrementalSAXSource_Xerces(SAXParser parser)
  throws NoSuchMethodException
{
              // Reflection is used to allow us to compile against
              // Xerces2. If/when we can abandon the older versions of the parser,
              // this constructor will simply have to fail until/unless the
              // Xerces2 incremental support is made available on previously
              // constructed SAXParser instances.
  fIncrementalParser=parser;
              Class me=parser.getClass();
  Class[] parms={InputSource.class};
  fParseSomeSetup=me.getMethod("parseSomeSetup",parms);
  parms=new Class[0];
  fParseSome=me.getMethod("parseSome",parms);
  // Fallback if this fails (implemented in createIncrementalSAXSource) is
  // to use IncrementalSAXSource_Filter rather than Xerces-specific code.
}
 
Example #20
Source File: XSAnnotationImpl.java    From Bytecoder with Apache License 2.0 6 votes vote down vote up
private synchronized void writeToSAX(ContentHandler handler) {
    // nothing must go wrong with this parse...
    SAXParser parser = fGrammar.getSAXParser();
    StringReader aReader = new StringReader(fData);
    InputSource aSource = new InputSource(aReader);
    parser.setContentHandler(handler);
    try {
        parser.parse(aSource);
    }
    catch (SAXException e) {
        // this should never happen!
        // REVISIT:  what to do with this?; should really not
        // eat it...
    }
    catch (IOException i) {
        // ditto with above
    }
    // Release the reference to the user's ContentHandler.
    parser.setContentHandler(null);
}
 
Example #21
Source File: IncrementalSAXSource_Xerces.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/** Create a IncrementalSAXSource_Xerces wrapped around
 * an existing SAXParser. Currently this works only for recent
 * releases of Xerces-1.  Xerces-2 incremental is currently possible
 * only if we are allowed to create the parser instance, due to
 * limitations in the API exposed by Xerces-2 Beta 3; see the
 * no-args constructor for that code.
 *
 * @exception if the SAXParser class doesn't support the Xerces
 * incremental parse operations. In that case, caller should
 * fall back upon the IncrementalSAXSource_Filter approach.
 * */
public IncrementalSAXSource_Xerces(SAXParser parser)
  throws NoSuchMethodException
{
              // Reflection is used to allow us to compile against
              // Xerces2. If/when we can abandon the older versions of the parser,
              // this constructor will simply have to fail until/unless the
              // Xerces2 incremental support is made available on previously
              // constructed SAXParser instances.
  fIncrementalParser=parser;
              Class me=parser.getClass();
  Class[] parms={InputSource.class};
  fParseSomeSetup=me.getMethod("parseSomeSetup",parms);
  parms=new Class[0];
  fParseSome=me.getMethod("parseSome",parms);
  // Fallback if this fails (implemented in createIncrementalSAXSource) is
  // to use IncrementalSAXSource_Filter rather than Xerces-specific code.
}
 
Example #22
Source File: XSAnnotationImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
private synchronized void writeToSAX(ContentHandler handler) {
    // nothing must go wrong with this parse...
    SAXParser parser = fGrammar.getSAXParser();
    StringReader aReader = new StringReader(fData);
    InputSource aSource = new InputSource(aReader);
    parser.setContentHandler(handler);
    try {
        parser.parse(aSource);
    }
    catch (SAXException e) {
        // this should never happen!
        // REVISIT:  what to do with this?; should really not
        // eat it...
    }
    catch (IOException i) {
        // ditto with above
    }
    // Release the reference to the user's ContentHandler.
    parser.setContentHandler(null);
}
 
Example #23
Source File: IncrementalSAXSource_Xerces.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
static public IncrementalSAXSource createIncrementalSAXSource()
      {
              try
              {
                      return new IncrementalSAXSource_Xerces();
              }
              catch(NoSuchMethodException e)
              {
                      // Xerces version mismatch; neither Xerces1 nor Xerces2 succeeded.
                      // Fall back on filtering solution.
                      IncrementalSAXSource_Filter iss=new IncrementalSAXSource_Filter();
                      iss.setXMLReader(new SAXParser());
                      return iss;
              }
}
 
Example #24
Source File: IncrementalSAXSource_Xerces.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
static public IncrementalSAXSource
createIncrementalSAXSource(SAXParser parser) {
              try
              {
                      return new IncrementalSAXSource_Xerces(parser);
              }
              catch(NoSuchMethodException e)
              {
                      // Xerces version mismatch; neither Xerces1 nor Xerces2 succeeded.
                      // Fall back on filtering solution.
                      IncrementalSAXSource_Filter iss=new IncrementalSAXSource_Filter();
                      iss.setXMLReader(parser);
                      return iss;
              }
}
 
Example #25
Source File: IncrementalSAXSource_Xerces.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
static public IncrementalSAXSource createIncrementalSAXSource()
      {
              try
              {
                      return new IncrementalSAXSource_Xerces();
              }
              catch(NoSuchMethodException e)
              {
                      // Xerces version mismatch; neither Xerces1 nor Xerces2 succeeded.
                      // Fall back on filtering solution.
                      IncrementalSAXSource_Filter iss=new IncrementalSAXSource_Filter();
                      iss.setXMLReader(new SAXParser());
                      return iss;
              }
}
 
Example #26
Source File: IncrementalSAXSource_Xerces.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
static public IncrementalSAXSource
createIncrementalSAXSource(SAXParser parser) {
              try
              {
                      return new IncrementalSAXSource_Xerces(parser);
              }
              catch(NoSuchMethodException e)
              {
                      // Xerces version mismatch; neither Xerces1 nor Xerces2 succeeded.
                      // Fall back on filtering solution.
                      IncrementalSAXSource_Filter iss=new IncrementalSAXSource_Filter();
                      iss.setXMLReader(parser);
                      return iss;
              }
}
 
Example #27
Source File: Config.java    From gepard with MIT License 5 votes vote down vote up
private Config() throws Exception {
	// create XML parser
	SAXParser p = new SAXParser();
	// set object itsself as content handler
	p.setContentHandler(this);
	// create hashmap
	settings = new HashMap<String,String>();
	// start parsing
	p.parse(configFile);
}
 
Example #28
Source File: HelpTexts.java    From gepard with MIT License 5 votes vote down vote up
private HelpTexts() {
	// create XML parser
	SAXParser p = new SAXParser();
	// set object itsself as content handler
	p.setContentHandler(this);
	// create hashmap
	texts = new HashMap<String,String>();
	// start parsing
	try {
		p.parse(new InputSource(this.getClass().getResourceAsStream(ClientGlobals.FILE_HELP)));
	} catch (Exception e) {
		JOptionPane.showMessageDialog(null, "Could not load help file '"+ClientGlobals.FILE_HELP+"'.\n\nError:\n" + e.getMessage(),"Error", JOptionPane.WARNING_MESSAGE);
	}
	
}
 
Example #29
Source File: IncrementalSAXSource_Xerces.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
static public IncrementalSAXSource
createIncrementalSAXSource(SAXParser parser) {
              try
              {
                      return new IncrementalSAXSource_Xerces(parser);
              }
              catch(NoSuchMethodException e)
              {
                      // Xerces version mismatch; neither Xerces1 nor Xerces2 succeeded.
                      // Fall back on filtering solution.
                      IncrementalSAXSource_Filter iss=new IncrementalSAXSource_Filter();
                      iss.setXMLReader(parser);
                      return iss;
              }
}
 
Example #30
Source File: SubstMatrixList.java    From gepard with MIT License 5 votes vote down vote up
private SubstMatrixList() throws SAXException, IOException {
		// create XML parser
		SAXParser p = new SAXParser();
		// set object itsself as content handler
		p.setContentHandler(this);
		// create vector		
		vec = new Vector<SubstMatrixFile>();
		// start parsing
//		System.out.println(ClientGlobals.PATH_MATRICES + ClientGlobals.FILE_MATRICES);
		p.parse(new InputSource(this.getClass().getResourceAsStream(ClientGlobals.PATH_MATRICES + ClientGlobals.FILE_MATRICES)));
	}