|
EclipseLink 2.4.2, build 'v20130514-5956486' API Reference | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.persistence.internal.sessions.AbstractRecord org.eclipse.persistence.oxm.record.XMLRecord org.eclipse.persistence.oxm.record.MarshalRecord
public abstract class MarshalRecord
A MarshalRecord encapsulates the marshal target.
MarshalRecords are stateful and state changes are triggered by different event notifications, therefore this class is not thread safe.
XML document creation will differ depending on the subclass of MarshalRecord used. For example when NodeRecord is used a child element is created on the openStartElement event, and when the ContentHandlerRecord is used a child element is not created until the closeStartMethod event.
XMLMarshaller
,
Serialized FormNested Class Summary | |
---|---|
class |
MarshalRecord.CycleDetectionStack<E>
A Stack-like List, used to detect object cycles during marshal operations. |
Nested classes/interfaces inherited from class org.eclipse.persistence.internal.sessions.AbstractRecord |
---|
org.eclipse.persistence.internal.sessions.AbstractRecord.EntrySet, org.eclipse.persistence.internal.sessions.AbstractRecord.KeySet, org.eclipse.persistence.internal.sessions.AbstractRecord.NoEntry, org.eclipse.persistence.internal.sessions.AbstractRecord.RecordEntry, org.eclipse.persistence.internal.sessions.AbstractRecord.RecordEntryIterator, org.eclipse.persistence.internal.sessions.AbstractRecord.RecordKeyIterator, org.eclipse.persistence.internal.sessions.AbstractRecord.RecordValuesIterator, org.eclipse.persistence.internal.sessions.AbstractRecord.ValuesSet |
Nested classes/interfaces inherited from interface java.util.Map |
---|
java.util.Map.Entry<K,V> |
Field Summary | |
---|---|
protected static java.lang.String |
COLON_W_SCHEMA_NIL_ATTRIBUTE
|
protected org.eclipse.persistence.internal.oxm.XPathFragment |
textWrapperFragment
|
protected static java.lang.String |
TRUE
|
Fields inherited from class org.eclipse.persistence.oxm.record.XMLRecord |
---|
currentObject, equalNamespaceResolvers, hasCustomNamespaceMapper, marshaller, namespaceAware, namespaceResolver, NIL, session, unmarshaller |
Fields inherited from class org.eclipse.persistence.internal.sessions.AbstractRecord |
---|
fields, lookupField, noEntry, nullValueInFields, size, values |
Constructor Summary | |
---|---|
MarshalRecord()
|
Method Summary | |
---|---|
void |
add(org.eclipse.persistence.internal.helper.DatabaseField key,
java.lang.Object value)
INTERNAL: Add the field-value pair to the document. |
void |
addGroupingElement(org.eclipse.persistence.internal.oxm.XPathNode xPathNode)
INTERNAL: If an XPathNode does not have an associated NodeValue then add it to the MarshalRecord as a grouping element. |
protected void |
addPositionalNodes(org.eclipse.persistence.internal.oxm.XPathFragment xPathFragment,
NamespaceResolver namespaceResolver)
|
void |
afterContainmentMarshal(java.lang.Object parent,
java.lang.Object child)
|
abstract void |
attribute(java.lang.String namespaceURI,
java.lang.String localName,
java.lang.String qName,
java.lang.String value)
Receive notification of an attribute. |
void |
attribute(org.eclipse.persistence.internal.oxm.XPathFragment xPathFragment,
NamespaceResolver namespaceResolver,
java.lang.Object value,
javax.xml.namespace.QName schemaType)
Convert the value if necessary and write out the attribute and converted value. |
abstract void |
attribute(org.eclipse.persistence.internal.oxm.XPathFragment xPathFragment,
NamespaceResolver namespaceResolver,
java.lang.String value)
Receive notification of an attribute. |
void |
beforeContainmentMarshal(java.lang.Object child)
|
abstract void |
cdata(java.lang.String value)
Receive notification of character data to be wrapped in a CDATA node. |
void |
characters(javax.xml.namespace.QName schemaType,
java.lang.Object value,
java.lang.String mimeType,
boolean isCDATA)
Convert the value if necessary and write out the converted value. |
abstract void |
characters(java.lang.String value)
Receive notification of character data. |
void |
clear()
PUBLIC: Clear the sub-nodes of the DOM. |
abstract void |
closeStartElement()
Receive notification that all of the attribute events have occurred for the most recent element that has been started. |
void |
closeStartGroupingElements(org.eclipse.persistence.internal.oxm.XPathFragment groupingFragment)
|
void |
defaultNamespaceDeclaration(java.lang.String defaultNamespace)
Add the defaultNamespace declaration |
abstract void |
element(org.eclipse.persistence.internal.oxm.XPathFragment frag)
Receive notification of an element. |
void |
emptyAttribute(org.eclipse.persistence.internal.oxm.XPathFragment xPathFragment,
NamespaceResolver namespaceResolver)
Used when an nil attribute should be written |
boolean |
emptyCollection(org.eclipse.persistence.internal.oxm.XPathFragment xPathFragment,
NamespaceResolver namespaceResolver,
boolean openGrouping)
Handle marshal of an empty collection. |
void |
emptyComplex(org.eclipse.persistence.internal.oxm.XPathFragment xPathFragment,
NamespaceResolver namespaceResolver)
Used when an nil attribute should be written |
void |
emptySimple(NamespaceResolver namespaceResolver)
Used when an nil attribute should be written |
void |
endCollection()
This method is used to inform the MarshalRecord that it is done receiving element events that are part of a collection. |
abstract void |
endDocument()
Recieve notification that a document is being ended. |
abstract void |
endElement(org.eclipse.persistence.internal.oxm.XPathFragment xPathFragment,
NamespaceResolver namespaceResolver)
Receive notification that an element is being ended. |
void |
endPrefixMapping(java.lang.String prefix)
Receive notification that the scope of this namespace declaration has ended. |
void |
endPrefixMappings(NamespaceResolver namespaceResolver)
|
MarshalRecord.CycleDetectionStack<java.lang.Object> |
getCycleDetectionStack()
INTERNAL |
org.w3c.dom.Document |
getDocument()
PUBLIC: Return the document. |
org.w3c.dom.Element |
getDOM()
PUBLIC: Return the DOM. |
java.util.ArrayList<org.eclipse.persistence.internal.oxm.XPathNode> |
getGroupingElements()
INTERNAL: Returns the list of grouping elements currently stored on the MarshalRecord |
java.lang.String |
getLocalName()
PUBLIC: Get the local name of the context root element. |
protected java.lang.String |
getNameForFragment(org.eclipse.persistence.internal.oxm.XPathFragment xPathFragment)
|
protected byte[] |
getNameForFragmentBytes(org.eclipse.persistence.internal.oxm.XPathFragment xPathFragment)
|
java.lang.String |
getNamespaceURI()
PUBLIC: Get the namespace URI for the context root element. |
java.util.HashMap |
getPositionalNodes()
|
protected java.lang.String |
getPrefixForFragment(org.eclipse.persistence.internal.oxm.XPathFragment xPathFragment)
|
protected java.lang.String |
getStringForQName(javax.xml.namespace.QName qName)
|
org.eclipse.persistence.internal.oxm.XPathFragment |
getTextWrapperFragment()
INTERNAL: The optional fragment used to wrap the text() mappings |
java.lang.String |
getValueToWrite(javax.xml.namespace.QName schemaType,
java.lang.Object value,
org.eclipse.persistence.internal.oxm.XMLConversionManager xmlConversionManager)
|
boolean |
isWrapperAsCollectionName()
|
void |
marshalWithoutRootElement(org.eclipse.persistence.internal.oxm.TreeObjectBuilder treeObjectBuilder,
java.lang.Object object,
XMLDescriptor descriptor,
XMLRoot root,
boolean isXMLRoot)
|
void |
namespaceDeclaration(java.lang.String prefix,
java.lang.String namespaceURI)
Add the specified namespace declaration |
void |
namespaceDeclarations(NamespaceResolver namespaceResolver)
INTERNAL: Add the namespace declarations to the XML document. |
void |
nilComplex(org.eclipse.persistence.internal.oxm.XPathFragment xPathFragment,
NamespaceResolver namespaceResolver)
Used when an nil attribute should be written |
void |
nilSimple(NamespaceResolver namespaceResolver)
Used when an nil attribute should be written |
void |
node(org.w3c.dom.Node node,
NamespaceResolver resolver)
Receive notification of a node. |
abstract void |
node(org.w3c.dom.Node node,
NamespaceResolver resolver,
java.lang.String qualifiedName,
java.lang.String rootUri)
Receive notification of a node. |
void |
openStartElement(org.eclipse.persistence.internal.oxm.XPathFragment xPathFragment,
NamespaceResolver namespaceResolver)
Receive notification that an element is being started. |
org.eclipse.persistence.internal.oxm.XPathFragment |
openStartGroupingElements(NamespaceResolver namespaceResolver)
INTERNAL: Trigger that the grouping elements should be written. |
void |
predicateAttribute(org.eclipse.persistence.internal.oxm.XPathFragment xPathFragment,
NamespaceResolver namespaceResolver)
Marshal the attribute for the predicate if one was specified. |
protected java.lang.String |
processNamespaceResolverForXSIPrefix(NamespaceResolver namespaceResolver)
INTERNAL: Private function to process or create an entry in the NamespaceResolver for the xsi prefix. |
java.lang.Object |
put(org.eclipse.persistence.internal.helper.DatabaseField key,
java.lang.Object value)
INTERNAL: Add the field-value pair to the document. |
void |
removeGroupingElement(org.eclipse.persistence.internal.oxm.XPathNode xPathNode)
INTERNAL: |
void |
setGroupingElement(java.util.ArrayList<org.eclipse.persistence.internal.oxm.XPathNode> elements)
INTERNAL: Sets the list of grouping elements to be marshalled on this record. |
void |
setSession(org.eclipse.persistence.internal.sessions.AbstractSession session)
|
void |
startCollection()
This method is used to inform the MarshalRecord that the element events it is about to receive are part of a collection. |
abstract void |
startDocument(java.lang.String encoding,
java.lang.String version)
Receive notification that a document is being started. |
void |
startPrefixMapping(java.lang.String prefix,
java.lang.String namespaceURI)
Receive notification that a namespace has been declared. |
void |
startPrefixMappings(NamespaceResolver namespaceResolver)
|
java.lang.String |
transformToXML()
Return the XML string representation of the DOM. |
void |
writeHeader()
INTERNAL Writes the header, if appropriate. |
Methods inherited from class org.eclipse.persistence.internal.sessions.AbstractRecord |
---|
clone, containsKey, containsKey, containsKey, containsValue, elements, entrySet, get, getField, getFields, getIndicatingNoEntry, getLookupField, getValues, getValues, getValues, hasNullValueInFields, isEmpty, keys, keySet, mergeFrom, put, putAll, remove, remove, remove, replaceAt, resetSize, setFields, setNullValueInFields, setValues, size, toString, values |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Map |
---|
equals, hashCode |
Field Detail |
---|
protected org.eclipse.persistence.internal.oxm.XPathFragment textWrapperFragment
protected static final java.lang.String COLON_W_SCHEMA_NIL_ATTRIBUTE
protected static final java.lang.String TRUE
Constructor Detail |
---|
public MarshalRecord()
Method Detail |
---|
public java.util.HashMap getPositionalNodes()
public java.lang.String getLocalName()
XMLRecord
getLocalName
in class XMLRecord
public java.lang.String getNamespaceURI()
XMLRecord
getNamespaceURI
in class XMLRecord
public void clear()
XMLRecord
clear
in interface java.util.Map
clear
in class XMLRecord
public org.w3c.dom.Document getDocument()
XMLRecord
getDocument
in class XMLRecord
public org.w3c.dom.Element getDOM()
XMLRecord
getDOM
in class XMLRecord
public void addGroupingElement(org.eclipse.persistence.internal.oxm.XPathNode xPathNode)
xPathNode
- public void removeGroupingElement(org.eclipse.persistence.internal.oxm.XPathNode xPathNode)
xPathNode
- public java.lang.String transformToXML()
XMLRecord
transformToXML
in class XMLRecord
public void setSession(org.eclipse.persistence.internal.sessions.AbstractSession session)
setSession
in class XMLRecord
public void add(org.eclipse.persistence.internal.helper.DatabaseField key, java.lang.Object value)
add
in class org.eclipse.persistence.internal.sessions.AbstractRecord
public java.lang.Object put(org.eclipse.persistence.internal.helper.DatabaseField key, java.lang.Object value)
put
in class org.eclipse.persistence.internal.sessions.AbstractRecord
public void namespaceDeclarations(NamespaceResolver namespaceResolver)
namespaceResolver
- The NamespaceResolver contains the namespace
prefix and URI pairings that need to be declared.public boolean emptyCollection(org.eclipse.persistence.internal.oxm.XPathFragment xPathFragment, NamespaceResolver namespaceResolver, boolean openGrouping)
xPathFragment
- namespaceResolver
- openGrouping
- if grouping elements should be marshalled for empty collections
public void namespaceDeclaration(java.lang.String prefix, java.lang.String namespaceURI)
namespaceDeclaration
in class XMLRecord
prefix
- namespaceURI
- public void defaultNamespaceDeclaration(java.lang.String defaultNamespace)
defaultNamespace
- public abstract void startDocument(java.lang.String encoding, java.lang.String version)
encoding
- The XML document will be encoded using this encoding.version
- This specifies the version of XML.public void writeHeader()
public abstract void endDocument()
public void marshalWithoutRootElement(org.eclipse.persistence.internal.oxm.TreeObjectBuilder treeObjectBuilder, java.lang.Object object, XMLDescriptor descriptor, XMLRoot root, boolean isXMLRoot)
public void startPrefixMapping(java.lang.String prefix, java.lang.String namespaceURI)
prefix
- The namespace prefix.namespaceURI
- The namespace URI.public void startPrefixMappings(NamespaceResolver namespaceResolver)
public void endPrefixMapping(java.lang.String prefix)
prefix
- The namespace prefix.public void endPrefixMappings(NamespaceResolver namespaceResolver)
public void openStartElement(org.eclipse.persistence.internal.oxm.XPathFragment xPathFragment, NamespaceResolver namespaceResolver)
xPathFragment
- The XPathFragment contains the name and prefix
information about the XML element being ended.namespaceResolver
- The NamespaceResolver can be used to resolve the
namespace URI for the namespace prefix held by the XPathFragment (if
required).public abstract void element(org.eclipse.persistence.internal.oxm.XPathFragment frag)
frag
- The XPathFragment of the elementpublic abstract void attribute(org.eclipse.persistence.internal.oxm.XPathFragment xPathFragment, NamespaceResolver namespaceResolver, java.lang.String value)
xPathFragment
- The XPathFragment contains the name and prefix
information about the XML element being ended.namespaceResolver
- The NamespaceResolver can be used to resolve the
namespace URI for the namespace prefix held by the XPathFragment (if
required).value
- This is the complete value for the attribute.public abstract void attribute(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName, java.lang.String value)
attribute
in class XMLRecord
namespaceURI
- The namespace URI, if the attribute is not namespace
qualified the value of this parameter wil be null.localName
- The local name of the attribute.qName
- The qualified name of the attribute.value
- This is the complete value for the attribute.public abstract void closeStartElement()
public abstract void endElement(org.eclipse.persistence.internal.oxm.XPathFragment xPathFragment, NamespaceResolver namespaceResolver)
xPathFragment
- The XPathFragment contains the name and prefix
information about the XML element being ended.namespaceResolver
- The NamespaceResolver can be used to resolve the
namespace URI for the namespace prefix held by the XPathFragment (if
required).public abstract void characters(java.lang.String value)
value
- This is the entire value of the text node.public void attribute(org.eclipse.persistence.internal.oxm.XPathFragment xPathFragment, NamespaceResolver namespaceResolver, java.lang.Object value, javax.xml.namespace.QName schemaType)
public void characters(javax.xml.namespace.QName schemaType, java.lang.Object value, java.lang.String mimeType, boolean isCDATA)
public java.lang.String getValueToWrite(javax.xml.namespace.QName schemaType, java.lang.Object value, org.eclipse.persistence.internal.oxm.XMLConversionManager xmlConversionManager)
protected java.lang.String getStringForQName(javax.xml.namespace.QName qName)
public abstract void cdata(java.lang.String value)
value
- This is the value of the text to be wrappedpublic void node(org.w3c.dom.Node node, NamespaceResolver resolver)
node
- The Node to be added to the documentnamespaceResolver
- The NamespaceResolver can be used to resolve the
namespace URI/prefix of the nodepublic abstract void node(org.w3c.dom.Node node, NamespaceResolver resolver, java.lang.String qualifiedName, java.lang.String rootUri)
node
- The Node to be added to the documentnamespaceResolver
- The NamespaceResolver can be used to resolve thename
- replacement root name for the noderootUri
- replacement root namespace for the node
namespace URI/prefix of the nodepublic org.eclipse.persistence.internal.oxm.XPathFragment openStartGroupingElements(NamespaceResolver namespaceResolver)
namespaceResolver
- The NamespaceResolver can be used to resolve the
namespace URI for the namespace prefix held by the XPathFragment (if
required).public void closeStartGroupingElements(org.eclipse.persistence.internal.oxm.XPathFragment groupingFragment)
protected void addPositionalNodes(org.eclipse.persistence.internal.oxm.XPathFragment xPathFragment, NamespaceResolver namespaceResolver)
public void beforeContainmentMarshal(java.lang.Object child)
public void afterContainmentMarshal(java.lang.Object parent, java.lang.Object child)
public java.util.ArrayList<org.eclipse.persistence.internal.oxm.XPathNode> getGroupingElements()
public void setGroupingElement(java.util.ArrayList<org.eclipse.persistence.internal.oxm.XPathNode> elements)
public void predicateAttribute(org.eclipse.persistence.internal.oxm.XPathFragment xPathFragment, NamespaceResolver namespaceResolver)
public void startCollection()
endCollection
public void emptyAttribute(org.eclipse.persistence.internal.oxm.XPathFragment xPathFragment, NamespaceResolver namespaceResolver)
public void emptyComplex(org.eclipse.persistence.internal.oxm.XPathFragment xPathFragment, NamespaceResolver namespaceResolver)
public void emptySimple(NamespaceResolver namespaceResolver)
public void nilSimple(NamespaceResolver namespaceResolver)
public void nilComplex(org.eclipse.persistence.internal.oxm.XPathFragment xPathFragment, NamespaceResolver namespaceResolver)
public void endCollection()
startCollection
protected java.lang.String processNamespaceResolverForXSIPrefix(NamespaceResolver namespaceResolver)
namespaceResolver
-
public org.eclipse.persistence.internal.oxm.XPathFragment getTextWrapperFragment()
protected java.lang.String getNameForFragment(org.eclipse.persistence.internal.oxm.XPathFragment xPathFragment)
protected byte[] getNameForFragmentBytes(org.eclipse.persistence.internal.oxm.XPathFragment xPathFragment)
protected java.lang.String getPrefixForFragment(org.eclipse.persistence.internal.oxm.XPathFragment xPathFragment)
public MarshalRecord.CycleDetectionStack<java.lang.Object> getCycleDetectionStack()
public boolean isWrapperAsCollectionName()
|
EclipseLink 2.4.2, build 'v20130514-5956486' API Reference | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |