当前位置: 首页>>代码示例>>Java>>正文


Java DOMInputImpl类代码示例

本文整理汇总了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;
		}
	}
 
开发者ID:betfair,项目名称:cougar,代码行数:18,代码来源:InterceptingResolver.java

示例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;
}
 
开发者ID:santhosh-tekuri,项目名称:jlibs,代码行数:8,代码来源:DOMLSInputList.java

示例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;
}
 
开发者ID:santhosh-tekuri,项目名称:jlibs,代码行数:8,代码来源:DOMLSInputList.java

示例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;
}
 
开发者ID:santhosh-tekuri,项目名称:jlibs,代码行数:9,代码来源:DOMLSInputList.java

示例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 );
}
 
开发者ID:werval,项目名称:werval,代码行数:10,代码来源:EmptyResolver.java

示例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;
}
 
开发者ID:bl-dpt,项目名称:geolint,代码行数:10,代码来源:GMLXercesWrapper.java

示例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;
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:30,代码来源:XercesSchemaTestCase.java

示例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;
}
 
开发者ID:santhosh-tekuri,项目名称:jlibs,代码行数:7,代码来源:DOMLSInputList.java

示例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);
            }
        }
    });
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:48,代码来源:JAXPValidatorComponent.java

示例10: createSchema

import org.apache.xerces.dom.DOMInputImpl; //导入依赖的package包/类
public Schema createSchema(Reader reader) {
    DOMInputImpl input = new DOMInputImpl();
    input.setCharacterStream(reader);
    return createSchema(input);
}
 
开发者ID:elodina,项目名称:xml-avro,代码行数:6,代码来源:SchemaBuilder.java

示例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));
}
 
开发者ID:santhosh-tekuri,项目名称:jlibs,代码行数:14,代码来源:XSParser.java


注:本文中的org.apache.xerces.dom.DOMInputImpl类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。