Class MCRJDOMContent

Direct Known Subclasses:
MCRBaseContent

public class MCRJDOMContent extends MCRXMLContent
Reads MCRContent from a JDOM XML document.
Author:
Frank Lützenkichen
  • Constructor Details

    • MCRJDOMContent

      public MCRJDOMContent(Document jdom)
      Parameters:
      jdom - the JDOM XML document to read from
    • MCRJDOMContent

      public MCRJDOMContent(Element jdom)
      Alternative constructor for newly created root elements that do not have a Document parent yet, which is a very common use case.
      Parameters:
      jdom - the JDOM XML root element to read from
  • Method Details

    • getSource

      public Source getSource()
      Description copied from class: MCRContent
      Return the content as Source
      Overrides:
      getSource in class MCRContent
      Returns:
      content as Source
    • sendTo

      public void sendTo(OutputStream out) throws IOException
      Description copied from class: MCRContent
      Sends content to the given OutputStream. The OutputStream is NOT automatically closed afterwards.
      Overrides:
      sendTo in class MCRContent
      Parameters:
      out - the OutputStream to write the content to
      Throws:
      IOException
    • asXML

      public Document asXML()
      Description copied from class: MCRContent
      Parses content, assuming it is XML, and returns the parsed document.
      Overrides:
      asXML in class MCRContent
      Returns:
      the XML document parsed from content