public class XMLFormatter extends Object implements ObjectFormatter<Document>
jest-instance.xsd
schema.Modifier and Type | Field and Description |
---|---|
protected static Localizer |
_loc |
static Schema |
_xsd |
dateFormat
Constructor and Description |
---|
XMLFormatter() |
Modifier and Type | Method and Description |
---|---|
Document |
encode(Collection<OpenJPAStateManager> sms,
Metamodel model)
Encodes the closure of given collection of managed instance into a new XML document
according to JEST Instance XML Schema.
|
Document |
encode(Metamodel model)
Encodes the given meta-model into a new XML document according to JEST Domain XML Schema.
|
String |
getMimeType()
Gets the mime type produced by this formatter.
|
Element |
newDocument(String rootTag)
Create a new document with the given tag as the root element.
|
void |
write(Document doc,
OutputStream out) |
void |
write(Document doc,
Writer writer) |
Document |
writeOut(Collection<OpenJPAStateManager> objs,
Metamodel model,
String title,
String desc,
String uri,
OutputStream out)
Encodes the
persistent closure of the given collection of objects, then write it into
the given output stream. |
Document |
writeOut(Metamodel model,
String title,
String desc,
String uri,
OutputStream out)
Encodes the given domain model, then write it into the given output stream.
|
public String getMimeType()
ObjectFormatter
getMimeType
in interface ObjectFormatter<Document>
public Document encode(Collection<OpenJPAStateManager> sms, Metamodel model)
encode
in interface ObjectFormatter<Document>
sm
- a collection of managed instances.parent
- the parent node to which the new node be attached.public Document encode(Metamodel model)
encode
in interface ObjectFormatter<Document>
model
- a persistent domain model. Must not be null.public Element newDocument(String rootTag)
rootTag
- the tag of the root elementpublic Document writeOut(Collection<OpenJPAStateManager> objs, Metamodel model, String title, String desc, String uri, OutputStream out) throws IOException
ObjectFormatter
persistent closure
of the given collection of objects, then write it into
the given output stream.writeOut
in interface ObjectFormatter<Document>
objs
- the collection of objects to be formatted.model
- a meta-model of managed types, provided for easier introspection if necessarytitle
- TODOdesc
- TODOuri
- TODOIOException
public Document writeOut(Metamodel model, String title, String desc, String uri, OutputStream out) throws IOException
ObjectFormatter
writeOut
in interface ObjectFormatter<Document>
model
- a meta-model of managed typesIOException
public void write(Document doc, OutputStream out) throws IOException
IOException
public void write(Document doc, Writer writer) throws IOException
IOException
Copyright © 2006–2017 Apache Software Foundation. All rights reserved.