public abstract class AbstractNullPolicy
extends java.lang.Object
Null policies have 2 concrete implementations:
Unmarshal Flag | Description |
---|---|
isSetPerformedForAbsentNode | This umarshal flag represents whether a set is done for absent nodes only. |
isNullRepresentedByEmptyNode | If this unmarshal flag is false for empty nodes we set an empty Object for composite mappings, otherwise we set to null. |
isNullRepresentedByXsiNil | If this unmarshal flag is false for xsi:nil nodes we ignore
the xsi:nil attribute and treat as an empty node. Otherwise we set to null. |
Marshal Enum | XMLNullRepresentationType Description |
---|---|
XSI_NIL | Nillable: Write out an xsi:nil="true" attribute. |
ABSENT_NODE(default) | Optional: Write out no node. |
EMPTY_NODE | Required: Write out an empty <node/> or node="" node. |
NullCapableValue
Constructor and Description |
---|
AbstractNullPolicy() |
Modifier and Type | Method and Description |
---|---|
boolean |
compositeObjectMarshal(org.eclipse.persistence.internal.oxm.record.AbstractMarshalRecord record,
java.lang.Object object,
org.eclipse.persistence.internal.oxm.mappings.Field field,
org.eclipse.persistence.internal.core.sessions.CoreAbstractSession session)
INTERNAL: When using the DOM Platform, this method is responsible for
marshalling null values for the XML Composite Object Mapping.
|
boolean |
compositeObjectMarshal(org.eclipse.persistence.internal.oxm.XPathFragment xPathFragment,
org.eclipse.persistence.internal.oxm.record.MarshalRecord marshalRecord,
java.lang.Object object,
CoreSession session,
org.eclipse.persistence.internal.oxm.NamespaceResolver namespaceResolver)
INTERNAL: When using the SAX Platform, this method is responsible for
marshalling null values for the XML Composite Object Mapping.
|
void |
directMarshal(org.eclipse.persistence.internal.oxm.mappings.Field field,
org.eclipse.persistence.internal.oxm.record.AbstractMarshalRecord record,
java.lang.Object object)
INTERNAL
|
boolean |
directMarshal(org.eclipse.persistence.internal.oxm.XPathFragment xPathFragment,
org.eclipse.persistence.internal.oxm.record.MarshalRecord marshalRecord,
java.lang.Object object,
CoreSession session,
org.eclipse.persistence.internal.oxm.NamespaceResolver namespaceResolver)
INTERNAL:
When using the SAX or DOM Platform, this method is responsible for
marshalling null values for the XML Direct Mapping.
|
boolean |
getIsSetPerformedForAbsentNode() |
XMLNullRepresentationType |
getMarshalNullRepresentation()
Get the enum that determines what XML to write when a null value is encountered.
|
boolean |
ignoreAttributesForNil() |
boolean |
isNullRepresentedByEmptyNode() |
boolean |
isNullRepresentedByXsiNil() |
void |
setIgnoreAttributesForNil(boolean ignoreAttributesForNil) |
void |
setMarshalNullRepresentation(XMLNullRepresentationType anEnumInstance)
Set the enum that determines what XML to write when a null value is encountered.
|
void |
setNullRepresentedByEmptyNode(boolean bIsNullRepresentedByEmptyNode) |
void |
setNullRepresentedByXsiNil(boolean bIsNullRepresentedByXsiNil) |
boolean |
valueIsNull(org.xml.sax.Attributes attributes)
INTERNAL: When using the SAX or DOM Platform during unmarshal operations.
|
boolean |
valueIsNull(org.w3c.dom.Element element)
INTERNAL: When using the DOM Platform during unmarshal operations.
|
abstract void |
xPathNode(org.eclipse.persistence.internal.oxm.XPathNode xPathNode,
org.eclipse.persistence.internal.oxm.NullCapableValue nullCapableValue)
INTERNAL: When using the SAX Platform this allows a NodeValue to be
registered to receive events from the TreeObjectBuilder.
|
public XMLNullRepresentationType getMarshalNullRepresentation()
public void setMarshalNullRepresentation(XMLNullRepresentationType anEnumInstance)
public boolean directMarshal(org.eclipse.persistence.internal.oxm.XPathFragment xPathFragment, org.eclipse.persistence.internal.oxm.record.MarshalRecord marshalRecord, java.lang.Object object, CoreSession session, org.eclipse.persistence.internal.oxm.NamespaceResolver namespaceResolver)
xPathFragment
- marshalRecord
- object
- session
- namespaceResolver
- public boolean compositeObjectMarshal(org.eclipse.persistence.internal.oxm.XPathFragment xPathFragment, org.eclipse.persistence.internal.oxm.record.MarshalRecord marshalRecord, java.lang.Object object, CoreSession session, org.eclipse.persistence.internal.oxm.NamespaceResolver namespaceResolver)
xPathFragment
- marshalRecord
- object
- session
- namespaceResolver
- public boolean compositeObjectMarshal(org.eclipse.persistence.internal.oxm.record.AbstractMarshalRecord record, java.lang.Object object, org.eclipse.persistence.internal.oxm.mappings.Field field, org.eclipse.persistence.internal.core.sessions.CoreAbstractSession session)
record
- object
- field
- public boolean valueIsNull(org.xml.sax.Attributes attributes)
attributes
- public boolean valueIsNull(org.w3c.dom.Element element)
element
- public abstract void xPathNode(org.eclipse.persistence.internal.oxm.XPathNode xPathNode, org.eclipse.persistence.internal.oxm.NullCapableValue nullCapableValue)
xPathNode
- nullCapableValue
- public boolean getIsSetPerformedForAbsentNode()
public boolean isNullRepresentedByEmptyNode()
public void setNullRepresentedByEmptyNode(boolean bIsNullRepresentedByEmptyNode)
bIsNullRepresentedByEmptyNode
- public boolean isNullRepresentedByXsiNil()
public void setNullRepresentedByXsiNil(boolean bIsNullRepresentedByXsiNil)
bIsNullRepresentedByXsiNil
- public boolean ignoreAttributesForNil()
public void setIgnoreAttributesForNil(boolean ignoreAttributesForNil)
ignoreAttributesForNil
- public void directMarshal(org.eclipse.persistence.internal.oxm.mappings.Field field, org.eclipse.persistence.internal.oxm.record.AbstractMarshalRecord record, java.lang.Object object)