本文整理汇总了Java中org.apache.xerces.dom.DOMInputImpl类的典型用法代码示例。如果您正苦于以下问题:Java DOMInputImpl类的具体用法?Java DOMInputImpl怎么用?Java DOMInputImpl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DOMInputImpl类属于org.apache.xerces.dom包,在下文中一共展示了DOMInputImpl类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: resourceToLSInput
import org.apache.xerces.dom.DOMInputImpl; //导入依赖的package包/类
private LSInput resourceToLSInput(String publicId, String systemId) {
InputStream is = resourceAsStream(systemId);
if (is != null) {
DOMInputImpl result = new DOMInputImpl(); // any old impl would do
result.setByteStream(is);
result.setCharacterStream(null);
result.setPublicId(publicId);
result.setSystemId(systemId);
return result;
}
else {
return null;
}
}
示例2: addStringData
import org.apache.xerces.dom.DOMInputImpl; //导入依赖的package包/类
public DOMInputImpl addStringData(String stringData, String systemID){
DOMInputImpl input = new DOMInputImpl();
input.setStringData(stringData);
input.setSystemId(systemID);
add(input);
return input;
}
示例3: addReader
import org.apache.xerces.dom.DOMInputImpl; //导入依赖的package包/类
public DOMInputImpl addReader(Reader reader, String systemID){
DOMInputImpl input = new DOMInputImpl();
input.setCharacterStream(reader);
input.setSystemId(systemID);
add(input);
return input;
}
示例4: addStream
import org.apache.xerces.dom.DOMInputImpl; //导入依赖的package包/类
public DOMInputImpl addStream(InputStream stream, String systemID, String encoding){
DOMInputImpl input = new DOMInputImpl();
input.setByteStream(stream);
input.setSystemId(systemID);
input.setEncoding(encoding);
add(input);
return input;
}
示例5: resolveResource
import org.apache.xerces.dom.DOMInputImpl; //导入依赖的package包/类
@Override
public LSInput resolveResource( String type, String namespaceURI, String publicId, String systemId, String baseURI )
{
LOG.debug(
"Resource resolved to empty (DOM): type={} namespace={} publicId={} systemId={} baseURI={}",
type, namespaceURI, publicId, systemId, baseURI
);
return new DOMInputImpl( publicId, systemId, baseURI, "", null );
}
示例6: resolveResource
import org.apache.xerces.dom.DOMInputImpl; //导入依赖的package包/类
@Override
public LSInput resolveResource(String type, String namespaceURI, String publicId, String systemId, String baseURI) {
InputStream is = ResourceUtil.loadResource(SCHEMA_DIR+new File(systemId).getName());
if(is!=null) {
return new DOMInputImpl(publicId, systemId, baseURI, is, null);
}
System.err.println("Can't resolve: "+type+" "+namespaceURI+" "+publicId+" "+systemId+" "+baseURI);
return null;
}
示例7: loadSchemas
import org.apache.xerces.dom.DOMInputImpl; //导入依赖的package包/类
private static final XSModel loadSchemas(final List<XMLSchema> schemas, XMLSchemaInformationDao dao)
throws IllegalArgumentException, XMLParseException {
if (schemas == null) {
throw new IllegalArgumentException("Schemas must be non null.");
}
LSInputList list = new LSInputList() {
public LSInput item(int index) {
DOMInputImpl input = new DOMInputImpl();
input.setSystemId(schemas.get(index).getRootDocument().getSystemID());
input.setStringData(schemas.get(index).getRootDocument().getSchemaText());
return input;
}
public int getLength() {
return schemas.size();
}
};
GMEXMLSchemaLoader schemaLoader = new GMEXMLSchemaLoader(schemas, dao);
XSModel model = schemaLoader.loadInputList(list);
if (model == null) {
throw schemaLoader.getErrorHandler().createXMLParseException();
}
return model;
}
示例8: addSystemID
import org.apache.xerces.dom.DOMInputImpl; //导入依赖的package包/类
public DOMInputImpl addSystemID(String systemID){
DOMInputImpl input = new DOMInputImpl();
input.setSystemId(systemID);
add(input);
return input;
}
示例9: JAXPValidatorComponent
import org.apache.xerces.dom.DOMInputImpl; //导入依赖的package包/类
/**
* @param validatorHandler may not be null.
*/
public JAXPValidatorComponent( ValidatorHandler validatorHandler ) {
this.validator = validatorHandler;
TypeInfoProvider tip = validatorHandler.getTypeInfoProvider();
if(tip==null) tip = noInfoProvider;
this.typeInfoProvider = tip;
// configure wiring between internal components.
xni2sax.setContentHandler(validator);
validator.setContentHandler(sax2xni);
this.setSide(xni2sax);
// configure validator with proper EntityResolver/ErrorHandler.
validator.setErrorHandler(new ErrorHandlerProxy() {
protected XMLErrorHandler getErrorHandler() {
XMLErrorHandler handler = fErrorReporter.getErrorHandler();
if(handler!=null) return handler;
return new ErrorHandlerWrapper(DraconianErrorHandler.getInstance());
}
});
validator.setResourceResolver(new LSResourceResolver() {
public LSInput resolveResource(String type,String ns, String publicId, String systemId, String baseUri) {
if(fEntityResolver==null) return null;
try {
XMLInputSource is = fEntityResolver.resolveEntity(
new XMLResourceIdentifierImpl(publicId,systemId,baseUri,null));
if(is==null) return null;
LSInput di = new DOMInputImpl();
di.setBaseURI(is.getBaseSystemId());
di.setByteStream(is.getByteStream());
di.setCharacterStream(is.getCharacterStream());
di.setEncoding(is.getEncoding());
di.setPublicId(is.getPublicId());
di.setSystemId(is.getSystemId());
return di;
} catch( IOException e ) {
// erors thrown by the callback is not supposed to be
// reported to users.
throw new XNIException(e);
}
}
});
}
示例10: createSchema
import org.apache.xerces.dom.DOMInputImpl; //导入依赖的package包/类
public Schema createSchema(Reader reader) {
DOMInputImpl input = new DOMInputImpl();
input.setCharacterStream(reader);
return createSchema(input);
}
示例11: parseString
import org.apache.xerces.dom.DOMInputImpl; //导入依赖的package包/类
/**
* Parse an XML Schema document from String specified
*
* @param schema String data to parse. If provided, this will always be treated as a
* sequence of 16-bit units (UTF-16 encoded characters). If an XML
* declaration is present, the value of the encoding attribute
* will be ignored.
* @param baseURI The base URI to be used for resolving relative
* URIs to absolute URIs.
*/
public XSModel parseString(String schema, String baseURI){
return xsLoader.load(new DOMInputImpl(null, null, baseURI, schema, null));
}