- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.apache.geronimo.kernel.util.XmlUtil
类的一些代码示例,展示了XmlUtil
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XmlUtil
类的具体详情如下:
包路径:org.apache.geronimo.kernel.util.XmlUtil
类名称:XmlUtil
暂无
代码示例来源:origin: org.apache.geronimo.framework/geronimo-deployment
public ParserFactoryImpl(EntityResolver entityResolver) {
this.entityResolver = entityResolver;
factory = XmlUtil.newDocumentBuilderFactory();
//sets "http://xml.org/sax/features/namespaces"
factory.setNamespaceAware(true);
//sets "http://xml.org/sax/features/validation"
factory.setValidating(true);
factory.setAttribute(
"http://java.sun.com/xml/jaxp/properties/schemaLanguage",
"http://www.w3.org/2001/XMLSchema");
factory.setAttribute("http://apache.org/xml/features/validation/schema",
Boolean.TRUE);
}
代码示例来源:origin: org.apache.geronimo.modules/geronimo-kernel
public static SAXParserFactory newSAXParserFactory() {
return newSAXParserFactory(getClassLoader());
}
代码示例来源:origin: org.apache.geronimo.modules/geronimo-kernel
public static TransformerFactory newTransformerFactory() {
return newTransformerFactory(getClassLoader());
}
代码示例来源:origin: org.apache.geronimo.modules/geronimo-kernel
public static DocumentBuilderFactory newDocumentBuilderFactory() {
return newDocumentBuilderFactory(getClassLoader());
}
代码示例来源:origin: org.apache.geronimo.modules/geronimo-deploy-jsr88
private static String extractModuleIdFromPlan(Reader plan) throws IOException {
SAXParserFactory factory = XmlUtil.newSAXParserFactory();
factory.setNamespaceAware(true);
factory.setValidating(false);
try {
SAXParser parser = factory.newSAXParser();
ConfigIdHandler handler = new ConfigIdHandler();
parser.parse(new InputSource(plan), handler);
if(handler.formatIs10) {
log.warn("Geronimo deployment plan uses Geronimo 1.0 syntax. Please update to Geronimo 1.1 syntax when possible.");
}
return handler.configId;
} catch (ParserConfigurationException e) {
throw (IOException)new IOException("Unable to read plan: "+e.getMessage()).initCause(e);
} catch (SAXException e) {
throw (IOException)new IOException("Unable to read plan: "+e.getMessage()).initCause(e);
} finally {
plan.close();
}
}
代码示例来源:origin: org.apache.geronimo.modules/geronimo-kernel
public static TransformerFactory newTransformerFactory(ClassLoader classLoader) {
String transformerName = getSystemProperty(TRANSFORMER_FACTORY);
if (transformerName != null && transformerName.length() != 0) {
try {
Class transformerClass = ClassLoading.loadClass(transformerName, classLoader);
TransformerFactory transformerFactory = (TransformerFactory) transformerClass.newInstance();
return transformerFactory;
} catch (Exception e) {
throw new TransformerFactoryConfigurationError(e, "Unable to create TransformerFactory " +
transformerName + ", which was specified in the " + TRANSFORMER_FACTORY + " system property");
}
}
return TransformerFactory.newInstance();
}
代码示例来源:origin: org.apache.geronimo.framework/geronimo-plugin
/**
* Puts the name and ID of a plugin into the argument map of plugins,
* by reading the values out of the provided plugin descriptor stream.
*
* @param xml The geronimo-plugin.xml for this plugin
* @param plugins The result map to populate
*/
private void readNameAndID(InputStream xml, Map plugins) {
try {
SAXParserFactory factory = XmlUtil.newSAXParserFactory();
SAXParser parser = factory.newSAXParser();
PluginNameIDHandler handler = new PluginNameIDHandler();
parser.parse(xml, handler);
if (handler.isComplete()) {
plugins.put(handler.getName(), Artifact.create(handler.getID()));
}
} catch (Exception e) {
log.warn("Invalid XML", e);
}
}
代码示例来源:origin: org.apache.geronimo.modules/geronimo-kernel
public static SAXParserFactory newSAXParserFactory(ClassLoader classLoader) {
String saxParserName = getSystemProperty(SAX_PARSER_FACTORY);
if (saxParserName != null && saxParserName.length() != 0) {
try {
Class saxParserClass = ClassLoading.loadClass(saxParserName, classLoader);
SAXParserFactory saxParserFactory = (SAXParserFactory) saxParserClass.newInstance();
return saxParserFactory;
} catch (Exception e) {
throw new FactoryConfigurationError(e, "Unable to create SAXParserFactory " +
saxParserName + ", which was specified in the " + SAX_PARSER_FACTORY + " system property");
}
}
return SAXParserFactory.newInstance();
}
代码示例来源:origin: org.apache.geronimo.modules/geronimo-kernel
private static Element storeGBeans(List gbeans) throws IOException {
GBeanData[] gbeanDatas = (GBeanData[]) gbeans.toArray(new GBeanData[gbeans.size()]);
DocumentBuilderFactory documentBuilderFactory = XmlUtil.newDocumentBuilderFactory();
DocumentBuilder documentBuilder = null;
try {
documentBuilder = documentBuilderFactory.newDocumentBuilder();
} catch (ParserConfigurationException e) {
throw (IOException)new IOException("Cannot instantiate " + Document.class.getName()).initCause(e);
}
Document document = documentBuilder.newDocument();
DomWriter writer = new DomWriter(document);
XStream xstream = XStreamUtil.createXStream();
xstream.marshal(gbeanDatas, writer);
// FileWriter w = new FileWriter("target/foo.xml");
// xstream.toXML(gbeanDatas, w);
// w.close();
return document.getDocumentElement();
}
}
代码示例来源:origin: org.apache.geronimo.framework/geronimo-plugin
/**
* Puts the name and ID of a plugin into the argument map of plugins,
* by reading the values out of the provided plugin descriptor file.
*
* @param xml The geronimo-plugin.xml for this plugin
* @param plugins The result map to populate
*/
private void readNameAndID(File xml, Map<String, Artifact> plugins) {
try {
SAXParserFactory factory = XmlUtil.newSAXParserFactory();
SAXParser parser = factory.newSAXParser();
PluginNameIDHandler handler = new PluginNameIDHandler();
parser.parse(xml, handler);
if (handler.isComplete()) {
plugins.put(handler.getName(), Artifact.create(handler.getID()));
}
} catch (Exception e) {
log.warn("Invalid XML at " + xml.getAbsolutePath(), e);
}
}
代码示例来源:origin: org.apache.geronimo.modules/geronimo-kernel
public static DocumentBuilderFactory newDocumentBuilderFactory(ClassLoader classLoader) {
String documentBuilderName = getSystemProperty(DOCUMENT_BUILDER_FACTORY);
if (documentBuilderName != null && documentBuilderName.length() != 0) {
try {
Class documentBuilderClass = ClassLoading.loadClass(documentBuilderName, classLoader);
DocumentBuilderFactory documentBuilderFactory = (DocumentBuilderFactory) documentBuilderClass.newInstance();
return documentBuilderFactory;
} catch (Exception e) {
throw new FactoryConfigurationError(e, "Unable to create DocumentBuilderFactory " +
documentBuilderName + ", which was specified in the " + DOCUMENT_BUILDER_FACTORY + " system property");
}
}
return DocumentBuilderFactory.newInstance();
}
代码示例来源:origin: org.apache.geronimo.framework/geronimo-plugin
private Document getMavenMetadata(URI base) throws IOException, FailedLoginException {
Document doc = null;
InputStream in = null;
try {
URL metaURL = base.resolve( "maven-metadata.xml").toURL();
in = openStream(metaURL);
if (in == null) { // check for local maven metadata
metaURL = base.resolve("maven-metadata-local.xml").toURL();
in = openStream(metaURL);
}
if (in != null) {
DocumentBuilder builder = XmlUtil.newDocumentBuilderFactory().newDocumentBuilder();
doc = builder.parse(in);
}
} catch (ParserConfigurationException e) {
throw (IOException)new IOException().initCause(e);
} catch (SAXException e) {
throw (IOException)new IOException().initCause(e);
} finally {
if (in == null) {
// log.info("No maven metadata available at " + base);
} else {
in.close();
}
}
return doc;
}
代码示例来源:origin: org.apache.geronimo.modules/geronimo-kernel
public Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext unmarshallingContext) {
DocumentBuilderFactory documentBuilderFactory = XmlUtil.newDocumentBuilderFactory();
DocumentBuilder documentBuilder = null;
try {
documentBuilder = documentBuilderFactory.newDocumentBuilder();
} catch (ParserConfigurationException e) {
throw new ConversionException("Cannot instantiate " + Document.class.getName(), e);
}
Document document = documentBuilder.newDocument();
DomWriter writer = new DomWriter(document);
copy(reader, writer);
if (Document.class.isAssignableFrom(unmarshallingContext.getRequiredType())) {
return document;
} else {
return document.getDocumentElement();
}
}
代码示例来源:origin: org.apache.geronimo.modules/geronimo-converter
public static DatabaseConversionStatus convert(Reader configXml) throws IOException {
List status = new ArrayList();
List noTx = new ArrayList();
List local = new ArrayList();
List xa = new ArrayList();
DocumentBuilderFactory factory = XmlUtil.newDocumentBuilderFactory();
factory.setValidating(false);
try {
DocumentBuilder builder = factory.newDocumentBuilder();
Document doc = builder.parse(new InputSource(configXml));
configXml.close();
parseDocument(doc, status, local, xa);
} catch (ParserConfigurationException e) {
throw (IOException)new IOException().initCause(e);
} catch (SAXException e) {
throw (IOException)new IOException().initCause(e);
}
DatabaseConversionStatus result = new DatabaseConversionStatus();
result.setMessages((String[]) status.toArray(new String[status.size()]));
result.setNoTXPools((JDBCPool[]) noTx.toArray(new JDBCPool[noTx.size()]));
result.setJdbcPools((JDBCPool[]) local.toArray(new JDBCPool[noTx.size()]));
result.setXaPools((XADatabasePool[]) xa.toArray(new XADatabasePool[xa.size()]));
return result;
}
代码示例来源:origin: org.apache.geronimo.modules/geronimo-converter
public static DatabaseConversionStatus convert(Reader dsXml) throws IOException {
List status = new ArrayList();
List noTx = new ArrayList();
List local = new ArrayList();
List xa = new ArrayList();
DocumentBuilderFactory factory = XmlUtil.newDocumentBuilderFactory();
factory.setValidating(false);
try {
DocumentBuilder builder = factory.newDocumentBuilder();
Document doc = builder.parse(new InputSource(dsXml));
dsXml.close();
parseDocument(doc, status, noTx, local, xa);
} catch (ParserConfigurationException e) {
throw (IOException)new IOException().initCause(e);
} catch (SAXException e) {
throw (IOException)new IOException().initCause(e);
}
DatabaseConversionStatus result = new DatabaseConversionStatus();
result.setMessages((String[]) status.toArray(new String[status.size()]));
result.setNoTXPools((JDBCPool[]) noTx.toArray(new JDBCPool[noTx.size()]));
result.setJdbcPools((JDBCPool[]) local.toArray(new JDBCPool[noTx.size()]));
result.setXaPools((XADatabasePool[]) xa.toArray(new XADatabasePool[xa.size()]));
return result;
}
代码示例来源:origin: org.apache.geronimo.modules/geronimo-kernel
if (is != null) {
InputSource in = new InputSource(is);
DocumentBuilderFactory dfactory = XmlUtil.newDocumentBuilderFactory();
dfactory.setNamespaceAware(true);
try {
代码示例来源:origin: org.apache.geronimo.plugins/activemq-portlets
while((entry = in.getNextEntry()) != null) {
if(entry.getName().equals("META-INF/ra.xml")) {
DocumentBuilderFactory factory = XmlUtil.newDocumentBuilderFactory();
factory.setValidating(false);
DocumentBuilder builder = factory.newDocumentBuilder();
无法弄清楚为什么 XMLUtils.outputDOM 没有输出任何内容 import org.apache.xml.security.utils.XMLUtils; DocumentBuilderF
我正在使用 XmlUtils 解析并提取列表中 id 属性的值,但它返回空。 我哪里出错了?请推荐 XML:
本文整理了Java中org.metawidget.util.XmlUtils.getSiblingWithAttribute()方法的一些代码示例,展示了XmlUtils.getSiblingWith
本文整理了Java中org.metawidget.util.XmlUtils.inspectionResultToJsonSchema()方法的一些代码示例,展示了XmlUtils.inspectio
本文整理了Java中org.metawidget.util.XmlUtils.getChildWithAttributeValue()方法的一些代码示例,展示了XmlUtils.getChildWit
本文整理了Java中org.metawidget.util.XmlUtils.newDocument()方法的一些代码示例,展示了XmlUtils.newDocument()的具体用法。这些代码示例主
本文整理了Java中org.metawidget.util.XmlUtils.setMapAsAttributes()方法的一些代码示例,展示了XmlUtils.setMapAsAttributes(
本文整理了Java中org.metawidget.util.XmlUtils.getFirstChildElement()方法的一些代码示例,展示了XmlUtils.getFirstChildElem
本文整理了Java中org.metawidget.util.XmlUtils.getNextSiblingElement()方法的一些代码示例,展示了XmlUtils.getNextSiblingEl
本文整理了Java中org.metawidget.util.XmlUtils.arrayToJsonSchema()方法的一些代码示例,展示了XmlUtils.arrayToJsonSchema()的
本文整理了Java中org.metawidget.util.XmlUtils.escapeForXml()方法的一些代码示例,展示了XmlUtils.escapeForXml()的具体用法。这些代码示
本文整理了Java中org.metawidget.util.XmlUtils.getLocalName()方法的一些代码示例,展示了XmlUtils.getLocalName()的具体用法。这些代码示
本文整理了Java中org.metawidget.util.XmlUtils.getChildWithAttribute()方法的一些代码示例,展示了XmlUtils.getChildWithAttr
本文整理了Java中org.metawidget.util.XmlUtils.importElement()方法的一些代码示例,展示了XmlUtils.importElement()的具体用法。这些代
本文整理了Java中org.metawidget.util.XmlUtils.combineElements()方法的一些代码示例,展示了XmlUtils.combineElements()的具体用法
本文整理了Java中org.metawidget.util.XmlUtils.getAttributesAsMap()方法的一些代码示例,展示了XmlUtils.getAttributesAsMap(
本文整理了Java中org.metawidget.util.XmlUtils.documentFromString()方法的一些代码示例,展示了XmlUtils.documentFromString(
本文整理了Java中org.metawidget.util.XmlUtils.documentToString()方法的一些代码示例,展示了XmlUtils.documentToString()的具体
本文整理了Java中org.intermine.util.XmlUtil.getFragmentFromURI()方法的一些代码示例,展示了XmlUtil.getFragmentFromURI()的具
本文整理了Java中org.intermine.util.XmlUtil.writeIndentation()方法的一些代码示例,展示了XmlUtil.writeIndentation()的具体用法。
我是一名优秀的程序员,十分优秀!