Java Code Examples for com.sun.org.apache.xerces.internal.parsers.DOMParser#getFeature()

The following examples show how to use com.sun.org.apache.xerces.internal.parsers.DOMParser#getFeature() . 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: DocumentBuilderFactoryImpl.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
public boolean getFeature(String name)
    throws ParserConfigurationException {
    if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) {
        return fSecureProcess;
    }
    // See if it's in the features map
    if (features != null) {
        Boolean val = features.get(name);
        if (val != null) {
            return val;
        }
    }
    try {
        DOMParser domParser = new DocumentBuilderImpl(this, attributes, features).getDOMParser();
        return domParser.getFeature(name);
    }
    catch (SAXException e) {
        throw new ParserConfigurationException(e.getMessage());
    }
}
 
Example 2
Source File: DocumentBuilderFactoryImpl.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
public boolean getFeature(String name)
    throws ParserConfigurationException {
    if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) {
        return fSecureProcess;
    }
    // See if it's in the features Hashtable
    if (features != null) {
        Object val = features.get(name);
        if (val != null) {
            return ((Boolean) val).booleanValue();
        }
    }
    try {
        DOMParser domParser = new DocumentBuilderImpl(this, attributes, features).getDOMParser();
        return domParser.getFeature(name);
    }
    catch (SAXException e) {
        throw new ParserConfigurationException(e.getMessage());
    }
}
 
Example 3
Source File: DocumentBuilderFactoryImpl.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
public boolean getFeature(String name)
    throws ParserConfigurationException {
    if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) {
        return fSecureProcess;
    }
    // See if it's in the features map
    if (features != null) {
        Boolean val = features.get(name);
        if (val != null) {
            return val;
        }
    }
    try {
        DOMParser domParser = new DocumentBuilderImpl(this, attributes, features).getDOMParser();
        return domParser.getFeature(name);
    }
    catch (SAXException e) {
        throw new ParserConfigurationException(e.getMessage());
    }
}
 
Example 4
Source File: DocumentBuilderFactoryImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
public boolean getFeature(String name)
    throws ParserConfigurationException {
    if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) {
        return fSecureProcess;
    }
    // See if it's in the features map
    if (features != null) {
        Boolean val = features.get(name);
        if (val != null) {
            return val;
        }
    }
    try {
        DOMParser domParser = new DocumentBuilderImpl(this, attributes, features).getDOMParser();
        return domParser.getFeature(name);
    }
    catch (SAXException e) {
        throw new ParserConfigurationException(e.getMessage());
    }
}
 
Example 5
Source File: DocumentBuilderFactoryImpl.java    From Bytecoder with Apache License 2.0 6 votes vote down vote up
public boolean getFeature(String name)
    throws ParserConfigurationException {
    if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) {
        return fSecureProcess;
    }
    // See if it's in the features map
    if (features != null) {
        Boolean val = features.get(name);
        if (val != null) {
            return val;
        }
    }
    try {
        DOMParser domParser = new DocumentBuilderImpl(this, attributes, features).getDOMParser();
        return domParser.getFeature(name);
    }
    catch (SAXException e) {
        throw new ParserConfigurationException(e.getMessage());
    }
}
 
Example 6
Source File: DocumentBuilderFactoryImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
public boolean getFeature(String name)
    throws ParserConfigurationException {
    if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) {
        return fSecureProcess;
    }
    // See if it's in the features map
    if (features != null) {
        Boolean val = features.get(name);
        if (val != null) {
            return val;
        }
    }
    try {
        DOMParser domParser = new DocumentBuilderImpl(this, attributes, features).getDOMParser();
        return domParser.getFeature(name);
    }
    catch (SAXException e) {
        throw new ParserConfigurationException(e.getMessage());
    }
}
 
Example 7
Source File: DocumentBuilderFactoryImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
public boolean getFeature(String name)
    throws ParserConfigurationException {
    if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) {
        return fSecureProcess;
    }
    // See if it's in the features map
    if (features != null) {
        Boolean val = features.get(name);
        if (val != null) {
            return val;
        }
    }
    try {
        DOMParser domParser = new DocumentBuilderImpl(this, attributes, features).getDOMParser();
        return domParser.getFeature(name);
    }
    catch (SAXException e) {
        throw new ParserConfigurationException(e.getMessage());
    }
}
 
Example 8
Source File: DocumentBuilderFactoryImpl.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
public boolean getFeature(String name)
    throws ParserConfigurationException {
    if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) {
        return fSecureProcess;
    }
    // See if it's in the features map
    if (features != null) {
        Boolean val = features.get(name);
        if (val != null) {
            return val;
        }
    }
    try {
        DOMParser domParser = new DocumentBuilderImpl(this, attributes, features).getDOMParser();
        return domParser.getFeature(name);
    }
    catch (SAXException e) {
        throw new ParserConfigurationException(e.getMessage());
    }
}
 
Example 9
Source File: DocumentBuilderFactoryImpl.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
public boolean getFeature(String name)
    throws ParserConfigurationException {
    if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) {
        return fSecureProcess;
    }
    // See if it's in the features Hashtable
    if (features != null) {
        Object val = features.get(name);
        if (val != null) {
            return ((Boolean) val).booleanValue();
        }
    }
    try {
        DOMParser domParser = new DocumentBuilderImpl(this, attributes, features).getDOMParser();
        return domParser.getFeature(name);
    }
    catch (SAXException e) {
        throw new ParserConfigurationException(e.getMessage());
    }
}
 
Example 10
Source File: DocumentBuilderFactoryImpl.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
public boolean getFeature(String name)
    throws ParserConfigurationException {
    if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) {
        return fSecureProcess;
    }
    // See if it's in the features map
    if (features != null) {
        Boolean val = features.get(name);
        if (val != null) {
            return val;
        }
    }
    try {
        DOMParser domParser = new DocumentBuilderImpl(this, attributes, features).getDOMParser();
        return domParser.getFeature(name);
    }
    catch (SAXException e) {
        throw new ParserConfigurationException(e.getMessage());
    }
}
 
Example 11
Source File: DocumentBuilderFactoryImpl.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
public boolean getFeature(String name)
    throws ParserConfigurationException {
    if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) {
        return fSecureProcess;
    }
    // See if it's in the features Hashtable
    if (features != null) {
        Object val = features.get(name);
        if (val != null) {
            return ((Boolean) val).booleanValue();
        }
    }
    try {
        DOMParser domParser = new DocumentBuilderImpl(this, attributes, features).getDOMParser();
        return domParser.getFeature(name);
    }
    catch (SAXException e) {
        throw new ParserConfigurationException(e.getMessage());
    }
}
 
Example 12
Source File: DocumentBuilderFactoryImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Allows the user to retrieve specific attributes on the underlying
 * implementation.
 */
public Object getAttribute(String name)
    throws IllegalArgumentException
{
    // See if it's in the attributes Map
    if (attributes != null) {
        Object val = attributes.get(name);
        if (val != null) {
            return val;
        }
    }

    DOMParser domParser = null;
    try {
        // We create a dummy DocumentBuilderImpl in case the attribute
        // name is not one that is in the attributes map.
        domParser =
            new DocumentBuilderImpl(this, attributes, features).getDOMParser();
        return domParser.getProperty(name);
    } catch (SAXException se1) {
        // assert(name is not recognized or not supported), try feature
        try {
            boolean result = domParser.getFeature(name);
            // Must have been a feature
            return result ? Boolean.TRUE : Boolean.FALSE;
        } catch (SAXException se2) {
            // Not a property or a feature
            throw new IllegalArgumentException(se1.getMessage());
        }
    }
}
 
Example 13
Source File: DocumentBuilderFactoryImpl.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/**
 * Allows the user to retrieve specific attributes on the underlying
 * implementation.
 */
public Object getAttribute(String name)
    throws IllegalArgumentException
{
    // See if it's in the attributes Map
    if (attributes != null) {
        Object val = attributes.get(name);
        if (val != null) {
            return val;
        }
    }

    DOMParser domParser = null;
    try {
        // We create a dummy DocumentBuilderImpl in case the attribute
        // name is not one that is in the attributes map.
        domParser =
            new DocumentBuilderImpl(this, attributes, features).getDOMParser();
        return domParser.getProperty(name);
    } catch (SAXException se1) {
        // assert(name is not recognized or not supported), try feature
        try {
            boolean result = domParser.getFeature(name);
            // Must have been a feature
            return result ? Boolean.TRUE : Boolean.FALSE;
        } catch (SAXException se2) {
            // Not a property or a feature
            throw new IllegalArgumentException(se1.getMessage());
        }
    }
}
 
Example 14
Source File: DocumentBuilderFactoryImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Allows the user to retrieve specific attributes on the underlying
 * implementation.
 */
public Object getAttribute(String name)
    throws IllegalArgumentException
{
    // See if it's in the attributes Map
    if (attributes != null) {
        Object val = attributes.get(name);
        if (val != null) {
            return val;
        }
    }

    DOMParser domParser = null;
    try {
        // We create a dummy DocumentBuilderImpl in case the attribute
        // name is not one that is in the attributes map.
        domParser =
            new DocumentBuilderImpl(this, attributes, features).getDOMParser();
        return domParser.getProperty(name);
    } catch (SAXException se1) {
        // assert(name is not recognized or not supported), try feature
        try {
            boolean result = domParser.getFeature(name);
            // Must have been a feature
            return result ? Boolean.TRUE : Boolean.FALSE;
        } catch (SAXException se2) {
            // Not a property or a feature
            throw new IllegalArgumentException(se1.getMessage());
        }
    }
}
 
Example 15
Source File: DocumentBuilderFactoryImpl.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
/**
 * Allows the user to retrieve specific attributes on the underlying
 * implementation.
 */
public Object getAttribute(String name)
    throws IllegalArgumentException
{
    // See if it's in the attributes Map
    if (attributes != null) {
        Object val = attributes.get(name);
        if (val != null) {
            return val;
        }
    }

    DOMParser domParser = null;
    try {
        // We create a dummy DocumentBuilderImpl in case the attribute
        // name is not one that is in the attributes map.
        domParser =
            new DocumentBuilderImpl(this, attributes, features).getDOMParser();
        return domParser.getProperty(name);
    } catch (SAXException se1) {
        // assert(name is not recognized or not supported), try feature
        try {
            boolean result = domParser.getFeature(name);
            // Must have been a feature
            return result ? Boolean.TRUE : Boolean.FALSE;
        } catch (SAXException se2) {
            // Not a property or a feature
            throw new IllegalArgumentException(se1.getMessage());
        }
    }
}
 
Example 16
Source File: DocumentBuilderFactoryImpl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Allows the user to retrieve specific attributes on the underlying
 * implementation.
 */
public Object getAttribute(String name)
    throws IllegalArgumentException
{
    // See if it's in the attributes Hashtable
    if (attributes != null) {
        Object val = attributes.get(name);
        if (val != null) {
            return val;
        }
    }

    DOMParser domParser = null;
    try {
        // We create a dummy DocumentBuilderImpl in case the attribute
        // name is not one that is in the attributes hashtable.
        domParser =
            new DocumentBuilderImpl(this, attributes, features).getDOMParser();
        return domParser.getProperty(name);
    } catch (SAXException se1) {
        // assert(name is not recognized or not supported), try feature
        try {
            boolean result = domParser.getFeature(name);
            // Must have been a feature
            return result ? Boolean.TRUE : Boolean.FALSE;
        } catch (SAXException se2) {
            // Not a property or a feature
            throw new IllegalArgumentException(se1.getMessage());
        }
    }
}
 
Example 17
Source File: DocumentBuilderFactoryImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Allows the user to retrieve specific attributes on the underlying
 * implementation.
 */
public Object getAttribute(String name)
    throws IllegalArgumentException
{
    // See if it's in the attributes Map
    if (attributes != null) {
        Object val = attributes.get(name);
        if (val != null) {
            return val;
        }
    }

    DOMParser domParser = null;
    try {
        // We create a dummy DocumentBuilderImpl in case the attribute
        // name is not one that is in the attributes map.
        domParser =
            new DocumentBuilderImpl(this, attributes, features).getDOMParser();
        return domParser.getProperty(name);
    } catch (SAXException se1) {
        // assert(name is not recognized or not supported), try feature
        try {
            boolean result = domParser.getFeature(name);
            // Must have been a feature
            return result ? Boolean.TRUE : Boolean.FALSE;
        } catch (SAXException se2) {
            // Not a property or a feature
            throw new IllegalArgumentException(se1.getMessage());
        }
    }
}
 
Example 18
Source File: DocumentBuilderFactoryImpl.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Allows the user to retrieve specific attributes on the underlying
 * implementation.
 */
public Object getAttribute(String name)
    throws IllegalArgumentException
{
    // See if it's in the attributes Hashtable
    if (attributes != null) {
        Object val = attributes.get(name);
        if (val != null) {
            return val;
        }
    }

    DOMParser domParser = null;
    try {
        // We create a dummy DocumentBuilderImpl in case the attribute
        // name is not one that is in the attributes hashtable.
        domParser =
            new DocumentBuilderImpl(this, attributes, features).getDOMParser();
        return domParser.getProperty(name);
    } catch (SAXException se1) {
        // assert(name is not recognized or not supported), try feature
        try {
            boolean result = domParser.getFeature(name);
            // Must have been a feature
            return result ? Boolean.TRUE : Boolean.FALSE;
        } catch (SAXException se2) {
            // Not a property or a feature
            throw new IllegalArgumentException(se1.getMessage());
        }
    }
}
 
Example 19
Source File: DocumentBuilderFactoryImpl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Allows the user to retrieve specific attributes on the underlying
 * implementation.
 */
public Object getAttribute(String name)
    throws IllegalArgumentException
{
    // See if it's in the attributes Map
    if (attributes != null) {
        Object val = attributes.get(name);
        if (val != null) {
            return val;
        }
    }

    DOMParser domParser = null;
    try {
        // We create a dummy DocumentBuilderImpl in case the attribute
        // name is not one that is in the attributes map.
        domParser =
            new DocumentBuilderImpl(this, attributes, features).getDOMParser();
        return domParser.getProperty(name);
    } catch (SAXException se1) {
        // assert(name is not recognized or not supported), try feature
        try {
            boolean result = domParser.getFeature(name);
            // Must have been a feature
            return result ? Boolean.TRUE : Boolean.FALSE;
        } catch (SAXException se2) {
            // Not a property or a feature
            throw new IllegalArgumentException(se1.getMessage());
        }
    }
}
 
Example 20
Source File: DocumentBuilderFactoryImpl.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Allows the user to retrieve specific attributes on the underlying
 * implementation.
 */
public Object getAttribute(String name)
    throws IllegalArgumentException
{
    // See if it's in the attributes Hashtable
    if (attributes != null) {
        Object val = attributes.get(name);
        if (val != null) {
            return val;
        }
    }

    DOMParser domParser = null;
    try {
        // We create a dummy DocumentBuilderImpl in case the attribute
        // name is not one that is in the attributes hashtable.
        domParser =
            new DocumentBuilderImpl(this, attributes, features).getDOMParser();
        return domParser.getProperty(name);
    } catch (SAXException se1) {
        // assert(name is not recognized or not supported), try feature
        try {
            boolean result = domParser.getFeature(name);
            // Must have been a feature
            return result ? Boolean.TRUE : Boolean.FALSE;
        } catch (SAXException se2) {
            // Not a property or a feature
            throw new IllegalArgumentException(se1.getMessage());
        }
    }
}