com.sun.org.apache.xerces.internal.impl.XMLEntityDescription Java Examples

The following examples show how to use com.sun.org.apache.xerces.internal.impl.XMLEntityDescription. 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: EntityResolver2Wrapper.java    From jdk1.8-source-analysis with Apache License 2.0 4 votes vote down vote up
/**
 * Resolves an external parsed entity. If the entity cannot be
 * resolved, this method should return null.
 *
 * @param resourceIdentifier contains the physical co-ordinates of the resource to be resolved
 *
 * @throws XNIException Thrown on general error.
 * @throws IOException  Thrown if resolved entity stream cannot be
 *                      opened or some other i/o error occurs.
 */
public XMLInputSource resolveEntity(XMLResourceIdentifier resourceIdentifier)
        throws XNIException, IOException {

    if (fEntityResolver != null) {

        String pubId = resourceIdentifier.getPublicId();
        String sysId = resourceIdentifier.getLiteralSystemId();
        String baseURI = resourceIdentifier.getBaseSystemId();
        String name = null;
        if (resourceIdentifier instanceof XMLDTDDescription) {
            name = "[dtd]";
        }
        else if (resourceIdentifier instanceof XMLEntityDescription) {
            name = ((XMLEntityDescription) resourceIdentifier).getEntityName();
        }

        // When both pubId and sysId are null, the user's entity resolver
        // can do nothing about it. We'd better not bother calling it.
        // This happens when the resourceIdentifier is a GrammarDescription,
        // which describes a schema grammar of some namespace, but without
        // any schema location hint. -Sg
        if (pubId == null && sysId == null) {
            return null;
        }

        // Resolve using EntityResolver2
        try {
            InputSource inputSource =
                fEntityResolver.resolveEntity(name, pubId, baseURI, sysId);
            return (inputSource != null) ? createXMLInputSource(inputSource, baseURI) : null;
        }
        // error resolving entity
        catch (SAXException e) {
            Exception ex = e.getException();
            if (ex == null) {
                ex = e;
            }
            throw new XNIException(ex);
        }
    }

    // unable to resolve entity
    return null;

}
 
Example #2
Source File: EntityResolver2Wrapper.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Resolves an external parsed entity. If the entity cannot be
 * resolved, this method should return null.
 *
 * @param resourceIdentifier contains the physical co-ordinates of the resource to be resolved
 *
 * @throws XNIException Thrown on general error.
 * @throws IOException  Thrown if resolved entity stream cannot be
 *                      opened or some other i/o error occurs.
 */
public XMLInputSource resolveEntity(XMLResourceIdentifier resourceIdentifier)
        throws XNIException, IOException {

    if (fEntityResolver != null) {

        String pubId = resourceIdentifier.getPublicId();
        String sysId = resourceIdentifier.getLiteralSystemId();
        String baseURI = resourceIdentifier.getBaseSystemId();
        String name = null;
        if (resourceIdentifier instanceof XMLDTDDescription) {
            name = "[dtd]";
        }
        else if (resourceIdentifier instanceof XMLEntityDescription) {
            name = ((XMLEntityDescription) resourceIdentifier).getEntityName();
        }

        // When both pubId and sysId are null, the user's entity resolver
        // can do nothing about it. We'd better not bother calling it.
        // This happens when the resourceIdentifier is a GrammarDescription,
        // which describes a schema grammar of some namespace, but without
        // any schema location hint. -Sg
        if (pubId == null && sysId == null) {
            return null;
        }

        // Resolve using EntityResolver2
        try {
            InputSource inputSource =
                fEntityResolver.resolveEntity(name, pubId, baseURI, sysId);
            return (inputSource != null) ? createXMLInputSource(inputSource, baseURI) : null;
        }
        // error resolving entity
        catch (SAXException e) {
            Exception ex = e.getException();
            if (ex == null) {
                ex = e;
            }
            throw new XNIException(ex);
        }
    }

    // unable to resolve entity
    return null;

}
 
Example #3
Source File: EntityResolver2Wrapper.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Resolves an external parsed entity. If the entity cannot be
 * resolved, this method should return null.
 *
 * @param resourceIdentifier contains the physical co-ordinates of the resource to be resolved
 *
 * @throws XNIException Thrown on general error.
 * @throws IOException  Thrown if resolved entity stream cannot be
 *                      opened or some other i/o error occurs.
 */
public XMLInputSource resolveEntity(XMLResourceIdentifier resourceIdentifier)
        throws XNIException, IOException {

    if (fEntityResolver != null) {

        String pubId = resourceIdentifier.getPublicId();
        String sysId = resourceIdentifier.getLiteralSystemId();
        String baseURI = resourceIdentifier.getBaseSystemId();
        String name = null;
        if (resourceIdentifier instanceof XMLDTDDescription) {
            name = "[dtd]";
        }
        else if (resourceIdentifier instanceof XMLEntityDescription) {
            name = ((XMLEntityDescription) resourceIdentifier).getEntityName();
        }

        // When both pubId and sysId are null, the user's entity resolver
        // can do nothing about it. We'd better not bother calling it.
        // This happens when the resourceIdentifier is a GrammarDescription,
        // which describes a schema grammar of some namespace, but without
        // any schema location hint. -Sg
        if (pubId == null && sysId == null) {
            return null;
        }

        // Resolve using EntityResolver2
        try {
            InputSource inputSource =
                fEntityResolver.resolveEntity(name, pubId, baseURI, sysId);
            return (inputSource != null) ? createXMLInputSource(inputSource, baseURI) : null;
        }
        // error resolving entity
        catch (SAXException e) {
            Exception ex = e.getException();
            if (ex == null) {
                ex = e;
            }
            throw new XNIException(ex);
        }
    }

    // unable to resolve entity
    return null;

}
 
Example #4
Source File: EntityResolver2Wrapper.java    From JDKSourceCode1.8 with MIT License 4 votes vote down vote up
/**
 * Resolves an external parsed entity. If the entity cannot be
 * resolved, this method should return null.
 *
 * @param resourceIdentifier contains the physical co-ordinates of the resource to be resolved
 *
 * @throws XNIException Thrown on general error.
 * @throws IOException  Thrown if resolved entity stream cannot be
 *                      opened or some other i/o error occurs.
 */
public XMLInputSource resolveEntity(XMLResourceIdentifier resourceIdentifier)
        throws XNIException, IOException {

    if (fEntityResolver != null) {

        String pubId = resourceIdentifier.getPublicId();
        String sysId = resourceIdentifier.getLiteralSystemId();
        String baseURI = resourceIdentifier.getBaseSystemId();
        String name = null;
        if (resourceIdentifier instanceof XMLDTDDescription) {
            name = "[dtd]";
        }
        else if (resourceIdentifier instanceof XMLEntityDescription) {
            name = ((XMLEntityDescription) resourceIdentifier).getEntityName();
        }

        // When both pubId and sysId are null, the user's entity resolver
        // can do nothing about it. We'd better not bother calling it.
        // This happens when the resourceIdentifier is a GrammarDescription,
        // which describes a schema grammar of some namespace, but without
        // any schema location hint. -Sg
        if (pubId == null && sysId == null) {
            return null;
        }

        // Resolve using EntityResolver2
        try {
            InputSource inputSource =
                fEntityResolver.resolveEntity(name, pubId, baseURI, sysId);
            return (inputSource != null) ? createXMLInputSource(inputSource, baseURI) : null;
        }
        // error resolving entity
        catch (SAXException e) {
            Exception ex = e.getException();
            if (ex == null) {
                ex = e;
            }
            throw new XNIException(ex);
        }
    }

    // unable to resolve entity
    return null;

}
 
Example #5
Source File: EntityResolver2Wrapper.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Resolves an external parsed entity. If the entity cannot be
 * resolved, this method should return null.
 *
 * @param resourceIdentifier contains the physical co-ordinates of the resource to be resolved
 *
 * @throws XNIException Thrown on general error.
 * @throws IOException  Thrown if resolved entity stream cannot be
 *                      opened or some other i/o error occurs.
 */
public XMLInputSource resolveEntity(XMLResourceIdentifier resourceIdentifier)
        throws XNIException, IOException {

    if (fEntityResolver != null) {

        String pubId = resourceIdentifier.getPublicId();
        String sysId = resourceIdentifier.getLiteralSystemId();
        String baseURI = resourceIdentifier.getBaseSystemId();
        String name = null;
        if (resourceIdentifier instanceof XMLDTDDescription) {
            name = "[dtd]";
        }
        else if (resourceIdentifier instanceof XMLEntityDescription) {
            name = ((XMLEntityDescription) resourceIdentifier).getEntityName();
        }

        // When both pubId and sysId are null, the user's entity resolver
        // can do nothing about it. We'd better not bother calling it.
        // This happens when the resourceIdentifier is a GrammarDescription,
        // which describes a schema grammar of some namespace, but without
        // any schema location hint. -Sg
        if (pubId == null && sysId == null) {
            return null;
        }

        // Resolve using EntityResolver2
        try {
            InputSource inputSource =
                fEntityResolver.resolveEntity(name, pubId, baseURI, sysId);
            return (inputSource != null) ? createXMLInputSource(inputSource, baseURI) : null;
        }
        // error resolving entity
        catch (SAXException e) {
            Exception ex = e.getException();
            if (ex == null) {
                ex = e;
            }
            throw new XNIException(ex);
        }
    }

    // unable to resolve entity
    return null;

}
 
Example #6
Source File: EntityResolver2Wrapper.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Resolves an external parsed entity. If the entity cannot be
 * resolved, this method should return null.
 *
 * @param resourceIdentifier contains the physical co-ordinates of the resource to be resolved
 *
 * @throws XNIException Thrown on general error.
 * @throws IOException  Thrown if resolved entity stream cannot be
 *                      opened or some other i/o error occurs.
 */
public XMLInputSource resolveEntity(XMLResourceIdentifier resourceIdentifier)
        throws XNIException, IOException {

    if (fEntityResolver != null) {

        String pubId = resourceIdentifier.getPublicId();
        String sysId = resourceIdentifier.getLiteralSystemId();
        String baseURI = resourceIdentifier.getBaseSystemId();
        String name = null;
        if (resourceIdentifier instanceof XMLDTDDescription) {
            name = "[dtd]";
        }
        else if (resourceIdentifier instanceof XMLEntityDescription) {
            name = ((XMLEntityDescription) resourceIdentifier).getEntityName();
        }

        // When both pubId and sysId are null, the user's entity resolver
        // can do nothing about it. We'd better not bother calling it.
        // This happens when the resourceIdentifier is a GrammarDescription,
        // which describes a schema grammar of some namespace, but without
        // any schema location hint. -Sg
        if (pubId == null && sysId == null) {
            return null;
        }

        // Resolve using EntityResolver2
        try {
            InputSource inputSource =
                fEntityResolver.resolveEntity(name, pubId, baseURI, sysId);
            return (inputSource != null) ? createXMLInputSource(inputSource, baseURI) : null;
        }
        // error resolving entity
        catch (SAXException e) {
            Exception ex = e.getException();
            if (ex == null) {
                ex = e;
            }
            throw new XNIException(ex);
        }
    }

    // unable to resolve entity
    return null;

}
 
Example #7
Source File: EntityResolver2Wrapper.java    From Bytecoder with Apache License 2.0 4 votes vote down vote up
/**
 * Resolves an external parsed entity. If the entity cannot be
 * resolved, this method should return null.
 *
 * @param resourceIdentifier contains the physical co-ordinates of the resource to be resolved
 *
 * @throws XNIException Thrown on general error.
 * @throws IOException  Thrown if resolved entity stream cannot be
 *                      opened or some other i/o error occurs.
 */
public XMLInputSource resolveEntity(XMLResourceIdentifier resourceIdentifier)
        throws XNIException, IOException {

    if (fEntityResolver != null) {

        String pubId = resourceIdentifier.getPublicId();
        String sysId = resourceIdentifier.getLiteralSystemId();
        String baseURI = resourceIdentifier.getBaseSystemId();
        String name = null;
        if (resourceIdentifier instanceof XMLDTDDescription) {
            name = "[dtd]";
        }
        else if (resourceIdentifier instanceof XMLEntityDescription) {
            name = ((XMLEntityDescription) resourceIdentifier).getEntityName();
        }

        // When both pubId and sysId are null, the user's entity resolver
        // can do nothing about it. We'd better not bother calling it.
        // This happens when the resourceIdentifier is a GrammarDescription,
        // which describes a schema grammar of some namespace, but without
        // any schema location hint. -Sg
        if (pubId == null && sysId == null) {
            return null;
        }

        // Resolve using EntityResolver2
        try {
            InputSource inputSource =
                fEntityResolver.resolveEntity(name, pubId, baseURI, sysId);
            return (inputSource != null) ? createXMLInputSource(inputSource, baseURI) : null;
        }
        // error resolving entity
        catch (SAXException e) {
            Exception ex = e.getException();
            if (ex == null) {
                ex = e;
            }
            throw new XNIException(ex);
        }
    }

    // unable to resolve entity
    return null;

}
 
Example #8
Source File: EntityResolver2Wrapper.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Resolves an external parsed entity. If the entity cannot be
 * resolved, this method should return null.
 *
 * @param resourceIdentifier contains the physical co-ordinates of the resource to be resolved
 *
 * @throws XNIException Thrown on general error.
 * @throws IOException  Thrown if resolved entity stream cannot be
 *                      opened or some other i/o error occurs.
 */
public XMLInputSource resolveEntity(XMLResourceIdentifier resourceIdentifier)
        throws XNIException, IOException {

    if (fEntityResolver != null) {

        String pubId = resourceIdentifier.getPublicId();
        String sysId = resourceIdentifier.getLiteralSystemId();
        String baseURI = resourceIdentifier.getBaseSystemId();
        String name = null;
        if (resourceIdentifier instanceof XMLDTDDescription) {
            name = "[dtd]";
        }
        else if (resourceIdentifier instanceof XMLEntityDescription) {
            name = ((XMLEntityDescription) resourceIdentifier).getEntityName();
        }

        // When both pubId and sysId are null, the user's entity resolver
        // can do nothing about it. We'd better not bother calling it.
        // This happens when the resourceIdentifier is a GrammarDescription,
        // which describes a schema grammar of some namespace, but without
        // any schema location hint. -Sg
        if (pubId == null && sysId == null) {
            return null;
        }

        // Resolve using EntityResolver2
        try {
            InputSource inputSource =
                fEntityResolver.resolveEntity(name, pubId, baseURI, sysId);
            return (inputSource != null) ? createXMLInputSource(inputSource, baseURI) : null;
        }
        // error resolving entity
        catch (SAXException e) {
            Exception ex = e.getException();
            if (ex == null) {
                ex = e;
            }
            throw new XNIException(ex);
        }
    }

    // unable to resolve entity
    return null;

}
 
Example #9
Source File: EntityResolver2Wrapper.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Resolves an external parsed entity. If the entity cannot be
 * resolved, this method should return null.
 *
 * @param resourceIdentifier contains the physical co-ordinates of the resource to be resolved
 *
 * @throws XNIException Thrown on general error.
 * @throws IOException  Thrown if resolved entity stream cannot be
 *                      opened or some other i/o error occurs.
 */
public XMLInputSource resolveEntity(XMLResourceIdentifier resourceIdentifier)
        throws XNIException, IOException {

    if (fEntityResolver != null) {

        String pubId = resourceIdentifier.getPublicId();
        String sysId = resourceIdentifier.getLiteralSystemId();
        String baseURI = resourceIdentifier.getBaseSystemId();
        String name = null;
        if (resourceIdentifier instanceof XMLDTDDescription) {
            name = "[dtd]";
        }
        else if (resourceIdentifier instanceof XMLEntityDescription) {
            name = ((XMLEntityDescription) resourceIdentifier).getEntityName();
        }

        // When both pubId and sysId are null, the user's entity resolver
        // can do nothing about it. We'd better not bother calling it.
        // This happens when the resourceIdentifier is a GrammarDescription,
        // which describes a schema grammar of some namespace, but without
        // any schema location hint. -Sg
        if (pubId == null && sysId == null) {
            return null;
        }

        // Resolve using EntityResolver2
        try {
            InputSource inputSource =
                fEntityResolver.resolveEntity(name, pubId, baseURI, sysId);
            return (inputSource != null) ? createXMLInputSource(inputSource, baseURI) : null;
        }
        // error resolving entity
        catch (SAXException e) {
            Exception ex = e.getException();
            if (ex == null) {
                ex = e;
            }
            throw new XNIException(ex);
        }
    }

    // unable to resolve entity
    return null;

}
 
Example #10
Source File: EntityResolver2Wrapper.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Resolves an external parsed entity. If the entity cannot be
 * resolved, this method should return null.
 *
 * @param resourceIdentifier contains the physical co-ordinates of the resource to be resolved
 *
 * @throws XNIException Thrown on general error.
 * @throws IOException  Thrown if resolved entity stream cannot be
 *                      opened or some other i/o error occurs.
 */
public XMLInputSource resolveEntity(XMLResourceIdentifier resourceIdentifier)
        throws XNIException, IOException {

    if (fEntityResolver != null) {

        String pubId = resourceIdentifier.getPublicId();
        String sysId = resourceIdentifier.getLiteralSystemId();
        String baseURI = resourceIdentifier.getBaseSystemId();
        String name = null;
        if (resourceIdentifier instanceof XMLDTDDescription) {
            name = "[dtd]";
        }
        else if (resourceIdentifier instanceof XMLEntityDescription) {
            name = ((XMLEntityDescription) resourceIdentifier).getEntityName();
        }

        // When both pubId and sysId are null, the user's entity resolver
        // can do nothing about it. We'd better not bother calling it.
        // This happens when the resourceIdentifier is a GrammarDescription,
        // which describes a schema grammar of some namespace, but without
        // any schema location hint. -Sg
        if (pubId == null && sysId == null) {
            return null;
        }

        // Resolve using EntityResolver2
        try {
            InputSource inputSource =
                fEntityResolver.resolveEntity(name, pubId, baseURI, sysId);
            return (inputSource != null) ? createXMLInputSource(inputSource, baseURI) : null;
        }
        // error resolving entity
        catch (SAXException e) {
            Exception ex = e.getException();
            if (ex == null) {
                ex = e;
            }
            throw new XNIException(ex);
        }
    }

    // unable to resolve entity
    return null;

}
 
Example #11
Source File: EntityResolver2Wrapper.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Resolves an external parsed entity. If the entity cannot be
 * resolved, this method should return null.
 *
 * @param resourceIdentifier contains the physical co-ordinates of the resource to be resolved
 *
 * @throws XNIException Thrown on general error.
 * @throws IOException  Thrown if resolved entity stream cannot be
 *                      opened or some other i/o error occurs.
 */
public XMLInputSource resolveEntity(XMLResourceIdentifier resourceIdentifier)
        throws XNIException, IOException {

    if (fEntityResolver != null) {

        String pubId = resourceIdentifier.getPublicId();
        String sysId = resourceIdentifier.getLiteralSystemId();
        String baseURI = resourceIdentifier.getBaseSystemId();
        String name = null;
        if (resourceIdentifier instanceof XMLDTDDescription) {
            name = "[dtd]";
        }
        else if (resourceIdentifier instanceof XMLEntityDescription) {
            name = ((XMLEntityDescription) resourceIdentifier).getEntityName();
        }

        // When both pubId and sysId are null, the user's entity resolver
        // can do nothing about it. We'd better not bother calling it.
        // This happens when the resourceIdentifier is a GrammarDescription,
        // which describes a schema grammar of some namespace, but without
        // any schema location hint. -Sg
        if (pubId == null && sysId == null) {
            return null;
        }

        // Resolve using EntityResolver2
        try {
            InputSource inputSource =
                fEntityResolver.resolveEntity(name, pubId, baseURI, sysId);
            return (inputSource != null) ? createXMLInputSource(inputSource, baseURI) : null;
        }
        // error resolving entity
        catch (SAXException e) {
            Exception ex = e.getException();
            if (ex == null) {
                ex = e;
            }
            throw new XNIException(ex);
        }
    }

    // unable to resolve entity
    return null;

}