com.sun.org.apache.xerces.internal.util.EntityResolver2Wrapper Java Examples

The following examples show how to use com.sun.org.apache.xerces.internal.util.EntityResolver2Wrapper. 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: AbstractSAXParser.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
/**
 * Return the current entity resolver.
 *
 * @return The current entity resolver, or null if none
 *         has been registered.
 * @see #setEntityResolver
 */
public EntityResolver getEntityResolver() {

    EntityResolver entityResolver = null;
    try {
        XMLEntityResolver xmlEntityResolver =
            (XMLEntityResolver)fConfiguration.getProperty(ENTITY_RESOLVER);
        if (xmlEntityResolver != null) {
            if (xmlEntityResolver instanceof EntityResolverWrapper) {
                entityResolver =
                    ((EntityResolverWrapper) xmlEntityResolver).getEntityResolver();
            }
            else if (xmlEntityResolver instanceof EntityResolver2Wrapper) {
                entityResolver =
                    ((EntityResolver2Wrapper) xmlEntityResolver).getEntityResolver();
            }
        }
    }
    catch (XMLConfigurationException e) {
        // do nothing
    }
    return entityResolver;

}
 
Example #2
Source File: DOMParser.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Return the current entity resolver.
 *
 * @return The current entity resolver, or null if none
 *         has been registered.
 * @see #setEntityResolver
 */
public EntityResolver getEntityResolver() {

    EntityResolver entityResolver = null;
    try {
        XMLEntityResolver xmlEntityResolver =
            (XMLEntityResolver)fConfiguration.getProperty(ENTITY_RESOLVER);
        if (xmlEntityResolver != null) {
            if (xmlEntityResolver instanceof EntityResolverWrapper) {
                entityResolver =
                    ((EntityResolverWrapper) xmlEntityResolver).getEntityResolver();
            }
            else if (xmlEntityResolver instanceof EntityResolver2Wrapper) {
                entityResolver =
                    ((EntityResolver2Wrapper) xmlEntityResolver).getEntityResolver();
            }
        }
    }
    catch (XMLConfigurationException e) {
        // do nothing
    }
    return entityResolver;

}
 
Example #3
Source File: AbstractSAXParser.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Return the current entity resolver.
 *
 * @return The current entity resolver, or null if none
 *         has been registered.
 * @see #setEntityResolver
 */
public EntityResolver getEntityResolver() {

    EntityResolver entityResolver = null;
    try {
        XMLEntityResolver xmlEntityResolver =
            (XMLEntityResolver)fConfiguration.getProperty(ENTITY_RESOLVER);
        if (xmlEntityResolver != null) {
            if (xmlEntityResolver instanceof EntityResolverWrapper) {
                entityResolver =
                    ((EntityResolverWrapper) xmlEntityResolver).getEntityResolver();
            }
            else if (xmlEntityResolver instanceof EntityResolver2Wrapper) {
                entityResolver =
                    ((EntityResolver2Wrapper) xmlEntityResolver).getEntityResolver();
            }
        }
    }
    catch (XMLConfigurationException e) {
        // do nothing
    }
    return entityResolver;

}
 
Example #4
Source File: DOMParser.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Return the current entity resolver.
 *
 * @return The current entity resolver, or null if none
 *         has been registered.
 * @see #setEntityResolver
 */
public EntityResolver getEntityResolver() {

    EntityResolver entityResolver = null;
    try {
        XMLEntityResolver xmlEntityResolver =
            (XMLEntityResolver)fConfiguration.getProperty(ENTITY_RESOLVER);
        if (xmlEntityResolver != null) {
            if (xmlEntityResolver instanceof EntityResolverWrapper) {
                entityResolver =
                    ((EntityResolverWrapper) xmlEntityResolver).getEntityResolver();
            }
            else if (xmlEntityResolver instanceof EntityResolver2Wrapper) {
                entityResolver =
                    ((EntityResolver2Wrapper) xmlEntityResolver).getEntityResolver();
            }
        }
    }
    catch (XMLConfigurationException e) {
        // do nothing
    }
    return entityResolver;

}
 
Example #5
Source File: AbstractSAXParser.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Return the current entity resolver.
 *
 * @return The current entity resolver, or null if none
 *         has been registered.
 * @see #setEntityResolver
 */
public EntityResolver getEntityResolver() {

    EntityResolver entityResolver = null;
    try {
        XMLEntityResolver xmlEntityResolver =
            (XMLEntityResolver)fConfiguration.getProperty(ENTITY_RESOLVER);
        if (xmlEntityResolver != null) {
            if (xmlEntityResolver instanceof EntityResolverWrapper) {
                entityResolver =
                    ((EntityResolverWrapper) xmlEntityResolver).getEntityResolver();
            }
            else if (xmlEntityResolver instanceof EntityResolver2Wrapper) {
                entityResolver =
                    ((EntityResolver2Wrapper) xmlEntityResolver).getEntityResolver();
            }
        }
    }
    catch (XMLConfigurationException e) {
        // do nothing
    }
    return entityResolver;

}
 
Example #6
Source File: DOMParser.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Return the current entity resolver.
 *
 * @return The current entity resolver, or null if none
 *         has been registered.
 * @see #setEntityResolver
 */
public EntityResolver getEntityResolver() {

    EntityResolver entityResolver = null;
    try {
        XMLEntityResolver xmlEntityResolver =
            (XMLEntityResolver)fConfiguration.getProperty(ENTITY_RESOLVER);
        if (xmlEntityResolver != null) {
            if (xmlEntityResolver instanceof EntityResolverWrapper) {
                entityResolver =
                    ((EntityResolverWrapper) xmlEntityResolver).getEntityResolver();
            }
            else if (xmlEntityResolver instanceof EntityResolver2Wrapper) {
                entityResolver =
                    ((EntityResolver2Wrapper) xmlEntityResolver).getEntityResolver();
            }
        }
    }
    catch (XMLConfigurationException e) {
        // do nothing
    }
    return entityResolver;

}
 
Example #7
Source File: AbstractSAXParser.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Return the current entity resolver.
 *
 * @return The current entity resolver, or null if none
 *         has been registered.
 * @see #setEntityResolver
 */
public EntityResolver getEntityResolver() {

    EntityResolver entityResolver = null;
    try {
        XMLEntityResolver xmlEntityResolver =
            (XMLEntityResolver)fConfiguration.getProperty(ENTITY_RESOLVER);
        if (xmlEntityResolver != null) {
            if (xmlEntityResolver instanceof EntityResolverWrapper) {
                entityResolver =
                    ((EntityResolverWrapper) xmlEntityResolver).getEntityResolver();
            }
            else if (xmlEntityResolver instanceof EntityResolver2Wrapper) {
                entityResolver =
                    ((EntityResolver2Wrapper) xmlEntityResolver).getEntityResolver();
            }
        }
    }
    catch (XMLConfigurationException e) {
        // do nothing
    }
    return entityResolver;

}
 
Example #8
Source File: DOMParser.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Return the current entity resolver.
 *
 * @return The current entity resolver, or null if none
 *         has been registered.
 * @see #setEntityResolver
 */
public EntityResolver getEntityResolver() {

    EntityResolver entityResolver = null;
    try {
        XMLEntityResolver xmlEntityResolver =
            (XMLEntityResolver)fConfiguration.getProperty(ENTITY_RESOLVER);
        if (xmlEntityResolver != null) {
            if (xmlEntityResolver instanceof EntityResolverWrapper) {
                entityResolver =
                    ((EntityResolverWrapper) xmlEntityResolver).getEntityResolver();
            }
            else if (xmlEntityResolver instanceof EntityResolver2Wrapper) {
                entityResolver =
                    ((EntityResolver2Wrapper) xmlEntityResolver).getEntityResolver();
            }
        }
    }
    catch (XMLConfigurationException e) {
        // do nothing
    }
    return entityResolver;

}
 
Example #9
Source File: AbstractSAXParser.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Return the current entity resolver.
 *
 * @return The current entity resolver, or null if none
 *         has been registered.
 * @see #setEntityResolver
 */
public EntityResolver getEntityResolver() {

    EntityResolver entityResolver = null;
    try {
        XMLEntityResolver xmlEntityResolver =
            (XMLEntityResolver)fConfiguration.getProperty(ENTITY_RESOLVER);
        if (xmlEntityResolver != null) {
            if (xmlEntityResolver instanceof EntityResolverWrapper) {
                entityResolver =
                    ((EntityResolverWrapper) xmlEntityResolver).getEntityResolver();
            }
            else if (xmlEntityResolver instanceof EntityResolver2Wrapper) {
                entityResolver =
                    ((EntityResolver2Wrapper) xmlEntityResolver).getEntityResolver();
            }
        }
    }
    catch (XMLConfigurationException e) {
        // do nothing
    }
    return entityResolver;

}
 
Example #10
Source File: DOMParser.java    From Bytecoder with Apache License 2.0 6 votes vote down vote up
/**
 * Return the current entity resolver.
 *
 * @return The current entity resolver, or null if none
 *         has been registered.
 * @see #setEntityResolver
 */
public EntityResolver getEntityResolver() {

    EntityResolver entityResolver = null;
    try {
        XMLEntityResolver xmlEntityResolver =
            (XMLEntityResolver)fConfiguration.getProperty(ENTITY_RESOLVER);
        if (xmlEntityResolver != null) {
            if (xmlEntityResolver instanceof EntityResolverWrapper) {
                entityResolver =
                    ((EntityResolverWrapper) xmlEntityResolver).getEntityResolver();
            }
            else if (xmlEntityResolver instanceof EntityResolver2Wrapper) {
                entityResolver =
                    ((EntityResolver2Wrapper) xmlEntityResolver).getEntityResolver();
            }
        }
    }
    catch (XMLConfigurationException e) {
        // do nothing
    }
    return entityResolver;

}
 
Example #11
Source File: AbstractSAXParser.java    From Bytecoder with Apache License 2.0 6 votes vote down vote up
/**
 * Return the current entity resolver.
 *
 * @return The current entity resolver, or null if none
 *         has been registered.
 * @see #setEntityResolver
 */
public EntityResolver getEntityResolver() {

    EntityResolver entityResolver = null;
    try {
        XMLEntityResolver xmlEntityResolver =
            (XMLEntityResolver)fConfiguration.getProperty(ENTITY_RESOLVER);
        if (xmlEntityResolver != null) {
            if (xmlEntityResolver instanceof EntityResolverWrapper) {
                entityResolver =
                    ((EntityResolverWrapper) xmlEntityResolver).getEntityResolver();
            }
            else if (xmlEntityResolver instanceof EntityResolver2Wrapper) {
                entityResolver =
                    ((EntityResolver2Wrapper) xmlEntityResolver).getEntityResolver();
            }
        }
    }
    catch (XMLConfigurationException e) {
        // do nothing
    }
    return entityResolver;

}
 
Example #12
Source File: DOMParser.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Return the current entity resolver.
 *
 * @return The current entity resolver, or null if none
 *         has been registered.
 * @see #setEntityResolver
 */
public EntityResolver getEntityResolver() {

    EntityResolver entityResolver = null;
    try {
        XMLEntityResolver xmlEntityResolver =
            (XMLEntityResolver)fConfiguration.getProperty(ENTITY_RESOLVER);
        if (xmlEntityResolver != null) {
            if (xmlEntityResolver instanceof EntityResolverWrapper) {
                entityResolver =
                    ((EntityResolverWrapper) xmlEntityResolver).getEntityResolver();
            }
            else if (xmlEntityResolver instanceof EntityResolver2Wrapper) {
                entityResolver =
                    ((EntityResolver2Wrapper) xmlEntityResolver).getEntityResolver();
            }
        }
    }
    catch (XMLConfigurationException e) {
        // do nothing
    }
    return entityResolver;

}
 
Example #13
Source File: AbstractSAXParser.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Return the current entity resolver.
 *
 * @return The current entity resolver, or null if none
 *         has been registered.
 * @see #setEntityResolver
 */
public EntityResolver getEntityResolver() {

    EntityResolver entityResolver = null;
    try {
        XMLEntityResolver xmlEntityResolver =
            (XMLEntityResolver)fConfiguration.getProperty(ENTITY_RESOLVER);
        if (xmlEntityResolver != null) {
            if (xmlEntityResolver instanceof EntityResolverWrapper) {
                entityResolver =
                    ((EntityResolverWrapper) xmlEntityResolver).getEntityResolver();
            }
            else if (xmlEntityResolver instanceof EntityResolver2Wrapper) {
                entityResolver =
                    ((EntityResolver2Wrapper) xmlEntityResolver).getEntityResolver();
            }
        }
    }
    catch (XMLConfigurationException e) {
        // do nothing
    }
    return entityResolver;

}
 
Example #14
Source File: DOMParser.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Return the current entity resolver.
 *
 * @return The current entity resolver, or null if none
 *         has been registered.
 * @see #setEntityResolver
 */
public EntityResolver getEntityResolver() {

    EntityResolver entityResolver = null;
    try {
        XMLEntityResolver xmlEntityResolver =
            (XMLEntityResolver)fConfiguration.getProperty(ENTITY_RESOLVER);
        if (xmlEntityResolver != null) {
            if (xmlEntityResolver instanceof EntityResolverWrapper) {
                entityResolver =
                    ((EntityResolverWrapper) xmlEntityResolver).getEntityResolver();
            }
            else if (xmlEntityResolver instanceof EntityResolver2Wrapper) {
                entityResolver =
                    ((EntityResolver2Wrapper) xmlEntityResolver).getEntityResolver();
            }
        }
    }
    catch (XMLConfigurationException e) {
        // do nothing
    }
    return entityResolver;

}
 
Example #15
Source File: AbstractSAXParser.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Return the current entity resolver.
 *
 * @return The current entity resolver, or null if none
 *         has been registered.
 * @see #setEntityResolver
 */
public EntityResolver getEntityResolver() {

    EntityResolver entityResolver = null;
    try {
        XMLEntityResolver xmlEntityResolver =
            (XMLEntityResolver)fConfiguration.getProperty(ENTITY_RESOLVER);
        if (xmlEntityResolver != null) {
            if (xmlEntityResolver instanceof EntityResolverWrapper) {
                entityResolver =
                    ((EntityResolverWrapper) xmlEntityResolver).getEntityResolver();
            }
            else if (xmlEntityResolver instanceof EntityResolver2Wrapper) {
                entityResolver =
                    ((EntityResolver2Wrapper) xmlEntityResolver).getEntityResolver();
            }
        }
    }
    catch (XMLConfigurationException e) {
        // do nothing
    }
    return entityResolver;

}
 
Example #16
Source File: DOMParser.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Return the current entity resolver.
 *
 * @return The current entity resolver, or null if none
 *         has been registered.
 * @see #setEntityResolver
 */
public EntityResolver getEntityResolver() {

    EntityResolver entityResolver = null;
    try {
        XMLEntityResolver xmlEntityResolver =
            (XMLEntityResolver)fConfiguration.getProperty(ENTITY_RESOLVER);
        if (xmlEntityResolver != null) {
            if (xmlEntityResolver instanceof EntityResolverWrapper) {
                entityResolver =
                    ((EntityResolverWrapper) xmlEntityResolver).getEntityResolver();
            }
            else if (xmlEntityResolver instanceof EntityResolver2Wrapper) {
                entityResolver =
                    ((EntityResolver2Wrapper) xmlEntityResolver).getEntityResolver();
            }
        }
    }
    catch (XMLConfigurationException e) {
        // do nothing
    }
    return entityResolver;

}
 
Example #17
Source File: DOMParser.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Return the current entity resolver.
 *
 * @return The current entity resolver, or null if none
 *         has been registered.
 * @see #setEntityResolver
 */
public EntityResolver getEntityResolver() {

    EntityResolver entityResolver = null;
    try {
        XMLEntityResolver xmlEntityResolver =
            (XMLEntityResolver)fConfiguration.getProperty(ENTITY_RESOLVER);
        if (xmlEntityResolver != null) {
            if (xmlEntityResolver instanceof EntityResolverWrapper) {
                entityResolver =
                    ((EntityResolverWrapper) xmlEntityResolver).getEntityResolver();
            }
            else if (xmlEntityResolver instanceof EntityResolver2Wrapper) {
                entityResolver =
                    ((EntityResolver2Wrapper) xmlEntityResolver).getEntityResolver();
            }
        }
    }
    catch (XMLConfigurationException e) {
        // do nothing
    }
    return entityResolver;

}
 
Example #18
Source File: DOMParser.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
/**
 * Return the current entity resolver.
 *
 * @return The current entity resolver, or null if none
 *         has been registered.
 * @see #setEntityResolver
 */
public EntityResolver getEntityResolver() {

    EntityResolver entityResolver = null;
    try {
        XMLEntityResolver xmlEntityResolver =
            (XMLEntityResolver)fConfiguration.getProperty(ENTITY_RESOLVER);
        if (xmlEntityResolver != null) {
            if (xmlEntityResolver instanceof EntityResolverWrapper) {
                entityResolver =
                    ((EntityResolverWrapper) xmlEntityResolver).getEntityResolver();
            }
            else if (xmlEntityResolver instanceof EntityResolver2Wrapper) {
                entityResolver =
                    ((EntityResolver2Wrapper) xmlEntityResolver).getEntityResolver();
            }
        }
    }
    catch (XMLConfigurationException e) {
        // do nothing
    }
    return entityResolver;

}
 
Example #19
Source File: AbstractSAXParser.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Return the current entity resolver.
 *
 * @return The current entity resolver, or null if none
 *         has been registered.
 * @see #setEntityResolver
 */
public EntityResolver getEntityResolver() {

    EntityResolver entityResolver = null;
    try {
        XMLEntityResolver xmlEntityResolver =
            (XMLEntityResolver)fConfiguration.getProperty(ENTITY_RESOLVER);
        if (xmlEntityResolver != null) {
            if (xmlEntityResolver instanceof EntityResolverWrapper) {
                entityResolver =
                    ((EntityResolverWrapper) xmlEntityResolver).getEntityResolver();
            }
            else if (xmlEntityResolver instanceof EntityResolver2Wrapper) {
                entityResolver =
                    ((EntityResolver2Wrapper) xmlEntityResolver).getEntityResolver();
            }
        }
    }
    catch (XMLConfigurationException e) {
        // do nothing
    }
    return entityResolver;

}
 
Example #20
Source File: AbstractSAXParser.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Return the current entity resolver.
 *
 * @return The current entity resolver, or null if none
 *         has been registered.
 * @see #setEntityResolver
 */
public EntityResolver getEntityResolver() {

    EntityResolver entityResolver = null;
    try {
        XMLEntityResolver xmlEntityResolver =
            (XMLEntityResolver)fConfiguration.getProperty(ENTITY_RESOLVER);
        if (xmlEntityResolver != null) {
            if (xmlEntityResolver instanceof EntityResolverWrapper) {
                entityResolver =
                    ((EntityResolverWrapper) xmlEntityResolver).getEntityResolver();
            }
            else if (xmlEntityResolver instanceof EntityResolver2Wrapper) {
                entityResolver =
                    ((EntityResolver2Wrapper) xmlEntityResolver).getEntityResolver();
            }
        }
    }
    catch (XMLConfigurationException e) {
        // do nothing
    }
    return entityResolver;

}
 
Example #21
Source File: DOMParser.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
/**
 * Return the current entity resolver.
 *
 * @return The current entity resolver, or null if none
 *         has been registered.
 * @see #setEntityResolver
 */
public EntityResolver getEntityResolver() {

    EntityResolver entityResolver = null;
    try {
        XMLEntityResolver xmlEntityResolver =
            (XMLEntityResolver)fConfiguration.getProperty(ENTITY_RESOLVER);
        if (xmlEntityResolver != null) {
            if (xmlEntityResolver instanceof EntityResolverWrapper) {
                entityResolver =
                    ((EntityResolverWrapper) xmlEntityResolver).getEntityResolver();
            }
            else if (xmlEntityResolver instanceof EntityResolver2Wrapper) {
                entityResolver =
                    ((EntityResolver2Wrapper) xmlEntityResolver).getEntityResolver();
            }
        }
    }
    catch (XMLConfigurationException e) {
        // do nothing
    }
    return entityResolver;

}
 
Example #22
Source File: AbstractSAXParser.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
/**
 * Return the current entity resolver.
 *
 * @return The current entity resolver, or null if none
 *         has been registered.
 * @see #setEntityResolver
 */
public EntityResolver getEntityResolver() {

    EntityResolver entityResolver = null;
    try {
        XMLEntityResolver xmlEntityResolver =
            (XMLEntityResolver)fConfiguration.getProperty(ENTITY_RESOLVER);
        if (xmlEntityResolver != null) {
            if (xmlEntityResolver instanceof EntityResolverWrapper) {
                entityResolver =
                    ((EntityResolverWrapper) xmlEntityResolver).getEntityResolver();
            }
            else if (xmlEntityResolver instanceof EntityResolver2Wrapper) {
                entityResolver =
                    ((EntityResolver2Wrapper) xmlEntityResolver).getEntityResolver();
            }
        }
    }
    catch (XMLConfigurationException e) {
        // do nothing
    }
    return entityResolver;

}
 
Example #23
Source File: AbstractSAXParser.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Sets the resolver used to resolve external entities. The EntityResolver
 * interface supports resolution of public and system identifiers.
 *
 * @param resolver The new entity resolver. Passing a null value will
 *                 uninstall the currently installed resolver.
 */
public void setEntityResolver(EntityResolver resolver) {

    try {
        XMLEntityResolver xer = (XMLEntityResolver) fConfiguration.getProperty(ENTITY_RESOLVER);
        if (fUseEntityResolver2 && resolver instanceof EntityResolver2) {
            if (xer instanceof EntityResolver2Wrapper) {
                EntityResolver2Wrapper er2w = (EntityResolver2Wrapper) xer;
                er2w.setEntityResolver((EntityResolver2) resolver);
            }
            else {
                fConfiguration.setProperty(ENTITY_RESOLVER,
                        new EntityResolver2Wrapper((EntityResolver2) resolver));
            }
        }
        else {
            if (xer instanceof EntityResolverWrapper) {
                EntityResolverWrapper erw = (EntityResolverWrapper) xer;
                erw.setEntityResolver(resolver);
            }
            else {
                fConfiguration.setProperty(ENTITY_RESOLVER,
                        new EntityResolverWrapper(resolver));
            }
        }
    }
    catch (XMLConfigurationException e) {
        // do nothing
    }

}
 
Example #24
Source File: DOMParser.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Sets the resolver used to resolve external entities. The EntityResolver
 * interface supports resolution of public and system identifiers.
 *
 * @param resolver The new entity resolver. Passing a null value will
 *                 uninstall the currently installed resolver.
 */
public void setEntityResolver(EntityResolver resolver) {

    try {
        XMLEntityResolver xer = (XMLEntityResolver) fConfiguration.getProperty(ENTITY_RESOLVER);
        if (fUseEntityResolver2 && resolver instanceof EntityResolver2) {
            if (xer instanceof EntityResolver2Wrapper) {
                EntityResolver2Wrapper er2w = (EntityResolver2Wrapper) xer;
                er2w.setEntityResolver((EntityResolver2) resolver);
            }
            else {
                fConfiguration.setProperty(ENTITY_RESOLVER,
                        new EntityResolver2Wrapper((EntityResolver2) resolver));
            }
        }
        else {
            if (xer instanceof EntityResolverWrapper) {
                EntityResolverWrapper erw = (EntityResolverWrapper) xer;
                erw.setEntityResolver(resolver);
            }
            else {
                fConfiguration.setProperty(ENTITY_RESOLVER,
                        new EntityResolverWrapper(resolver));
            }
        }
    }
    catch (XMLConfigurationException e) {
        // do nothing
    }

}
 
Example #25
Source File: AbstractSAXParser.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Sets the resolver used to resolve external entities. The EntityResolver
 * interface supports resolution of public and system identifiers.
 *
 * @param resolver The new entity resolver. Passing a null value will
 *                 uninstall the currently installed resolver.
 */
public void setEntityResolver(EntityResolver resolver) {

    try {
        XMLEntityResolver xer = (XMLEntityResolver) fConfiguration.getProperty(ENTITY_RESOLVER);
        if (fUseEntityResolver2 && resolver instanceof EntityResolver2) {
            if (xer instanceof EntityResolver2Wrapper) {
                EntityResolver2Wrapper er2w = (EntityResolver2Wrapper) xer;
                er2w.setEntityResolver((EntityResolver2) resolver);
            }
            else {
                fConfiguration.setProperty(ENTITY_RESOLVER,
                        new EntityResolver2Wrapper((EntityResolver2) resolver));
            }
        }
        else {
            if (xer instanceof EntityResolverWrapper) {
                EntityResolverWrapper erw = (EntityResolverWrapper) xer;
                erw.setEntityResolver(resolver);
            }
            else {
                fConfiguration.setProperty(ENTITY_RESOLVER,
                        new EntityResolverWrapper(resolver));
            }
        }
    }
    catch (XMLConfigurationException e) {
        // do nothing
    }

}
 
Example #26
Source File: AbstractSAXParser.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Sets the resolver used to resolve external entities. The EntityResolver
 * interface supports resolution of public and system identifiers.
 *
 * @param resolver The new entity resolver. Passing a null value will
 *                 uninstall the currently installed resolver.
 */
public void setEntityResolver(EntityResolver resolver) {

    try {
        XMLEntityResolver xer = (XMLEntityResolver) fConfiguration.getProperty(ENTITY_RESOLVER);
        if (fUseEntityResolver2 && resolver instanceof EntityResolver2) {
            if (xer instanceof EntityResolver2Wrapper) {
                EntityResolver2Wrapper er2w = (EntityResolver2Wrapper) xer;
                er2w.setEntityResolver((EntityResolver2) resolver);
            }
            else {
                fConfiguration.setProperty(ENTITY_RESOLVER,
                        new EntityResolver2Wrapper((EntityResolver2) resolver));
            }
        }
        else {
            if (xer instanceof EntityResolverWrapper) {
                EntityResolverWrapper erw = (EntityResolverWrapper) xer;
                erw.setEntityResolver(resolver);
            }
            else {
                fConfiguration.setProperty(ENTITY_RESOLVER,
                        new EntityResolverWrapper(resolver));
            }
        }
    }
    catch (XMLConfigurationException e) {
        // do nothing
    }

}
 
Example #27
Source File: AbstractSAXParser.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Sets the resolver used to resolve external entities. The EntityResolver
 * interface supports resolution of public and system identifiers.
 *
 * @param resolver The new entity resolver. Passing a null value will
 *                 uninstall the currently installed resolver.
 */
public void setEntityResolver(EntityResolver resolver) {

    try {
        XMLEntityResolver xer = (XMLEntityResolver) fConfiguration.getProperty(ENTITY_RESOLVER);
        if (fUseEntityResolver2 && resolver instanceof EntityResolver2) {
            if (xer instanceof EntityResolver2Wrapper) {
                EntityResolver2Wrapper er2w = (EntityResolver2Wrapper) xer;
                er2w.setEntityResolver((EntityResolver2) resolver);
            }
            else {
                fConfiguration.setProperty(ENTITY_RESOLVER,
                        new EntityResolver2Wrapper((EntityResolver2) resolver));
            }
        }
        else {
            if (xer instanceof EntityResolverWrapper) {
                EntityResolverWrapper erw = (EntityResolverWrapper) xer;
                erw.setEntityResolver(resolver);
            }
            else {
                fConfiguration.setProperty(ENTITY_RESOLVER,
                        new EntityResolverWrapper(resolver));
            }
        }
    }
    catch (XMLConfigurationException e) {
        // do nothing
    }

}
 
Example #28
Source File: DOMParser.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
/**
 * Sets the resolver used to resolve external entities. The EntityResolver
 * interface supports resolution of public and system identifiers.
 *
 * @param resolver The new entity resolver. Passing a null value will
 *                 uninstall the currently installed resolver.
 */
public void setEntityResolver(EntityResolver resolver) {

    try {
        XMLEntityResolver xer = (XMLEntityResolver) fConfiguration.getProperty(ENTITY_RESOLVER);
        if (fUseEntityResolver2 && resolver instanceof EntityResolver2) {
            if (xer instanceof EntityResolver2Wrapper) {
                EntityResolver2Wrapper er2w = (EntityResolver2Wrapper) xer;
                er2w.setEntityResolver((EntityResolver2) resolver);
            }
            else {
                fConfiguration.setProperty(ENTITY_RESOLVER,
                        new EntityResolver2Wrapper((EntityResolver2) resolver));
            }
        }
        else {
            if (xer instanceof EntityResolverWrapper) {
                EntityResolverWrapper erw = (EntityResolverWrapper) xer;
                erw.setEntityResolver(resolver);
            }
            else {
                fConfiguration.setProperty(ENTITY_RESOLVER,
                        new EntityResolverWrapper(resolver));
            }
        }
    }
    catch (XMLConfigurationException e) {
        // do nothing
    }

}
 
Example #29
Source File: DOMParser.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Sets the resolver used to resolve external entities. The EntityResolver
 * interface supports resolution of public and system identifiers.
 *
 * @param resolver The new entity resolver. Passing a null value will
 *                 uninstall the currently installed resolver.
 */
public void setEntityResolver(EntityResolver resolver) {

    try {
        XMLEntityResolver xer = (XMLEntityResolver) fConfiguration.getProperty(ENTITY_RESOLVER);
        if (fUseEntityResolver2 && resolver instanceof EntityResolver2) {
            if (xer instanceof EntityResolver2Wrapper) {
                EntityResolver2Wrapper er2w = (EntityResolver2Wrapper) xer;
                er2w.setEntityResolver((EntityResolver2) resolver);
            }
            else {
                fConfiguration.setProperty(ENTITY_RESOLVER,
                        new EntityResolver2Wrapper((EntityResolver2) resolver));
            }
        }
        else {
            if (xer instanceof EntityResolverWrapper) {
                EntityResolverWrapper erw = (EntityResolverWrapper) xer;
                erw.setEntityResolver(resolver);
            }
            else {
                fConfiguration.setProperty(ENTITY_RESOLVER,
                        new EntityResolverWrapper(resolver));
            }
        }
    }
    catch (XMLConfigurationException e) {
        // do nothing
    }

}
 
Example #30
Source File: DOMParser.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Sets the resolver used to resolve external entities. The EntityResolver
 * interface supports resolution of public and system identifiers.
 *
 * @param resolver The new entity resolver. Passing a null value will
 *                 uninstall the currently installed resolver.
 */
public void setEntityResolver(EntityResolver resolver) {

    try {
        XMLEntityResolver xer = (XMLEntityResolver) fConfiguration.getProperty(ENTITY_RESOLVER);
        if (fUseEntityResolver2 && resolver instanceof EntityResolver2) {
            if (xer instanceof EntityResolver2Wrapper) {
                EntityResolver2Wrapper er2w = (EntityResolver2Wrapper) xer;
                er2w.setEntityResolver((EntityResolver2) resolver);
            }
            else {
                fConfiguration.setProperty(ENTITY_RESOLVER,
                        new EntityResolver2Wrapper((EntityResolver2) resolver));
            }
        }
        else {
            if (xer instanceof EntityResolverWrapper) {
                EntityResolverWrapper erw = (EntityResolverWrapper) xer;
                erw.setEntityResolver(resolver);
            }
            else {
                fConfiguration.setProperty(ENTITY_RESOLVER,
                        new EntityResolverWrapper(resolver));
            }
        }
    }
    catch (XMLConfigurationException e) {
        // do nothing
    }

}