作者热门文章
- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.xhtmlrenderer.resource.XMLResource.setElapsedLoadTime()
方法的一些代码示例,展示了XMLResource.setElapsedLoadTime()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XMLResource.setElapsedLoadTime()
方法的具体详情如下:
包路径:org.xhtmlrenderer.resource.XMLResource
类名称:XMLResource
方法名:setElapsedLoadTime
暂无
代码示例来源:origin: com.google.code.maven-play-plugin.org.xhtmlrenderer/core-renderer
public XMLResource createXMLResource(Source source) {
DOMResult output = null;
TransformerFactory xformFactory = null;
Transformer idTransform = null;
long st = 0L;
st = System.currentTimeMillis();
try {
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setNamespaceAware(true);
dbf.setValidating(false);//validation is the root of all evil in xml - tobe
output = new DOMResult(dbf.newDocumentBuilder().newDocument());
xformFactory = TransformerFactory.newInstance();
idTransform = xformFactory.newTransformer();
} catch (Exception ex) {
throw new XRRuntimeException("Failed on configuring SAX to DOM transformer.", ex);
}
try {
idTransform.transform(source, output);
} catch (Exception ex) {
throw new XRRuntimeException("Can't load the XML resource (using TRaX transformer). " + ex.getMessage(), ex);
}
long end = System.currentTimeMillis();
//HACK: should rather use a default constructor
XMLResource target = new XMLResource((InputSource) null);
target.setElapsedLoadTime(end - st);
XRLog.load("Loaded document in ~" + target.getElapsedLoadTime() + "ms");
target.setDocument((Document) output.getNode());
return target;
}
}
代码示例来源:origin: org.xhtmlrenderer/core-renderer
public XMLResource createXMLResource(Source source) {
DOMResult output = null;
TransformerFactory xformFactory = null;
Transformer idTransform = null;
long st = 0L;
st = System.currentTimeMillis();
try {
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setNamespaceAware(true);
dbf.setValidating(false);//validation is the root of all evil in xml - tobe
output = new DOMResult(dbf.newDocumentBuilder().newDocument());
xformFactory = TransformerFactory.newInstance();
idTransform = xformFactory.newTransformer();
} catch (Exception ex) {
throw new XRRuntimeException("Failed on configuring SAX to DOM transformer.", ex);
}
try {
idTransform.transform(source, output);
} catch (Exception ex) {
throw new XRRuntimeException("Can't load the XML resource (using TRaX transformer). " + ex.getMessage(), ex);
}
long end = System.currentTimeMillis();
//HACK: should rather use a default constructor
XMLResource target = new XMLResource((InputSource) null);
target.setElapsedLoadTime(end - st);
XRLog.load("Loaded document in ~" + target.getElapsedLoadTime() + "ms");
target.setDocument((Document) output.getNode());
return target;
}
}
代码示例来源:origin: com.google.code.maven-play-plugin.org.xhtmlrenderer/core-renderer
target.setElapsedLoadTime(end - st);
代码示例来源:origin: org.xhtmlrenderer/core-renderer
target.setElapsedLoadTime(end - st);
本文整理了Java中org.xhtmlrenderer.resource.XMLResource.setElapsedLoadTime()方法的一些代码示例,展示了XMLResource.setEla
我是一名优秀的程序员,十分优秀!