|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.opensaml.xml.io.AbstractXMLObjectMarshaller
public abstract class AbstractXMLObjectMarshaller
A thread safe, abstract implementation of the Marshaller interface. This class handles
most of the boilerplate code:
| Constructor Summary | |
|---|---|
protected |
AbstractXMLObjectMarshaller()
Constructor. |
protected |
AbstractXMLObjectMarshaller(String targetNamespaceURI,
String targetLocalName)
Deprecated. no replacement |
| Method Summary | |
|---|---|
protected void |
checkXMLObjectIsTarget(XMLObject xmlObject)
Checks to make sure the given XMLObject's schema type or element QName matches the target parameters given at marshaller construction time. |
Element |
marshall(XMLObject xmlObject)
Marshall this element, and its children, and root them in a newly created Document. |
Element |
marshall(XMLObject xmlObject,
Document document)
Marshall this element, and its children, into a W3C DOM element. |
Element |
marshall(XMLObject xmlObject,
Element parentElement)
Marshall the given XMLObject and append it as a child to the given parent element. |
protected abstract void |
marshallAttributes(XMLObject xmlObject,
Element domElement)
Marshalls a given XMLObject into a W3C Element. |
protected void |
marshallChildElements(XMLObject xmlObject,
Element domElement)
Marshalls the child elements of the given XMLObject. |
protected abstract void |
marshallElementContent(XMLObject xmlObject,
Element domElement)
Marshalls data from the XMLObject into content of the DOM Element. |
protected Element |
marshallInto(XMLObject xmlObject,
Element targetElement)
Marshalls the given XMLObject into the given DOM Element. |
protected void |
marshallNamespacePrefix(XMLObject xmlObject,
Element domElement)
Marshalls the namespace prefix of the XMLObject into the DOM element. |
protected void |
marshallNamespaces(XMLObject xmlObject,
Element domElement)
Creates the xmlns attributes for any namespaces set on the given XMLObject. |
protected void |
marshallSchemaInstanceAttributes(XMLObject xmlObject,
Element domElement)
Creates the XSI type, schemaLocation, and noNamespaceSchemaLocation attributes for an XMLObject. |
protected void |
setDocumentElement(Document document,
Element element)
Sets the given element as the Document Element of the given Document. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected AbstractXMLObjectMarshaller()
protected AbstractXMLObjectMarshaller(String targetNamespaceURI,
String targetLocalName)
targetNamespaceURI - the namespace URI of either the schema type QName or element QName of the elements this
unmarshaller operates ontargetLocalName - the local name of either the schema type QName or element QName of the elements this
unmarshaller operates on| Method Detail |
|---|
public Element marshall(XMLObject xmlObject)
throws MarshallingException
DocumentBuilder obtained from a DocumentBuilderFactory
created without any additional parameters or properties set; that is the system defaults properties are used.
marshall in interface MarshallerxmlObject - the object to marshall
MarshallingException - thrown if there is a problem marshalling the given object
public Element marshall(XMLObject xmlObject,
Document document)
throws MarshallingException
marshall in interface MarshallerxmlObject - the object to marshalldocument - the DOM document the marshalled element will be placed in
MarshallingException - thrown if there is a problem marshalling the given object
public Element marshall(XMLObject xmlObject,
Element parentElement)
throws MarshallingException
marshall in interface MarshallerxmlObject - the XMLObject to be marshalledparentElement - the parent of the Element resulting from marshalling the given XMLObject
MarshallingException - thrown if the given XMLObject can not be marshalled.
protected void setDocumentElement(Document document,
Element element)
document - the documentelement - the Element that will serve as the Document Element
protected Element marshallInto(XMLObject xmlObject,
Element targetElement)
throws MarshallingException
xmlObject - the XMLObject to marshalltargetElement - the Element into which the XMLObject is marshalled into
XMLObject is marshalled into
MarshallingException - thrown if there is a problem marshalling the object
protected void checkXMLObjectIsTarget(XMLObject xmlObject)
throws MarshallingException
xmlObject - the XMLObject to marshall
MarshallingException - thrown if the given object is not or the required type
protected void marshallNamespacePrefix(XMLObject xmlObject,
Element domElement)
xmlObject - the XMLObject being marshalleddomElement - the DOM element the XMLObject is being marshalled into
protected void marshallChildElements(XMLObject xmlObject,
Element domElement)
throws MarshallingException
xmlObject - the XMLObject whose children will be marshalleddomElement - the DOM element that will recieved the marshalled children
MarshallingException - thrown if there is a problem marshalling a child element
protected void marshallNamespaces(XMLObject xmlObject,
Element domElement)
xmlObject - the XMLObjectdomElement - the DOM element the namespaces will be added to
protected void marshallSchemaInstanceAttributes(XMLObject xmlObject,
Element domElement)
throws MarshallingException
xmlObject - the XMLObjectdomElement - the DOM element the namespaces will be added to
MarshallingException - thrown if the schema type information is invalid
protected abstract void marshallAttributes(XMLObject xmlObject,
Element domElement)
throws MarshallingException
xmlObject - the XMLObject to marshalldomElement - the W3C DOM element
MarshallingException - thrown if there is a problem marshalling the element
protected abstract void marshallElementContent(XMLObject xmlObject,
Element domElement)
throws MarshallingException
xmlObject - the XMLObjectdomElement - the DOM element recieving the content
MarshallingException - thrown if the textual content can not be added to the DOM element
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||