public class XmlSnapshot extends Object implements org.apache.isis.applib.services.xmlsnapshot.XmlSnapshotService.Snapshot
Initially designed to allow snapshots to be easily created.
Typical use:
XmlSnapshot snapshot = new XmlSnapshot(customer); // where customer is a
// reference to an
// ObjectAdapter
Element customerAsXml = snapshot.toXml(); // returns customer's fields, titles
// of simple references, number of
// items in collections
snapshot.include("placeOfBirth"); // navigates to another object represented by
// simple reference "placeOfBirth"
snapshot.include("orders/product"); // navigates to all <tt>Order</tt>s of
// <tt>Customer</tt>, and from them for
// their <tt>Product</tt>s
| Constructor and Description |
|---|
XmlSnapshot(ObjectAdapter rootAdapter,
OidMarshaller oidMarshaller)
Start a snapshot at the root object, using own namespace manager.
|
XmlSnapshot(ObjectAdapter rootAdapter,
XmlSchema schema,
OidMarshaller oidMarshaller)
Start a snapshot at the root object, using supplied namespace manager.
|
| Modifier and Type | Method and Description |
|---|---|
ObjectAdapter |
getObject() |
XmlSchema |
getSchema() |
String |
getSchemaLocationFileName()
The name of the
xsi:schemaLocation in the XML document. |
Document |
getXmlDocument() |
String |
getXmlDocumentAsString() |
Element |
getXmlElement()
The root element of
getXmlDocument(). |
Document |
getXsdDocument() |
String |
getXsdDocumentAsString() |
Element |
getXsdElement()
The root element of
getXsdDocument(). |
void |
include(String path) |
void |
include(String path,
String annotation) |
public XmlSnapshot(ObjectAdapter rootAdapter, OidMarshaller oidMarshaller)
oidMarshaller - TODOpublic XmlSnapshot(ObjectAdapter rootAdapter, XmlSchema schema, OidMarshaller oidMarshaller)
oidMarshaller - TODOpublic ObjectAdapter getObject()
public String getSchemaLocationFileName()
xsi:schemaLocation in the XML document.
Taken from the fullyQualifiedClassName (which also is used
as the basis for the targetNamespace.
Populated in appendXml(ObjectAdapter).public Document getXmlDocument()
getXmlDocument in interface org.apache.isis.applib.services.xmlsnapshot.XmlSnapshotService.Snapshotpublic Element getXmlElement()
getXmlDocument(). Returns null
until the snapshot has actually been built.public Document getXsdDocument()
getXsdDocument in interface org.apache.isis.applib.services.xmlsnapshot.XmlSnapshotService.Snapshotpublic Element getXsdElement()
getXsdDocument(). Returns null
until the snapshot has actually been built.public String getXmlDocumentAsString()
getXmlDocumentAsString in interface org.apache.isis.applib.services.xmlsnapshot.XmlSnapshotService.Snapshotpublic String getXsdDocumentAsString()
getXsdDocumentAsString in interface org.apache.isis.applib.services.xmlsnapshot.XmlSnapshotService.SnapshotCopyright © 2010–2014 The Apache Software Foundation. All rights reserved.