org.w3c.dom.ls.LSInput#getSystemId ( )源码实例Demo

下面列出了org.w3c.dom.ls.LSInput#getSystemId ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: TencentKona-8   文件: ValidatorHandlerImpl.java
/**
 * Resolves the given resource and adapts the <code>LSInput</code>
 * returned into an <code>InputSource</code>.
 */
public InputSource resolveEntity(String name, String publicId,
        String baseURI, String systemId) throws SAXException, IOException {
    if (fEntityResolver != null) {
        LSInput lsInput = fEntityResolver.resolveResource(XML_TYPE, null, publicId, systemId, baseURI);
        if (lsInput != null) {
            final String pubId = lsInput.getPublicId();
            final String sysId = lsInput.getSystemId();
            final String baseSystemId = lsInput.getBaseURI();
            final Reader charStream = lsInput.getCharacterStream();
            final InputStream byteStream = lsInput.getByteStream();
            final String data = lsInput.getStringData();
            final String encoding = lsInput.getEncoding();

            /**
             * An LSParser looks at inputs specified in LSInput in
             * the following order: characterStream, byteStream,
             * stringData, systemId, publicId. For consistency
             * with the DOM Level 3 Load and Save Recommendation
             * use the same lookup order here.
             */
            InputSource inputSource = new InputSource();
            inputSource.setPublicId(pubId);
            inputSource.setSystemId((baseSystemId != null) ? resolveSystemId(systemId, baseSystemId) : systemId);

            if (charStream != null) {
                inputSource.setCharacterStream(charStream);
            }
            else if (byteStream != null) {
                inputSource.setByteStream(byteStream);
            }
            else if (data != null && data.length() != 0) {
                inputSource.setCharacterStream(new StringReader(data));
            }
            inputSource.setEncoding(encoding);
            return inputSource;
        }
    }
    return null;
}
 
源代码2 项目: jdk8u60   文件: ValidatorHandlerImpl.java
/**
 * Resolves the given resource and adapts the <code>LSInput</code>
 * returned into an <code>InputSource</code>.
 */
public InputSource resolveEntity(String name, String publicId,
        String baseURI, String systemId) throws SAXException, IOException {
    if (fEntityResolver != null) {
        LSInput lsInput = fEntityResolver.resolveResource(XML_TYPE, null, publicId, systemId, baseURI);
        if (lsInput != null) {
            final String pubId = lsInput.getPublicId();
            final String sysId = lsInput.getSystemId();
            final String baseSystemId = lsInput.getBaseURI();
            final Reader charStream = lsInput.getCharacterStream();
            final InputStream byteStream = lsInput.getByteStream();
            final String data = lsInput.getStringData();
            final String encoding = lsInput.getEncoding();

            /**
             * An LSParser looks at inputs specified in LSInput in
             * the following order: characterStream, byteStream,
             * stringData, systemId, publicId. For consistency
             * with the DOM Level 3 Load and Save Recommendation
             * use the same lookup order here.
             */
            InputSource inputSource = new InputSource();
            inputSource.setPublicId(pubId);
            inputSource.setSystemId((baseSystemId != null) ? resolveSystemId(systemId, baseSystemId) : systemId);

            if (charStream != null) {
                inputSource.setCharacterStream(charStream);
            }
            else if (byteStream != null) {
                inputSource.setByteStream(byteStream);
            }
            else if (data != null && data.length() != 0) {
                inputSource.setCharacterStream(new StringReader(data));
            }
            inputSource.setEncoding(encoding);
            return inputSource;
        }
    }
    return null;
}
 
源代码3 项目: JDKSourceCode1.8   文件: ValidatorHandlerImpl.java
/**
 * Resolves the given resource and adapts the <code>LSInput</code>
 * returned into an <code>InputSource</code>.
 */
public InputSource resolveEntity(String name, String publicId,
        String baseURI, String systemId) throws SAXException, IOException {
    if (fEntityResolver != null) {
        LSInput lsInput = fEntityResolver.resolveResource(XML_TYPE, null, publicId, systemId, baseURI);
        if (lsInput != null) {
            final String pubId = lsInput.getPublicId();
            final String sysId = lsInput.getSystemId();
            final String baseSystemId = lsInput.getBaseURI();
            final Reader charStream = lsInput.getCharacterStream();
            final InputStream byteStream = lsInput.getByteStream();
            final String data = lsInput.getStringData();
            final String encoding = lsInput.getEncoding();

            /**
             * An LSParser looks at inputs specified in LSInput in
             * the following order: characterStream, byteStream,
             * stringData, systemId, publicId. For consistency
             * with the DOM Level 3 Load and Save Recommendation
             * use the same lookup order here.
             */
            InputSource inputSource = new InputSource();
            inputSource.setPublicId(pubId);
            inputSource.setSystemId((baseSystemId != null) ? resolveSystemId(systemId, baseSystemId) : systemId);

            if (charStream != null) {
                inputSource.setCharacterStream(charStream);
            }
            else if (byteStream != null) {
                inputSource.setByteStream(byteStream);
            }
            else if (data != null && data.length() != 0) {
                inputSource.setCharacterStream(new StringReader(data));
            }
            inputSource.setEncoding(encoding);
            return inputSource;
        }
    }
    return null;
}
 
源代码4 项目: openjdk-jdk8u   文件: ValidatorHandlerImpl.java
/**
 * Resolves the given resource and adapts the <code>LSInput</code>
 * returned into an <code>InputSource</code>.
 */
public InputSource resolveEntity(String name, String publicId,
        String baseURI, String systemId) throws SAXException, IOException {
    if (fEntityResolver != null) {
        LSInput lsInput = fEntityResolver.resolveResource(XML_TYPE, null, publicId, systemId, baseURI);
        if (lsInput != null) {
            final String pubId = lsInput.getPublicId();
            final String sysId = lsInput.getSystemId();
            final String baseSystemId = lsInput.getBaseURI();
            final Reader charStream = lsInput.getCharacterStream();
            final InputStream byteStream = lsInput.getByteStream();
            final String data = lsInput.getStringData();
            final String encoding = lsInput.getEncoding();

            /**
             * An LSParser looks at inputs specified in LSInput in
             * the following order: characterStream, byteStream,
             * stringData, systemId, publicId. For consistency
             * with the DOM Level 3 Load and Save Recommendation
             * use the same lookup order here.
             */
            InputSource inputSource = new InputSource();
            inputSource.setPublicId(pubId);
            inputSource.setSystemId((baseSystemId != null) ? resolveSystemId(systemId, baseSystemId) : systemId);

            if (charStream != null) {
                inputSource.setCharacterStream(charStream);
            }
            else if (byteStream != null) {
                inputSource.setByteStream(byteStream);
            }
            else if (data != null && data.length() != 0) {
                inputSource.setCharacterStream(new StringReader(data));
            }
            inputSource.setEncoding(encoding);
            return inputSource;
        }
    }
    return null;
}
 
/**
 * Resolves the given resource and adapts the <code>LSInput</code>
 * returned into an <code>InputSource</code>.
 */
public InputSource resolveEntity(String name, String publicId,
        String baseURI, String systemId) throws SAXException, IOException {
    if (fEntityResolver != null) {
        LSInput lsInput = fEntityResolver.resolveResource(XML_TYPE, null, publicId, systemId, baseURI);
        if (lsInput != null) {
            final String pubId = lsInput.getPublicId();
            final String sysId = lsInput.getSystemId();
            final String baseSystemId = lsInput.getBaseURI();
            final Reader charStream = lsInput.getCharacterStream();
            final InputStream byteStream = lsInput.getByteStream();
            final String data = lsInput.getStringData();
            final String encoding = lsInput.getEncoding();

            /**
             * An LSParser looks at inputs specified in LSInput in
             * the following order: characterStream, byteStream,
             * stringData, systemId, publicId. For consistency
             * with the DOM Level 3 Load and Save Recommendation
             * use the same lookup order here.
             */
            InputSource inputSource = new InputSource();
            inputSource.setPublicId(pubId);
            inputSource.setSystemId((baseSystemId != null) ? resolveSystemId(systemId, baseSystemId) : systemId);

            if (charStream != null) {
                inputSource.setCharacterStream(charStream);
            }
            else if (byteStream != null) {
                inputSource.setByteStream(byteStream);
            }
            else if (data != null && data.length() != 0) {
                inputSource.setCharacterStream(new StringReader(data));
            }
            inputSource.setEncoding(encoding);
            return inputSource;
        }
    }
    return null;
}
 
源代码6 项目: openjdk-8   文件: ValidatorHandlerImpl.java
/**
 * Resolves the given resource and adapts the <code>LSInput</code>
 * returned into an <code>InputSource</code>.
 */
public InputSource resolveEntity(String name, String publicId,
        String baseURI, String systemId) throws SAXException, IOException {
    if (fEntityResolver != null) {
        LSInput lsInput = fEntityResolver.resolveResource(XML_TYPE, null, publicId, systemId, baseURI);
        if (lsInput != null) {
            final String pubId = lsInput.getPublicId();
            final String sysId = lsInput.getSystemId();
            final String baseSystemId = lsInput.getBaseURI();
            final Reader charStream = lsInput.getCharacterStream();
            final InputStream byteStream = lsInput.getByteStream();
            final String data = lsInput.getStringData();
            final String encoding = lsInput.getEncoding();

            /**
             * An LSParser looks at inputs specified in LSInput in
             * the following order: characterStream, byteStream,
             * stringData, systemId, publicId. For consistency
             * with the DOM Level 3 Load and Save Recommendation
             * use the same lookup order here.
             */
            InputSource inputSource = new InputSource();
            inputSource.setPublicId(pubId);
            inputSource.setSystemId((baseSystemId != null) ? resolveSystemId(systemId, baseSystemId) : systemId);

            if (charStream != null) {
                inputSource.setCharacterStream(charStream);
            }
            else if (byteStream != null) {
                inputSource.setByteStream(byteStream);
            }
            else if (data != null && data.length() != 0) {
                inputSource.setCharacterStream(new StringReader(data));
            }
            inputSource.setEncoding(encoding);
            return inputSource;
        }
    }
    return null;
}
 
源代码7 项目: Bytecoder   文件: ValidatorHandlerImpl.java
/**
 * Resolves the given resource and adapts the <code>LSInput</code>
 * returned into an <code>InputSource</code>.
 */
public InputSource resolveEntity(String name, String publicId,
        String baseURI, String systemId) throws SAXException, IOException {
    if (fEntityResolver != null) {
        LSInput lsInput = fEntityResolver.resolveResource(XML_TYPE, null, publicId, systemId, baseURI);
        if (lsInput != null) {
            final String pubId = lsInput.getPublicId();
            final String sysId = lsInput.getSystemId();
            final String baseSystemId = lsInput.getBaseURI();
            final Reader charStream = lsInput.getCharacterStream();
            final InputStream byteStream = lsInput.getByteStream();
            final String data = lsInput.getStringData();
            final String encoding = lsInput.getEncoding();

            /**
             * An LSParser looks at inputs specified in LSInput in
             * the following order: characterStream, byteStream,
             * stringData, systemId, publicId. For consistency
             * with the DOM Level 3 Load and Save Recommendation
             * use the same lookup order here.
             */
            InputSource inputSource = new InputSource();
            inputSource.setPublicId(pubId);
            inputSource.setSystemId((baseSystemId != null) ? resolveSystemId(sysId, baseSystemId) : sysId);

            if (charStream != null) {
                inputSource.setCharacterStream(charStream);
            }
            else if (byteStream != null) {
                inputSource.setByteStream(byteStream);
            }
            else if (data != null && data.length() != 0) {
                inputSource.setCharacterStream(new StringReader(data));
            }
            inputSource.setEncoding(encoding);
            return inputSource;
        }
    }
    return null;
}
 
源代码8 项目: openjdk-jdk9   文件: ValidatorHandlerImpl.java
/**
 * Resolves the given resource and adapts the <code>LSInput</code>
 * returned into an <code>InputSource</code>.
 */
public InputSource resolveEntity(String name, String publicId,
        String baseURI, String systemId) throws SAXException, IOException {
    if (fEntityResolver != null) {
        LSInput lsInput = fEntityResolver.resolveResource(XML_TYPE, null, publicId, systemId, baseURI);
        if (lsInput != null) {
            final String pubId = lsInput.getPublicId();
            final String sysId = lsInput.getSystemId();
            final String baseSystemId = lsInput.getBaseURI();
            final Reader charStream = lsInput.getCharacterStream();
            final InputStream byteStream = lsInput.getByteStream();
            final String data = lsInput.getStringData();
            final String encoding = lsInput.getEncoding();

            /**
             * An LSParser looks at inputs specified in LSInput in
             * the following order: characterStream, byteStream,
             * stringData, systemId, publicId. For consistency
             * with the DOM Level 3 Load and Save Recommendation
             * use the same lookup order here.
             */
            InputSource inputSource = new InputSource();
            inputSource.setPublicId(pubId);
            inputSource.setSystemId((baseSystemId != null) ? resolveSystemId(sysId, baseSystemId) : sysId);

            if (charStream != null) {
                inputSource.setCharacterStream(charStream);
            }
            else if (byteStream != null) {
                inputSource.setByteStream(byteStream);
            }
            else if (data != null && data.length() != 0) {
                inputSource.setCharacterStream(new StringReader(data));
            }
            inputSource.setEncoding(encoding);
            return inputSource;
        }
    }
    return null;
}
 
源代码9 项目: hottub   文件: ValidatorHandlerImpl.java
/**
 * Resolves the given resource and adapts the <code>LSInput</code>
 * returned into an <code>InputSource</code>.
 */
public InputSource resolveEntity(String name, String publicId,
        String baseURI, String systemId) throws SAXException, IOException {
    if (fEntityResolver != null) {
        LSInput lsInput = fEntityResolver.resolveResource(XML_TYPE, null, publicId, systemId, baseURI);
        if (lsInput != null) {
            final String pubId = lsInput.getPublicId();
            final String sysId = lsInput.getSystemId();
            final String baseSystemId = lsInput.getBaseURI();
            final Reader charStream = lsInput.getCharacterStream();
            final InputStream byteStream = lsInput.getByteStream();
            final String data = lsInput.getStringData();
            final String encoding = lsInput.getEncoding();

            /**
             * An LSParser looks at inputs specified in LSInput in
             * the following order: characterStream, byteStream,
             * stringData, systemId, publicId. For consistency
             * with the DOM Level 3 Load and Save Recommendation
             * use the same lookup order here.
             */
            InputSource inputSource = new InputSource();
            inputSource.setPublicId(pubId);
            inputSource.setSystemId((baseSystemId != null) ? resolveSystemId(systemId, baseSystemId) : systemId);

            if (charStream != null) {
                inputSource.setCharacterStream(charStream);
            }
            else if (byteStream != null) {
                inputSource.setByteStream(byteStream);
            }
            else if (data != null && data.length() != 0) {
                inputSource.setCharacterStream(new StringReader(data));
            }
            inputSource.setEncoding(encoding);
            return inputSource;
        }
    }
    return null;
}
 
源代码10 项目: openjdk-8-source   文件: ValidatorHandlerImpl.java
/**
 * Resolves the given resource and adapts the <code>LSInput</code>
 * returned into an <code>InputSource</code>.
 */
public InputSource resolveEntity(String name, String publicId,
        String baseURI, String systemId) throws SAXException, IOException {
    if (fEntityResolver != null) {
        LSInput lsInput = fEntityResolver.resolveResource(XML_TYPE, null, publicId, systemId, baseURI);
        if (lsInput != null) {
            final String pubId = lsInput.getPublicId();
            final String sysId = lsInput.getSystemId();
            final String baseSystemId = lsInput.getBaseURI();
            final Reader charStream = lsInput.getCharacterStream();
            final InputStream byteStream = lsInput.getByteStream();
            final String data = lsInput.getStringData();
            final String encoding = lsInput.getEncoding();

            /**
             * An LSParser looks at inputs specified in LSInput in
             * the following order: characterStream, byteStream,
             * stringData, systemId, publicId. For consistency
             * with the DOM Level 3 Load and Save Recommendation
             * use the same lookup order here.
             */
            InputSource inputSource = new InputSource();
            inputSource.setPublicId(pubId);
            inputSource.setSystemId((baseSystemId != null) ? resolveSystemId(systemId, baseSystemId) : systemId);

            if (charStream != null) {
                inputSource.setCharacterStream(charStream);
            }
            else if (byteStream != null) {
                inputSource.setByteStream(byteStream);
            }
            else if (data != null && data.length() != 0) {
                inputSource.setCharacterStream(new StringReader(data));
            }
            inputSource.setEncoding(encoding);
            return inputSource;
        }
    }
    return null;
}
 
源代码11 项目: openjdk-8   文件: DOMEntityResolverWrapper.java
/**
 * Resolves an external parsed entity. If the entity cannot be
 * resolved, this method should return null.
 *
 * @param resourceIdentifier        description of the resource to be revsoved
 * @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 {
    // resolve entity using DOM entity resolver
    if (fEntityResolver != null) {
        // For entity resolution the type of the resource would be  XML TYPE
        // DOM L3 LS spec mention only the XML 1.0 recommendation right now
        LSInput inputSource =
            resourceIdentifier == null
                ? fEntityResolver.resolveResource(
                    null,
                    null,
                    null,
                    null,
                    null)
                : fEntityResolver.resolveResource(
                    getType(resourceIdentifier),
                    resourceIdentifier.getNamespace(),
                    resourceIdentifier.getPublicId(),
                    resourceIdentifier.getLiteralSystemId(),
                    resourceIdentifier.getBaseSystemId());
        if (inputSource != null) {
            String publicId = inputSource.getPublicId();
            String systemId = inputSource.getSystemId();
            String baseSystemId = inputSource.getBaseURI();
            InputStream byteStream = inputSource.getByteStream();
            Reader charStream = inputSource.getCharacterStream();
            String encoding = inputSource.getEncoding();
            String data = inputSource.getStringData();

            /**
             * An LSParser looks at inputs specified in LSInput in
             * the following order: characterStream, byteStream,
             * stringData, systemId, publicId.
             */
            XMLInputSource xmlInputSource =
                new XMLInputSource(publicId, systemId, baseSystemId);

            if (charStream != null) {
                xmlInputSource.setCharacterStream(charStream);
            }
            else if (byteStream != null) {
                xmlInputSource.setByteStream((InputStream) byteStream);
            }
            else if (data != null && data.length() != 0) {
                xmlInputSource.setCharacterStream(new StringReader(data));
            }
            xmlInputSource.setEncoding(encoding);
            return xmlInputSource;
        }
    }

    // unable to resolve entity
    return null;

}
 
/**
 * Resolves an external parsed entity. If the entity cannot be
 * resolved, this method should return null.
 *
 * @param resourceIdentifier        description of the resource to be revsoved
 * @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 {
    // resolve entity using DOM entity resolver
    if (fEntityResolver != null) {
        // For entity resolution the type of the resource would be  XML TYPE
        // DOM L3 LS spec mention only the XML 1.0 recommendation right now
        LSInput inputSource =
            resourceIdentifier == null
                ? fEntityResolver.resolveResource(
                    null,
                    null,
                    null,
                    null,
                    null)
                : fEntityResolver.resolveResource(
                    getType(resourceIdentifier),
                    resourceIdentifier.getNamespace(),
                    resourceIdentifier.getPublicId(),
                    resourceIdentifier.getLiteralSystemId(),
                    resourceIdentifier.getBaseSystemId());
        if (inputSource != null) {
            String publicId = inputSource.getPublicId();
            String systemId = inputSource.getSystemId();
            String baseSystemId = inputSource.getBaseURI();
            InputStream byteStream = inputSource.getByteStream();
            Reader charStream = inputSource.getCharacterStream();
            String encoding = inputSource.getEncoding();
            String data = inputSource.getStringData();

            /**
             * An LSParser looks at inputs specified in LSInput in
             * the following order: characterStream, byteStream,
             * stringData, systemId, publicId.
             */
            XMLInputSource xmlInputSource =
                new XMLInputSource(publicId, systemId, baseSystemId);

            if (charStream != null) {
                xmlInputSource.setCharacterStream(charStream);
            }
            else if (byteStream != null) {
                xmlInputSource.setByteStream((InputStream) byteStream);
            }
            else if (data != null && data.length() != 0) {
                xmlInputSource.setCharacterStream(new StringReader(data));
            }
            xmlInputSource.setEncoding(encoding);
            return xmlInputSource;
        }
    }

    // unable to resolve entity
    return null;

}
 
源代码13 项目: TencentKona-8   文件: DOMEntityResolverWrapper.java
/**
 * Resolves an external parsed entity. If the entity cannot be
 * resolved, this method should return null.
 *
 * @param resourceIdentifier        description of the resource to be revsoved
 * @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 {
    // resolve entity using DOM entity resolver
    if (fEntityResolver != null) {
        // For entity resolution the type of the resource would be  XML TYPE
        // DOM L3 LS spec mention only the XML 1.0 recommendation right now
        LSInput inputSource =
            resourceIdentifier == null
                ? fEntityResolver.resolveResource(
                    null,
                    null,
                    null,
                    null,
                    null)
                : fEntityResolver.resolveResource(
                    getType(resourceIdentifier),
                    resourceIdentifier.getNamespace(),
                    resourceIdentifier.getPublicId(),
                    resourceIdentifier.getLiteralSystemId(),
                    resourceIdentifier.getBaseSystemId());
        if (inputSource != null) {
            String publicId = inputSource.getPublicId();
            String systemId = inputSource.getSystemId();
            String baseSystemId = inputSource.getBaseURI();
            InputStream byteStream = inputSource.getByteStream();
            Reader charStream = inputSource.getCharacterStream();
            String encoding = inputSource.getEncoding();
            String data = inputSource.getStringData();

            /**
             * An LSParser looks at inputs specified in LSInput in
             * the following order: characterStream, byteStream,
             * stringData, systemId, publicId.
             */
            XMLInputSource xmlInputSource =
                new XMLInputSource(publicId, systemId, baseSystemId);

            if (charStream != null) {
                xmlInputSource.setCharacterStream(charStream);
            }
            else if (byteStream != null) {
                xmlInputSource.setByteStream((InputStream) byteStream);
            }
            else if (data != null && data.length() != 0) {
                xmlInputSource.setCharacterStream(new StringReader(data));
            }
            xmlInputSource.setEncoding(encoding);
            return xmlInputSource;
        }
    }

    // unable to resolve entity
    return null;

}
 
源代码14 项目: jdk8u60   文件: DOMEntityResolverWrapper.java
/**
 * Resolves an external parsed entity. If the entity cannot be
 * resolved, this method should return null.
 *
 * @param resourceIdentifier        description of the resource to be revsoved
 * @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 {
    // resolve entity using DOM entity resolver
    if (fEntityResolver != null) {
        // For entity resolution the type of the resource would be  XML TYPE
        // DOM L3 LS spec mention only the XML 1.0 recommendation right now
        LSInput inputSource =
            resourceIdentifier == null
                ? fEntityResolver.resolveResource(
                    null,
                    null,
                    null,
                    null,
                    null)
                : fEntityResolver.resolveResource(
                    getType(resourceIdentifier),
                    resourceIdentifier.getNamespace(),
                    resourceIdentifier.getPublicId(),
                    resourceIdentifier.getLiteralSystemId(),
                    resourceIdentifier.getBaseSystemId());
        if (inputSource != null) {
            String publicId = inputSource.getPublicId();
            String systemId = inputSource.getSystemId();
            String baseSystemId = inputSource.getBaseURI();
            InputStream byteStream = inputSource.getByteStream();
            Reader charStream = inputSource.getCharacterStream();
            String encoding = inputSource.getEncoding();
            String data = inputSource.getStringData();

            /**
             * An LSParser looks at inputs specified in LSInput in
             * the following order: characterStream, byteStream,
             * stringData, systemId, publicId.
             */
            XMLInputSource xmlInputSource =
                new XMLInputSource(publicId, systemId, baseSystemId);

            if (charStream != null) {
                xmlInputSource.setCharacterStream(charStream);
            }
            else if (byteStream != null) {
                xmlInputSource.setByteStream((InputStream) byteStream);
            }
            else if (data != null && data.length() != 0) {
                xmlInputSource.setCharacterStream(new StringReader(data));
            }
            xmlInputSource.setEncoding(encoding);
            return xmlInputSource;
        }
    }

    // unable to resolve entity
    return null;

}
 
/**
 * Resolves an external parsed entity. If the entity cannot be
 * resolved, this method should return null.
 *
 * @param resourceIdentifier        description of the resource to be revsoved
 * @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 {
    // resolve entity using DOM entity resolver
    if (fEntityResolver != null) {
        // For entity resolution the type of the resource would be  XML TYPE
        // DOM L3 LS spec mention only the XML 1.0 recommendation right now
        LSInput inputSource =
            resourceIdentifier == null
                ? fEntityResolver.resolveResource(
                    null,
                    null,
                    null,
                    null,
                    null)
                : fEntityResolver.resolveResource(
                    getType(resourceIdentifier),
                    resourceIdentifier.getNamespace(),
                    resourceIdentifier.getPublicId(),
                    resourceIdentifier.getLiteralSystemId(),
                    resourceIdentifier.getBaseSystemId());
        if (inputSource != null) {
            String publicId = inputSource.getPublicId();
            String systemId = inputSource.getSystemId();
            String baseSystemId = inputSource.getBaseURI();
            InputStream byteStream = inputSource.getByteStream();
            Reader charStream = inputSource.getCharacterStream();
            String encoding = inputSource.getEncoding();
            String data = inputSource.getStringData();

            /**
             * An LSParser looks at inputs specified in LSInput in
             * the following order: characterStream, byteStream,
             * stringData, systemId, publicId.
             */
            XMLInputSource xmlInputSource =
                new XMLInputSource(publicId, systemId, baseSystemId);

            if (charStream != null) {
                xmlInputSource.setCharacterStream(charStream);
            }
            else if (byteStream != null) {
                xmlInputSource.setByteStream((InputStream) byteStream);
            }
            else if (data != null && data.length() != 0) {
                xmlInputSource.setCharacterStream(new StringReader(data));
            }
            xmlInputSource.setEncoding(encoding);
            return xmlInputSource;
        }
    }

    // unable to resolve entity
    return null;

}
 
源代码16 项目: openjdk-jdk8u   文件: DOMEntityResolverWrapper.java
/**
 * Resolves an external parsed entity. If the entity cannot be
 * resolved, this method should return null.
 *
 * @param resourceIdentifier        description of the resource to be revsoved
 * @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 {
    // resolve entity using DOM entity resolver
    if (fEntityResolver != null) {
        // For entity resolution the type of the resource would be  XML TYPE
        // DOM L3 LS spec mention only the XML 1.0 recommendation right now
        LSInput inputSource =
            resourceIdentifier == null
                ? fEntityResolver.resolveResource(
                    null,
                    null,
                    null,
                    null,
                    null)
                : fEntityResolver.resolveResource(
                    getType(resourceIdentifier),
                    resourceIdentifier.getNamespace(),
                    resourceIdentifier.getPublicId(),
                    resourceIdentifier.getLiteralSystemId(),
                    resourceIdentifier.getBaseSystemId());
        if (inputSource != null) {
            String publicId = inputSource.getPublicId();
            String systemId = inputSource.getSystemId();
            String baseSystemId = inputSource.getBaseURI();
            InputStream byteStream = inputSource.getByteStream();
            Reader charStream = inputSource.getCharacterStream();
            String encoding = inputSource.getEncoding();
            String data = inputSource.getStringData();

            /**
             * An LSParser looks at inputs specified in LSInput in
             * the following order: characterStream, byteStream,
             * stringData, systemId, publicId.
             */
            XMLInputSource xmlInputSource =
                new XMLInputSource(publicId, systemId, baseSystemId);

            if (charStream != null) {
                xmlInputSource.setCharacterStream(charStream);
            }
            else if (byteStream != null) {
                xmlInputSource.setByteStream((InputStream) byteStream);
            }
            else if (data != null && data.length() != 0) {
                xmlInputSource.setCharacterStream(new StringReader(data));
            }
            xmlInputSource.setEncoding(encoding);
            return xmlInputSource;
        }
    }

    // unable to resolve entity
    return null;

}
 
源代码17 项目: Bytecoder   文件: DOMEntityResolverWrapper.java
/**
 * Resolves an external parsed entity. If the entity cannot be
 * resolved, this method should return null.
 *
 * @param resourceIdentifier        description of the resource to be revsoved
 * @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 {
    // resolve entity using DOM entity resolver
    if (fEntityResolver != null) {
        // For entity resolution the type of the resource would be  XML TYPE
        // DOM L3 LS spec mention only the XML 1.0 recommendation right now
        LSInput inputSource =
            resourceIdentifier == null
                ? fEntityResolver.resolveResource(
                    null,
                    null,
                    null,
                    null,
                    null)
                : fEntityResolver.resolveResource(
                    getType(resourceIdentifier),
                    resourceIdentifier.getNamespace(),
                    resourceIdentifier.getPublicId(),
                    resourceIdentifier.getLiteralSystemId(),
                    resourceIdentifier.getBaseSystemId());
        if (inputSource != null) {
            String publicId = inputSource.getPublicId();
            String systemId = inputSource.getSystemId();
            String baseSystemId = inputSource.getBaseURI();
            InputStream byteStream = inputSource.getByteStream();
            Reader charStream = inputSource.getCharacterStream();
            String encoding = inputSource.getEncoding();
            String data = inputSource.getStringData();

            /**
             * An LSParser looks at inputs specified in LSInput in
             * the following order: characterStream, byteStream,
             * stringData, systemId, publicId.
             */
            XMLInputSource xmlInputSource =
                new XMLInputSource(publicId, systemId, baseSystemId, true);

            if (charStream != null) {
                xmlInputSource.setCharacterStream(charStream);
            }
            else if (byteStream != null) {
                xmlInputSource.setByteStream(byteStream);
            }
            else if (data != null && data.length() != 0) {
                xmlInputSource.setCharacterStream(new StringReader(data));
            }
            xmlInputSource.setEncoding(encoding);
            return xmlInputSource;
        }
    }

    // unable to resolve entity
    return null;

}
 
源代码18 项目: openjdk-jdk9   文件: DOMEntityResolverWrapper.java
/**
 * Resolves an external parsed entity. If the entity cannot be
 * resolved, this method should return null.
 *
 * @param resourceIdentifier        description of the resource to be revsoved
 * @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 {
    // resolve entity using DOM entity resolver
    if (fEntityResolver != null) {
        // For entity resolution the type of the resource would be  XML TYPE
        // DOM L3 LS spec mention only the XML 1.0 recommendation right now
        LSInput inputSource =
            resourceIdentifier == null
                ? fEntityResolver.resolveResource(
                    null,
                    null,
                    null,
                    null,
                    null)
                : fEntityResolver.resolveResource(
                    getType(resourceIdentifier),
                    resourceIdentifier.getNamespace(),
                    resourceIdentifier.getPublicId(),
                    resourceIdentifier.getLiteralSystemId(),
                    resourceIdentifier.getBaseSystemId());
        if (inputSource != null) {
            String publicId = inputSource.getPublicId();
            String systemId = inputSource.getSystemId();
            String baseSystemId = inputSource.getBaseURI();
            InputStream byteStream = inputSource.getByteStream();
            Reader charStream = inputSource.getCharacterStream();
            String encoding = inputSource.getEncoding();
            String data = inputSource.getStringData();

            /**
             * An LSParser looks at inputs specified in LSInput in
             * the following order: characterStream, byteStream,
             * stringData, systemId, publicId.
             */
            XMLInputSource xmlInputSource =
                new XMLInputSource(publicId, systemId, baseSystemId, true);

            if (charStream != null) {
                xmlInputSource.setCharacterStream(charStream);
            }
            else if (byteStream != null) {
                xmlInputSource.setByteStream((InputStream) byteStream);
            }
            else if (data != null && data.length() != 0) {
                xmlInputSource.setCharacterStream(new StringReader(data));
            }
            xmlInputSource.setEncoding(encoding);
            return xmlInputSource;
        }
    }

    // unable to resolve entity
    return null;

}
 
源代码19 项目: hottub   文件: DOMEntityResolverWrapper.java
/**
 * Resolves an external parsed entity. If the entity cannot be
 * resolved, this method should return null.
 *
 * @param resourceIdentifier        description of the resource to be revsoved
 * @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 {
    // resolve entity using DOM entity resolver
    if (fEntityResolver != null) {
        // For entity resolution the type of the resource would be  XML TYPE
        // DOM L3 LS spec mention only the XML 1.0 recommendation right now
        LSInput inputSource =
            resourceIdentifier == null
                ? fEntityResolver.resolveResource(
                    null,
                    null,
                    null,
                    null,
                    null)
                : fEntityResolver.resolveResource(
                    getType(resourceIdentifier),
                    resourceIdentifier.getNamespace(),
                    resourceIdentifier.getPublicId(),
                    resourceIdentifier.getLiteralSystemId(),
                    resourceIdentifier.getBaseSystemId());
        if (inputSource != null) {
            String publicId = inputSource.getPublicId();
            String systemId = inputSource.getSystemId();
            String baseSystemId = inputSource.getBaseURI();
            InputStream byteStream = inputSource.getByteStream();
            Reader charStream = inputSource.getCharacterStream();
            String encoding = inputSource.getEncoding();
            String data = inputSource.getStringData();

            /**
             * An LSParser looks at inputs specified in LSInput in
             * the following order: characterStream, byteStream,
             * stringData, systemId, publicId.
             */
            XMLInputSource xmlInputSource =
                new XMLInputSource(publicId, systemId, baseSystemId);

            if (charStream != null) {
                xmlInputSource.setCharacterStream(charStream);
            }
            else if (byteStream != null) {
                xmlInputSource.setByteStream((InputStream) byteStream);
            }
            else if (data != null && data.length() != 0) {
                xmlInputSource.setCharacterStream(new StringReader(data));
            }
            xmlInputSource.setEncoding(encoding);
            return xmlInputSource;
        }
    }

    // unable to resolve entity
    return null;

}
 
/**
 * Resolves an external parsed entity. If the entity cannot be
 * resolved, this method should return null.
 *
 * @param resourceIdentifier        description of the resource to be revsoved
 * @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 {
    // resolve entity using DOM entity resolver
    if (fEntityResolver != null) {
        // For entity resolution the type of the resource would be  XML TYPE
        // DOM L3 LS spec mention only the XML 1.0 recommendation right now
        LSInput inputSource =
            resourceIdentifier == null
                ? fEntityResolver.resolveResource(
                    null,
                    null,
                    null,
                    null,
                    null)
                : fEntityResolver.resolveResource(
                    getType(resourceIdentifier),
                    resourceIdentifier.getNamespace(),
                    resourceIdentifier.getPublicId(),
                    resourceIdentifier.getLiteralSystemId(),
                    resourceIdentifier.getBaseSystemId());
        if (inputSource != null) {
            String publicId = inputSource.getPublicId();
            String systemId = inputSource.getSystemId();
            String baseSystemId = inputSource.getBaseURI();
            InputStream byteStream = inputSource.getByteStream();
            Reader charStream = inputSource.getCharacterStream();
            String encoding = inputSource.getEncoding();
            String data = inputSource.getStringData();

            /**
             * An LSParser looks at inputs specified in LSInput in
             * the following order: characterStream, byteStream,
             * stringData, systemId, publicId.
             */
            XMLInputSource xmlInputSource =
                new XMLInputSource(publicId, systemId, baseSystemId);

            if (charStream != null) {
                xmlInputSource.setCharacterStream(charStream);
            }
            else if (byteStream != null) {
                xmlInputSource.setByteStream((InputStream) byteStream);
            }
            else if (data != null && data.length() != 0) {
                xmlInputSource.setCharacterStream(new StringReader(data));
            }
            xmlInputSource.setEncoding(encoding);
            return xmlInputSource;
        }
    }

    // unable to resolve entity
    return null;

}