|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.openjpa.persistence.jest.XMLFormatter
public class XMLFormatter
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 the jest-instance.xsd
schema.
Field Summary | |
---|---|
protected static Localizer |
_loc
|
static Schema |
_xsd
|
Fields inherited from interface org.apache.openjpa.persistence.jest.ObjectFormatter |
---|
dateFormat |
Constructor Summary | |
---|---|
XMLFormatter()
|
Method Summary | |
---|---|
(package private) Document |
decorate(Document doc,
String title,
String desc,
String uri)
|
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. |
(package private) String |
ior(OpenJPAStateManager sm)
|
Element |
newDocument(String rootTag)
Create a new document with the given tag as the root element. |
(package private) String |
typeOf(Class<?> cls)
|
(package private) String |
typeOf(ClassMetaData meta)
|
(package private) String |
typeOf(FieldMetaData fmd)
|
(package private) String |
typeOf(OpenJPAStateManager sm)
|
(package private) String |
typeOf(ValueMetaData vm)
|
(package private) void |
validate(Document doc)
|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final Schema _xsd
protected static Localizer _loc
Constructor Detail |
---|
public XMLFormatter()
Method Detail |
---|
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 element
public 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
- TODO
IOException
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 types
IOException
Document decorate(Document doc, String title, String desc, String uri)
public void write(Document doc, OutputStream out) throws IOException
IOException
public void write(Document doc, Writer writer) throws IOException
IOException
void validate(Document doc) throws Exception
Exception
String ior(OpenJPAStateManager sm)
String typeOf(OpenJPAStateManager sm)
String typeOf(Class<?> cls)
String typeOf(ClassMetaData meta)
String typeOf(ValueMetaData vm)
String typeOf(FieldMetaData fmd)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |