SAXParserFactory getFeature - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for SAXParserFactory getFeature method.

This code example shows how to use the following methods:getFeature, newSAXParser, setFeature, setValidating
            boolean loadExternalDtds) throws ParserConfigurationException, SAXException {
        SAXParserFactory parserFactory = SAXParserFactory.newInstance();
        parserFactory.setNamespaceAware(true);
        parserFactory.setValidating(canUseSchemaValidation && (schema != null));
        if (!loadExternalDtds && canDisableExternalDtds(parserFactory)) {
            parserFactory.setFeature(XERCES_LOAD_EXTERNAL_DTD, false);
        } 
        SAXParser parser = parserFactory.newSAXParser();
 
        if (canUseSchemaValidation && (schema != null)) {
            try { 
                parser.setProperty(JAXP_SCHEMA_LANGUAGE, W3C_XML_SCHEMA);
                parser.setProperty(JAXP_SCHEMA_SOURCE, schemaStream);
            } catch (SAXNotRecognizedException ex) {
                Message.warn("problem while setting JAXP validating property on SAXParser... " 
                        + "XML validation will not be done (" + ex.getClass().getName() + ": "
                        + ex.getMessage() + ")");
                canUseSchemaValidation = false;
                parserFactory.setValidating(false);
                parser = parserFactory.newSAXParser();

6
CodeRank
This code example shows how to use the following methods:getFeature
    public void setFeature(final String name, final boolean value) throws ParserConfigurationException, SAXNotRecognizedException, SAXNotSupportedException {
        actual.setFeature(name, value);
    } 
 
    public boolean getFeature(final String name) throws ParserConfigurationException, SAXNotRecognizedException, SAXNotSupportedException {
        return actual.getFeature(name);
    } 
 
    public Schema getSchema() {
        return actual.getSchema();
    } 
 
    public void setSchema(final Schema schema) {
        actual.setSchema(schema);
    } 
 
    public void setXIncludeAware(final boolean state) {
        actual.setXIncludeAware(state);
    } 
 
5
CodeRank
This code example shows how to use the following methods:getFeature, setFeature, setNamespaceAware, setValidating
 
	private void checkSAXFactory() throws SAXNotRecognizedException, SAXNotSupportedException { 
		if ( spf == null ) {
			try { 
				spf = SAXParserFactory.newInstance();
				spf.setNamespaceAware(true);
				spf.setValidating(false);
				spf.setFeature("http://xml.org/sax/features/namespace-prefixes", true);
			} 
			catch ( ParserConfigurationException e ) {
				throw new SAXNotSupportedException(e.getMessage());
			} 
		} 
	} 
	 
	public void setSAXFeature(String name, boolean value) throws SAXNotRecognizedException, SAXNotSupportedException {
		checkSAXFactory(); 
		try { 
			spf.setFeature(name, value);
		} 

5
CodeRank
This code example shows how to use the following methods:getFeature, newSAXParser, setValidating
This code example shows how to use the following methods:getFeature
    /** 
     * @see SAXParserFactory#getFeature(String) 
     */ 
    public boolean getFeature(String name) throws ParserConfigurationException, SAXNotRecognizedException, SAXNotSupportedException
    { 
        return _WrappedFactory.getFeature(name);
    } 
 
    public boolean isNamespaceAware() 
    { return _WrappedFactory.isNamespaceAware(); }
    public void setNamespaceAware(boolean awareness)
    { _WrappedFactory.setNamespaceAware(awareness); }
     
    public boolean isValidating() 
    { return validation; }
    public void setValidating(boolean validating)
    { validation = validating; }
 
} 
5
CodeRank
This code example shows how to use the following methods:getFeature
    } 
 
    @Override 
    public boolean getFeature(String name) throws ParserConfigurationException, SAXNotRecognizedException, 
            SAXNotSupportedException {
        return delegate.getFeature(name);
    } 
 
    public static void setDelegate(SAXParserFactory delegate) {
        SAXParserFactoryForTest.delegate = delegate;
    } 
} 
5
CodeRank
This code example shows how to use the following methods:getFeature
        spf.setFeature(s, b);
    } 
 
    @Override 
    public boolean getFeature(String s) throws ParserConfigurationException, SAXNotRecognizedException, SAXNotSupportedException {
        return spf.getFeature(s);
    } 
 
    @SuppressWarnings("deprecation") 
    private static final class WrappingSAXParser extends SAXParser {
        private final SAXParser sp;
 
        protected WrappingSAXParser(SAXParser sp) {
            this.sp = sp;
        } 
 
        @Override 
        public void reset() { 
            sp.reset();
        } 
5
CodeRank
This code example shows how to use the following methods:getFeature
    /** 
     * @see SAXParserFactory#getFeature(String) 
     */ 
    public boolean getFeature(String name) throws ParserConfigurationException, SAXNotRecognizedException, SAXNotSupportedException
    { 
        return _WrappedFactory.getFeature(name);
    } 
 
    public boolean isNamespaceAware() 
    { return _WrappedFactory.isNamespaceAware(); }
    public void setNamespaceAware(boolean awareness)
    { _WrappedFactory.setNamespaceAware(awareness); }
     
    public boolean isValidating() 
    { return validation; }
    public void setValidating(boolean validating)
    { validation = validating; }
 
} 
4
CodeRank
This code example shows how to use the following methods:getFeature
    /** 
     * @see SAXParserFactory#getFeature(String) 
     */ 
    public boolean getFeature(String name) throws ParserConfigurationException, SAXNotRecognizedException, SAXNotSupportedException
    { 
        return _WrappedFactory.getFeature(name);
    } 
 
    public boolean isNamespaceAware() 
    { return _WrappedFactory.isNamespaceAware(); }
    public void setNamespaceAware(boolean awareness)
    { _WrappedFactory.setNamespaceAware(awareness); }
     
    public boolean isValidating() 
    { return validation; }
    public void setValidating(boolean validating)
    { validation = validating; }
 
} 
4
CodeRank
This code example shows how to use the following methods:getFeature
 
    @Override 
    public boolean getFeature(String name)
        throws ParserConfigurationException, SAXNotRecognizedException, 
        SAXNotSupportedException { 
      return factory.getFeature(name);
    } 
 
    @Override 
    public Schema getSchema() throws UnsupportedOperationException {
      return factory.getSchema();
    } 
 
    @Override 
    public void setSchema(Schema schema) throws UnsupportedOperationException {
      factory.setSchema(schema);
    } 
 
    @Override 
    public void setXIncludeAware(boolean state)
3
CodeRank
getFeature Method Overview
Returns the particular property requested for in the underlying implementation of org.xml.sax.XMLReader.
See Code Examples for other Java 8 SAXParserFactory Methods: