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


Java DOMOutputter类代码示例

本文整理汇总了Java中org.jdom.output.DOMOutputter的典型用法代码示例。如果您正苦于以下问题:Java DOMOutputter类的具体用法?Java DOMOutputter怎么用?Java DOMOutputter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


DOMOutputter类属于org.jdom.output包,在下文中一共展示了DOMOutputter类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: convertToDOM

import org.jdom.output.DOMOutputter; //导入依赖的package包/类
@SuppressWarnings("unused")
@Deprecated
public static org.w3c.dom.Element convertToDOM(@NotNull Element e) {
  try {
    final Document d = new Document();
    final Element newRoot = new Element(e.getName());
    final List attributes = e.getAttributes();

    for (Object o : attributes) {
      Attribute attr = (Attribute)o;
      newRoot.setAttribute(attr.getName(), attr.getValue(), attr.getNamespace());
    }

    d.addContent(newRoot);
    newRoot.addContent(e.cloneContent());

    return new DOMOutputter().output(d).getDocumentElement();
  }
  catch (JDOMException e1) {
    throw new RuntimeException(e1);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:JDOMUtil.java

示例2: convertToDOM

import org.jdom.output.DOMOutputter; //导入依赖的package包/类
public static org.w3c.dom.Element convertToDOM(@NotNull Element e) {
  try {
    final Document d = new Document();
    final Element newRoot = new Element(e.getName());
    final List attributes = e.getAttributes();

    for (Object o : attributes) {
      Attribute attr = (Attribute)o;
      newRoot.setAttribute(attr.getName(), attr.getValue(), attr.getNamespace());
    }

    d.addContent(newRoot);
    newRoot.addContent(e.cloneContent());

    return new DOMOutputter().output(d).getDocumentElement();
  }
  catch (JDOMException e1) {
    throw new RuntimeException(e1);
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:21,代码来源:JDOMUtil.java

示例3: retrieveMetadata

import org.jdom.output.DOMOutputter; //导入依赖的package包/类
public org.w3c.dom.Document retrieveMetadata(int metadataId) throws Exception {
    request.setUrl(new URL(serverUrl + "/srv/eng/xml.metadata.get"));

    request.clearParams();
    request.addParam("id", metadataId);

    Element md = request.execute();
    Element info = md.getChild("info", GEONET_NS);

    if (info != null) {
        info.detach();
    }

    Document doc = new Document(md);

    DOMOutputter domOutputter = new DOMOutputter();
    org.w3c.dom.Document document = domOutputter.output(doc);

    return document;
}
 
开发者ID:OpenGeoportal,项目名称:ogpHarvester,代码行数:21,代码来源:GeoNetworkClient.java

示例4: convertToDOM

import org.jdom.output.DOMOutputter; //导入依赖的package包/类
@SuppressWarnings("unused")
@Deprecated
public static org.w3c.dom.Element convertToDOM(@Nonnull Element e) {
  try {
    final Document d = new Document();
    final Element newRoot = new Element(e.getName());
    final List attributes = e.getAttributes();

    for (Object o : attributes) {
      Attribute attr = (Attribute)o;
      newRoot.setAttribute(attr.getName(), attr.getValue(), attr.getNamespace());
    }

    d.addContent(newRoot);
    newRoot.addContent(e.cloneContent());

    return new DOMOutputter().output(d).getDocumentElement();
  }
  catch (JDOMException e1) {
    throw new RuntimeException(e1);
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:23,代码来源:JDOMUtil.java

示例5: unmarshalInvoiceRequest440

import org.jdom.output.DOMOutputter; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public static RequestType unmarshalInvoiceRequest440(org.jdom.Document jdomDoc){
	try {
		JAXBContext jaxbContext = JAXBContext.newInstance(RequestType.class);
		Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
		
		DOMOutputter outputter = new DOMOutputter();
		Document document = outputter.output(jdomDoc);
		JAXBElement<Object> jaxElement = (JAXBElement<Object>) unmarshaller.unmarshal(document);
		
		if (jaxElement.getValue() instanceof RequestType) {
			RequestType request = (RequestType) jaxElement.getValue();
			return request;
		}
		
	} catch (JDOMException | JAXBException e) {
		log.error("Unmarshalling generalInvoiceRequest_440 from jDom document failed", e);
	}
	return null;
}
 
开发者ID:elexis,项目名称:elexis-3-base,代码行数:21,代码来源:TarmedJaxbUtil.java

示例6: XmlStringBuffer

import org.jdom.output.DOMOutputter; //导入依赖的package包/类
/**
 * Constructs an XmlStringBuffer whose initial value is Document
 *
 * @param jdomDoc
 *
 * @deprecated using XmlStringBuffer(org.w3c.dom.Document document) instead.
 */
public XmlStringBuffer(org.jdom.Document jdomDoc)
{
  try
  {
    this.document = new DOMOutputter().output(jdomDoc);
  }
  catch(JDOMException e)
  {
    log.error(e.getMessage(), e);
  }
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:19,代码来源:XmlStringBuffer.java

示例7: fromElement

import org.jdom.output.DOMOutputter; //导入依赖的package包/类
public static MessageElement fromElement(Element elem) throws JDOMException {
	Document doc = new Document(elem);
	org.w3c.dom.Document tempDoc = new DOMOutputter().output(doc);
	return new MessageElement(tempDoc.getDocumentElement());
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:6,代码来源:AxisJdomUtils.java

示例8: outputW3CDom

import org.jdom.output.DOMOutputter; //导入依赖的package包/类
/**
 * Creates a W3C DOM document for the given WireFeed.
 * <p>
 * This method does not use the feed encoding property.
 * <p>
 * NOTE: This method delages to the 'Document WireFeedOutput#outputJDom(WireFeed)'.
 * <p>
 * @param feed Abstract feed to create W3C DOM document from. The type of the WireFeed must match
 *        the type given to the FeedOuptut constructor.
 * @return the W3C DOM document for the given WireFeed.
 * @throws IllegalArgumentException thrown if the feed type of the WireFeedOutput and WireFeed don't match.
 * @throws FeedException thrown if the W3C DOM document for the feed could not be created.
 *
 */
public org.w3c.dom.Document outputW3CDom(WireFeed feed) throws IllegalArgumentException,FeedException {
    Document doc = outputJDom(feed);
    DOMOutputter outputter = new DOMOutputter();
    try {
        return outputter.output(doc);
    }
    catch (JDOMException jdomEx) {
        throw new FeedException("Could not create DOM",jdomEx);
    }
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:25,代码来源:WireFeedOutput.java


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