Java Code Examples for com.sun.org.apache.xerces.internal.parsers.SAXParser#setContentHandler()

The following examples show how to use com.sun.org.apache.xerces.internal.parsers.SAXParser#setContentHandler() . 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: 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 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 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 4
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 5
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 6
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 7
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 8
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 9
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 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 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 12
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 13
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 14
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)));
	}