- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.fcrepo.utilities.XmlTransformUtility
类的一些代码示例,展示了XmlTransformUtility
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XmlTransformUtility
类的具体详情如下:
包路径:org.fcrepo.utilities.XmlTransformUtility
类名称:XmlTransformUtility
暂无
代码示例来源:origin: fcrepo3/fcrepo
/**
* Get a new DOM Document object from parsing the specified InputStream.
*
* @param in
* the InputStream to parse.
* @return a new DOM Document object.
* @throws ParserConfigurationException
* if a DocumentBuilder cannot be created.
* @throws SAXException
* If any parse errors occur.
* @throws IOException
* If any IO errors occur.
*/
protected static Document getDocument(InputStream in)
throws Exception {
DocumentBuilder builder = XmlTransformUtility.borrowDocumentBuilder();
Document doc = null;
try {
doc = builder.parse(in);
} finally {
XmlTransformUtility.returnDocumentBuilder(builder);
}
return doc;
}
}
代码示例来源:origin: fcrepo3/fcrepo
public static Document getDocumentFromBytes(byte[] data) throws Exception {
Document doc =
XmlTransformUtility.parseNamespaceAware(new ByteArrayInputStream(data));
return doc;
}
代码示例来源:origin: fcrepo3/fcrepo
public static Templates getTemplates(StreamSource source)
throws TransformerException {
TransformerFactory tf = null;
Templates result = null;
try {
tf = borrowTransformerFactory();
result = tf.newTemplates(source);
} catch (Exception e) {
throw new TransformerException(e.getMessage(), e);
} finally {
if (tf != null) returnTransformerFactory(tf);
}
return result;
}
代码示例来源:origin: org.fcrepo/fcrepo-common
public static Transformer getTransformer() throws Exception {
return getTransformer(null);
}
public static Transformer getTransformer(Source src) throws Exception {
代码示例来源:origin: org.fcrepo/fcrepo-common
public static void parseWithoutValidating(InputStream in, DefaultHandler handler)
throws SAXException, IOException {
parseWithoutValidating(new InputSource(in), handler);
}
代码示例来源:origin: org.fcrepo/fcrepo-server
XmlTransformUtility.getTransformer(preprocessorSource);
ptransformer.setParameter("phase", phase);
ptransformer.transform(rulesSource, new StreamResult(out));
return XmlTransformUtility.getTemplates(
new StreamSource(out.toReader()));
代码示例来源:origin: fcrepo3/fcrepo
public static Transformer getTransformer() throws Exception {
return getTransformer(null);
}
public static Transformer getTransformer(Source src) throws Exception {
代码示例来源:origin: fcrepo3/fcrepo
public static void parseWithoutValidating(InputStream in, DefaultHandler handler)
throws SAXException, IOException {
parseWithoutValidating(new InputSource(in), handler);
}
代码示例来源:origin: fcrepo3/fcrepo
XmlTransformUtility.getTransformer(preprocessorSource);
ptransformer.setParameter("phase", phase);
ptransformer.transform(rulesSource, new StreamResult(out));
return XmlTransformUtility.getTemplates(
new StreamSource(out.toReader()));
代码示例来源:origin: org.fcrepo/fcrepo-common
/**
* Get a new DOM Document object from parsing the specified InputStream.
*
* @param in
* the InputStream to parse.
* @return a new DOM Document object.
* @throws ParserConfigurationException
* if a DocumentBuilder cannot be created.
* @throws SAXException
* If any parse errors occur.
* @throws IOException
* If any IO errors occur.
*/
protected static Document getDocument(InputStream in)
throws Exception {
DocumentBuilder builder = XmlTransformUtility.borrowDocumentBuilder();
Document doc = null;
try {
doc = builder.parse(in);
} finally {
XmlTransformUtility.returnDocumentBuilder(builder);
}
return doc;
}
}
代码示例来源:origin: org.fcrepo/fcrepo-common
public static Templates getTemplates(StreamSource source)
throws TransformerException {
TransformerFactory tf = null;
Templates result = null;
try {
tf = borrowTransformerFactory();
result = tf.newTemplates(source);
} catch (Exception e) {
throw new TransformerException(e.getMessage(), e);
} finally {
if (tf != null) returnTransformerFactory(tf);
}
return result;
}
代码示例来源:origin: org.fcrepo/fcrepo-common
public static Document parseNamespaceAware(File src)
throws Exception {
return parseNamespaceAware(new FileInputStream(src));
}
代码示例来源:origin: org.fcrepo/fcrepo-common
public void serialize(OutputStream out) throws Exception {
final Transformer idTransform = XmlTransformUtility.getTransformer();
Source input = new DOMSource(doc);
Result output = new StreamResult(out);
idTransform.transform(input, output);
}
}
代码示例来源:origin: org.fcrepo/fcrepo-server
public void parse(String username, String password) throws IOException,
FinishedParsingException {
this.username = username;
this.password = password;
try {
value = new StringBuffer();
authenticated = null;
namedAttributes = new Hashtable<String, Set<?>>();
foundUser = false;
XmlTransformUtility.parseWithoutValidating(m_xmlStream, this);
} catch (FinishedParsingException fpe) {
throw fpe;
} catch (Throwable e) {
e.printStackTrace();
throw new IOException("Error parsing XML: " + e.getMessage());
}
}
代码示例来源:origin: fcrepo3/fcrepo
public static Document getDocumentFromFile(File file) throws Exception {
byte[] document = loadFile(file);
DocumentBuilder docBuilder =
XmlTransformUtility.borrowDocumentBuilder();
Document doc = null;
try {
doc = docBuilder.parse(new ByteArrayInputStream(document));
} finally {
XmlTransformUtility.returnDocumentBuilder(docBuilder);
}
return doc;
}
代码示例来源:origin: org.fcrepo/fcrepo-common
/**
* Try to cache parsed Templates, but check for changes on disk
* @param src
* @return Templates
*/
public static Templates getTemplates(File src) throws TransformerException {
String key = src.getAbsolutePath();
TimestampedCacheEntry<Templates> entry = TEMPLATES_CACHE.get(key);
// check to see if it is null or has changed
if (entry == null || entry.timestamp() < src.lastModified()) {
TransformerFactory factory = null;
try {
factory = borrowTransformerFactory();
Templates template = factory.newTemplates(new StreamSource(src));
entry = new TimestampedCacheEntry<Templates>(src.lastModified(), template);
} catch (Exception e) {
throw new TransformerException(e.getMessage(), e);
} finally {
if (factory != null) returnTransformerFactory(factory);
}
TEMPLATES_CACHE.put(key, entry);
}
return entry.value();
}
代码示例来源:origin: fcrepo3/fcrepo
public static Document parseNamespaceAware(File src)
throws Exception {
return parseNamespaceAware(new FileInputStream(src));
}
代码示例来源:origin: fcrepo3/fcrepo
public void serialize(OutputStream out) throws Exception {
final Transformer idTransform = XmlTransformUtility.getTransformer();
Source input = new DOMSource(doc);
Result output = new StreamResult(out);
idTransform.transform(input, output);
}
}
代码示例来源:origin: fcrepo3/fcrepo
public void parse(String username, String password) throws IOException,
FinishedParsingException {
this.username = username;
this.password = password;
try {
value = new StringBuffer();
authenticated = null;
namedAttributes = new Hashtable<String, Set<?>>();
foundUser = false;
XmlTransformUtility.parseWithoutValidating(m_xmlStream, this);
} catch (FinishedParsingException fpe) {
throw fpe;
} catch (Throwable e) {
e.printStackTrace();
throw new IOException("Error parsing XML: " + e.getMessage());
}
}
代码示例来源:origin: fcrepo3/fcrepo
public static String format(byte[] document) throws Exception {
DocumentBuilder builder = XmlTransformUtility.borrowDocumentBuilder();
Document doc = null;
try {
doc = builder.parse(new ByteArrayInputStream(document));
} finally {
XmlTransformUtility.returnDocumentBuilder(builder);
}
return format(doc);
}
本文整理了Java中org.fcrepo.utilities.XmlTransformUtility.parseWithoutValidating()方法的一些代码示例,展示了XmlTransform
本文整理了Java中org.fcrepo.utilities.XmlTransformUtility.returnDocumentBuilder()方法的一些代码示例,展示了XmlTransformU
本文整理了Java中org.fcrepo.utilities.XmlTransformUtility.returnTransformerFactory()方法的一些代码示例,展示了XmlTransfo
本文整理了Java中org.fcrepo.utilities.XmlTransformUtility.borrowDocumentBuilder()方法的一些代码示例,展示了XmlTransformU
本文整理了Java中org.fcrepo.utilities.XmlTransformUtility.parseNamespaceAware()方法的一些代码示例,展示了XmlTransformUti
本文整理了Java中org.fcrepo.utilities.XmlTransformUtility.getTransformer()方法的一些代码示例,展示了XmlTransformUtility.
本文整理了Java中org.fcrepo.utilities.XmlTransformUtility.borrowTransformerFactory()方法的一些代码示例,展示了XmlTransfo
我是一名优秀的程序员,十分优秀!