Java 类org.jdom.output.DOMOutputter 实例源码

项目:intellij-ce-playground    文件:JDOMUtil.java   
@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);
  }
}
项目:tools-idea    文件:JDOMUtil.java   
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);
  }
}
项目:ogpHarvester    文件:GeoNetworkClient.java   
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;
}
项目:consulo    文件:JDOMUtil.java   
@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);
  }
}
项目:elexis-3-base    文件:TarmedJaxbUtil.java   
@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;
}
项目:sakai    文件:XmlStringBuffer.java   
/**
 * 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);
  }
}
项目:sakai    文件:XmlStringBuffer.java   
/**
 * 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);
  }
}
项目:cagrid-core    文件:AxisJdomUtils.java   
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());
}
项目:parabuild-ci    文件:WireFeedOutput.java   
/**
 * 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);
    }
}
项目:feeds    文件:WireFeedOutput.java   
/**
 * 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);
    }
}
项目:NK-VirtualGlobe    文件:WireFeedOutput.java   
/**
 * 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);
    }
}