Class XMLFormatter
- java.lang.Object
- 
- org.apache.openjpa.persistence.jest.XMLFormatter
 
- 
- All Implemented Interfaces:
- ObjectFormatter<org.w3c.dom.Document>
 
 public class XMLFormatter extends java.lang.Object implements ObjectFormatter<org.w3c.dom.Document> Marshals a root instance and its persistent closure as an XML element. The closure is resolved against the persistence context that contains the root instance. The XML document adheres to thejest-instance.xsdschema.- Author:
- Pinaki Poddar
 
- 
- 
Field SummaryFields Modifier and Type Field Description protected static Localizer_locstatic javax.xml.validation.Schema_xsd- 
Fields inherited from interface org.apache.openjpa.persistence.jest.ObjectFormatterdateFormat
 
- 
 - 
Constructor SummaryConstructors Constructor Description XMLFormatter()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description org.w3c.dom.Documentencode(jakarta.persistence.metamodel.Metamodel model)Encodes the given meta-model into a new XML document according to JEST Domain XML Schema.org.w3c.dom.Documentencode(java.util.Collection<OpenJPAStateManager> sms, jakarta.persistence.metamodel.Metamodel model)Encodes the closure of given collection of managed instance into a new XML document according to JEST Instance XML Schema.java.lang.StringgetMimeType()Gets the mime type produced by this formatter.org.w3c.dom.ElementnewDocument(java.lang.String rootTag)Create a new document with the given tag as the root element.voidwrite(org.w3c.dom.Document doc, java.io.OutputStream out)voidwrite(org.w3c.dom.Document doc, java.io.Writer writer)org.w3c.dom.DocumentwriteOut(jakarta.persistence.metamodel.Metamodel model, java.lang.String title, java.lang.String desc, java.lang.String uri, java.io.OutputStream out)Encodes the given domain model, then write it into the given output stream.org.w3c.dom.DocumentwriteOut(java.util.Collection<OpenJPAStateManager> objs, jakarta.persistence.metamodel.Metamodel model, java.lang.String title, java.lang.String desc, java.lang.String uri, java.io.OutputStream out)Encodes thepersistent closureof the given collection of objects, then write it into the given output stream.
 
- 
- 
- 
Field Detail- 
_xsdpublic static final javax.xml.validation.Schema _xsd 
 - 
_locprotected static Localizer _loc 
 
- 
 - 
Method Detail- 
getMimeTypepublic java.lang.String getMimeType() Description copied from interface:ObjectFormatterGets the mime type produced by this formatter.- Specified by:
- getMimeTypein interface- ObjectFormatter<org.w3c.dom.Document>
 
 - 
encodepublic org.w3c.dom.Document encode(java.util.Collection<OpenJPAStateManager> sms, jakarta.persistence.metamodel.Metamodel model) Encodes the closure of given collection of managed instance into a new XML document according to JEST Instance XML Schema.- Specified by:
- encodein interface- ObjectFormatter<org.w3c.dom.Document>
- Parameters:
- sm- a collection of managed instances.
- parent- the parent node to which the new node be attached.
- Returns:
- an encoded object e.g. a XML or HTML Document or a JSON object.
 
 - 
encodepublic org.w3c.dom.Document encode(jakarta.persistence.metamodel.Metamodel model) Encodes the given meta-model into a new XML document according to JEST Domain XML Schema.- Specified by:
- encodein interface- ObjectFormatter<org.w3c.dom.Document>
- Parameters:
- model- a persistent domain model. Must not be null.
- Returns:
- an encoded object e.g. a XML or HTML Document or a JSON object.
 
 - 
newDocumentpublic org.w3c.dom.Element newDocument(java.lang.String rootTag) Create a new document with the given tag as the root element.- Parameters:
- rootTag- the tag of the root element
- Returns:
- the document element of a new document
 
 - 
writeOutpublic org.w3c.dom.Document writeOut(java.util.Collection<OpenJPAStateManager> objs, jakarta.persistence.metamodel.Metamodel model, java.lang.String title, java.lang.String desc, java.lang.String uri, java.io.OutputStream out) throws java.io.IOException Description copied from interface:ObjectFormatterEncodes thepersistent closureof the given collection of objects, then write it into the given output stream.- Specified by:
- writeOutin interface- ObjectFormatter<org.w3c.dom.Document>
- Parameters:
- objs- the collection of objects to be formatted.
- model- a meta-model of managed types, provided for easier introspection if necessary
- title- TODO
- desc- TODO
- uri- TODO
- Throws:
- java.io.IOException
 
 - 
writeOutpublic org.w3c.dom.Document writeOut(jakarta.persistence.metamodel.Metamodel model, java.lang.String title, java.lang.String desc, java.lang.String uri, java.io.OutputStream out) throws java.io.IOExceptionDescription copied from interface:ObjectFormatterEncodes the given domain model, then write it into the given output stream.- Specified by:
- writeOutin interface- ObjectFormatter<org.w3c.dom.Document>
- Parameters:
- model- a meta-model of managed types
- Throws:
- java.io.IOException
 
 - 
writepublic void write(org.w3c.dom.Document doc, java.io.OutputStream out) throws java.io.IOException- Throws:
- java.io.IOException
 
 - 
writepublic void write(org.w3c.dom.Document doc, java.io.Writer writer) throws java.io.IOException- Throws:
- java.io.IOException
 
 
- 
 
-