Top Description Inners Fields Constructors Methods
org.eclipse.persistence.oxm.record

public Class NodeRecord

extends MarshalRecord
Class Inheritance
Imports
java.util.HashMap, .Iterator, .Map, org.eclipse.persistence.exceptions.XMLMarshalException, org.eclipse.persistence.internal.oxm.Constants, .MarshalRecordContentHandler, .NamespaceResolver, .XPathFragment, org.eclipse.persistence.internal.oxm.record.XMLFragmentReader, org.eclipse.persistence.platform.xml.XMLPlatform, .XMLPlatformFactory, org.w3c.dom.Attr, .CDATASection, .Comment, .DOMException, .Document, .Element, .EntityReference, .Node, org.xml.sax.Attributes, .SAXException, org.xml.sax.ext.LexicalHandler

Use this type of MarshalRecord when the marshal target is a Node.

XMLContext xmlContext = new XMLContext("session-name");
XMLMarshaller xmlMarshaller = xmlContext.createMarshaller();
NodeRecord nodeRecord = new NodeRecord();
nodeRecord.setDOM(myNode);
xmlMarshaller.marshal(myObject, nodeRecord);

If the marshal(Node) method is called on XMLMarshaller, then the Writer is automatically wrapped in a NodeRecord.

XMLContext xmlContext = new XMLContext("session-name");
XMLMarshaller xmlMarshaller = xmlContext.createMarshaller();
xmlMarshaller.marshal(myObject, myNode);

See Also
org.eclipse.persistence.oxm.XMLMarshaller

Nested and Inner Type Summary

Modifier and TypeClass and Description
protected class
NodeRecord.NodeRecordContentHandler

This class will typically be used in conjunction with an XMLFragmentReader.

Field Summary

Modifier and TypeField and Description
private Document
private Node
Inherited from org.eclipse.persistence.oxm.record.MarshalRecord:
COLON_W_SCHEMA_NIL_ATTRIBUTEtextWrapperFragmentTRUE

Constructor Summary

AccessConstructor and Description
public
NodeRecord()

INTERNAL: Default constructor.

public
NodeRecord(String rootElementName)

INTERNAL: Create a record with the root element name.

public
NodeRecord(String rootElementName, NamespaceResolver namespaceResolver)

INTERNAL: Create a record with the root element name get the namespace URI from the namespaceResolver.

public
NodeRecord(String localRootElementName, Node parent)

INTERNAL: Create a record with the local root element name, that is a child of the parent.

public
NodeRecord(String localRootElementName, NamespaceResolver namespaceResolver, Node parent)

INTERNAL: Create a record with the local root element name, that is a child of the parent.

public
NodeRecord(Node node)

INTERNAL: Create a record with the element.

Method Summary

Modifier and TypeMethod and Description
public void
attribute(XPathFragment<XML_FIELD extends Field>
The XPathFragment contains the name and prefix information about the XML element being ended.
xPathFragment
,
NamespaceResolver
The NamespaceResolver can be used to resolve the namespace URI for the namespace prefix held by the XPathFragment (if required).
namespaceResolver
,
String
This is the complete value for the attribute.
value
)

Implements abstract org.eclipse.persistence.oxm.record.MarshalRecord.attribute.

Implements org.eclipse.persistence.internal.oxm.record.MarshalRecord.attribute.

INTERNAL:
public void
attribute(String
The namespace URI, if the attribute is not namespace qualified the value of this parameter wil be null.
namespaceURI
,
String
The local name of the attribute.
localName
,
String
The qualified name of the attribute.
qName
,
String
This is the complete value for the attribute.
value
)

Implements abstract org.eclipse.persistence.oxm.record.MarshalRecord.attribute.

Implements org.eclipse.persistence.internal.oxm.record.MarshalRecord.attribute, org.eclipse.persistence.internal.oxm.record.AbstractMarshalRecord.attribute.

INTERNAL:
public void
cdata(String
This is the value of the text to be wrapped
value
)

Implements abstract org.eclipse.persistence.oxm.record.MarshalRecord.cdata.

Implements org.eclipse.persistence.internal.oxm.record.MarshalRecord.cdata.

Receive notification of character data to be wrapped in a CDATA node.
public void
public void
public void
public void
element(XPathFragment<XML_FIELD extends Field>
The XPathFragment of the element
frag
)

Implements abstract org.eclipse.persistence.oxm.record.MarshalRecord.element.

INTERNAL:
public void
public void
endElement(XPathFragment<XML_FIELD extends Field>
The XPathFragment contains the name and prefix information about the XML element being ended.
xPathFragment
,
NamespaceResolver
The NamespaceResolver can be used to resolve the namespace URI for the namespace prefix held by the XPathFragment (if required).
namespaceResolver
)

Implements abstract org.eclipse.persistence.oxm.record.MarshalRecord.endElement.

Implements org.eclipse.persistence.internal.oxm.record.MarshalRecord.endElement.

INTERNAL:
public Document
public Node

Returns:

The marshal target.
getDOM
()

Overrides org.eclipse.persistence.oxm.record.MarshalRecord.getDOM.

Implements org.eclipse.persistence.internal.oxm.record.AbstractMarshalRecord.getDOM.

Return the Node that the object will be marshalled to.
public String
public String
public void
node(Node
The Node to be added to the document
node
,
NamespaceResolver
The NamespaceResolver can be used to resolve the
namespaceResolver
,
String
replacement root name for the node
uri
,
String
replacement root namespace for the node namespace URI/prefix of the node
name
)

Implements abstract org.eclipse.persistence.oxm.record.MarshalRecord.node.

Receive notification of a node.
public void
openStartElement(XPathFragment<XML_FIELD extends Field>
The XPathFragment contains the name and prefix information about the XML element being ended.
xPathFragment
,
NamespaceResolver
The NamespaceResolver can be used to resolve the namespace URI for the namespace prefix held by the XPathFragment (if required).
namespaceResolver
)

Overrides org.eclipse.persistence.oxm.record.MarshalRecord.openStartElement.

Implements org.eclipse.persistence.internal.oxm.record.MarshalRecord.openStartElement.

INTERNAL:
private String
resolveNamespace(NamespaceResolver namespaceResolver, String localName)

INTERNAL: Return the namespace uri for the prefix of the given local name

public void
setDOM(Node
The marshal target.
dom
)

Set the Node that the object will be marshalled to.

public void
startDocument(String
The XML document will be encoded using this encoding.
encoding
,
String
This specifies the version of XML.
version
)

Implements abstract org.eclipse.persistence.oxm.record.MarshalRecord.startDocument.

INTERNAL:
public void
startPrefixMappings(NamespaceResolver namespaceResolver)

Overrides org.eclipse.persistence.oxm.record.MarshalRecord.startPrefixMappings.

INTERNAL: override so we don't iterate over namespaces when startPrefixMapping doesn't do anything
public String
Inherited from org.eclipse.persistence.oxm.record.MarshalRecord:
addaddGroupingElementaddPositionalNodesafterContainmentMarshalattributebeforeContainmentMarshalcharacterscloseStartGroupingElementsdefaultNamespaceDeclarationemptyAttributeemptyCollectionemptyComplexemptySimpleendCollectionendPrefixMappingendPrefixMappingsflushforceValueWrappergetCurrentAttributeGroupgetCycleDetectionStackgetGroupingElementsgetNameForFragmentgetPositionalNodesgetPrefixBytesgetPrefixForFragmentgetStringForQNamegetTextWrapperFragmentgetValueToWriteisWrapperAsCollectionNamemarshalWithoutRootElementnamespaceDeclarationnamespaceDeclarationsnilComplexnilSimplenodeopenStartGroupingElementspopAttributeGrouppredicateAttributeprocessNamespaceResolverForXSIPrefixpushAttributeGroupputremoveGroupingElementsetGroupingElementsetSessionsplitCDatastartCollectionstartPrefixMappingwriteHeader

Field Detail

documentback to summary
private Document document
nodeback to summary
private Node node

Constructor Detail

NodeRecordback to summary
public NodeRecord()

INTERNAL: Default constructor.

NodeRecordback to summary
public NodeRecord(String rootElementName)

INTERNAL: Create a record with the root element name.

NodeRecordback to summary
public NodeRecord(String rootElementName, NamespaceResolver namespaceResolver)

INTERNAL: Create a record with the root element name get the namespace URI from the namespaceResolver.

NodeRecordback to summary
public NodeRecord(String localRootElementName, Node parent)

INTERNAL: Create a record with the local root element name, that is a child of the parent.

NodeRecordback to summary
public NodeRecord(String localRootElementName, NamespaceResolver namespaceResolver, Node parent)

INTERNAL: Create a record with the local root element name, that is a child of the parent. Lookup the namespace URI from the namespaceResolver.

NodeRecordback to summary
public NodeRecord(Node node)

INTERNAL: Create a record with the element.

Method Detail

attributeback to summary
public void attribute(XPathFragment<XML_FIELD extends Field> xPathFragment, NamespaceResolver namespaceResolver, String value)

Implements abstract org.eclipse.persistence.oxm.record.MarshalRecord.attribute.

Implements org.eclipse.persistence.internal.oxm.record.MarshalRecord.attribute.

INTERNAL:

Parameters
xPathFragment:XPathFragment<XML_FIELD extends Field>

Doc from org.eclipse.persistence.oxm.record.MarshalRecord.attribute.

The XPathFragment contains the name and prefix information about the XML element being ended.

namespaceResolver:NamespaceResolver

Doc from org.eclipse.persistence.oxm.record.MarshalRecord.attribute.

The NamespaceResolver can be used to resolve the namespace URI for the namespace prefix held by the XPathFragment (if required).

value:String

Doc from org.eclipse.persistence.oxm.record.MarshalRecord.attribute.

This is the complete value for the attribute.

Annotations
@Override
attributeback to summary
public void attribute(String namespaceURI, String localName, String qName, String value)

Implements abstract org.eclipse.persistence.oxm.record.MarshalRecord.attribute.

Implements org.eclipse.persistence.internal.oxm.record.MarshalRecord.attribute, org.eclipse.persistence.internal.oxm.record.AbstractMarshalRecord.attribute.

INTERNAL:

Parameters
namespaceURI:String

Doc from org.eclipse.persistence.oxm.record.MarshalRecord.attribute.

The namespace URI, if the attribute is not namespace qualified the value of this parameter wil be null.

localName:String

Doc from org.eclipse.persistence.oxm.record.MarshalRecord.attribute.

The local name of the attribute.

qName:String

Doc from org.eclipse.persistence.oxm.record.MarshalRecord.attribute.

The qualified name of the attribute.

value:String

Doc from org.eclipse.persistence.oxm.record.MarshalRecord.attribute.

This is the complete value for the attribute.

Annotations
@Override
cdataback to summary
public void cdata(String value)

Implements abstract org.eclipse.persistence.oxm.record.MarshalRecord.cdata.

Implements org.eclipse.persistence.internal.oxm.record.MarshalRecord.cdata.

Doc from org.eclipse.persistence.oxm.record.MarshalRecord.cdata.

Receive notification of character data to be wrapped in a CDATA node.

Parameters
value:String

This is the value of the text to be wrapped

Annotations
@Override
charactersback to summary
public void characters(String value)

Implements abstract org.eclipse.persistence.oxm.record.MarshalRecord.characters.

Implements org.eclipse.persistence.internal.oxm.record.MarshalRecord.characters.

INTERNAL:

Parameters
value:String

Doc from org.eclipse.persistence.oxm.record.MarshalRecord.characters.

This is the entire value of the text node.

Annotations
@Override
clearback to summary
public void clear()

Overrides org.eclipse.persistence.oxm.record.MarshalRecord.clear.

Annotations
@Override
closeStartElementback to summary
public void closeStartElement()

Implements abstract org.eclipse.persistence.oxm.record.MarshalRecord.closeStartElement.

Implements org.eclipse.persistence.internal.oxm.record.MarshalRecord.closeStartElement.

INTERNAL:

Annotations
@Override
elementback to summary
public void element(XPathFragment<XML_FIELD extends Field> frag)

Implements abstract org.eclipse.persistence.oxm.record.MarshalRecord.element.

INTERNAL:

Parameters
frag:XPathFragment<XML_FIELD extends Field>

Doc from org.eclipse.persistence.oxm.record.MarshalRecord.element.

The XPathFragment of the element

Annotations
@Override
endDocumentback to summary
public void endDocument()

Implements abstract org.eclipse.persistence.oxm.record.MarshalRecord.endDocument.

INTERNAL:

Annotations
@Override
endElementback to summary
public void endElement(XPathFragment<XML_FIELD extends Field> xPathFragment, NamespaceResolver namespaceResolver)

Implements abstract org.eclipse.persistence.oxm.record.MarshalRecord.endElement.

Implements org.eclipse.persistence.internal.oxm.record.MarshalRecord.endElement.

INTERNAL:

Parameters
xPathFragment:XPathFragment<XML_FIELD extends Field>

Doc from org.eclipse.persistence.oxm.record.MarshalRecord.endElement.

The XPathFragment contains the name and prefix information about the XML element being ended.

namespaceResolver:NamespaceResolver

Doc from org.eclipse.persistence.oxm.record.MarshalRecord.endElement.

The NamespaceResolver can be used to resolve the namespace URI for the namespace prefix held by the XPathFragment (if required).

Annotations
@Override
getDocumentback to summary
public Document getDocument()

Overrides org.eclipse.persistence.oxm.record.MarshalRecord.getDocument.

Annotations
@Override
getDOMback to summary
public Node getDOM()

Overrides org.eclipse.persistence.oxm.record.MarshalRecord.getDOM.

Implements org.eclipse.persistence.internal.oxm.record.AbstractMarshalRecord.getDOM.

Return the Node that the object will be marshalled to.

Returns:Node

The marshal target.

Annotations
@Override
getLocalNameback to summary
public String getLocalName()

Overrides org.eclipse.persistence.oxm.record.MarshalRecord.getLocalName.

Annotations
@Override
getNamespaceURIback to summary
public String getNamespaceURI()

Overrides org.eclipse.persistence.oxm.record.MarshalRecord.getNamespaceURI.

Annotations
@Override
nodeback to summary
public void node(Node node, NamespaceResolver namespaceResolver, String uri, String name)

Implements abstract org.eclipse.persistence.oxm.record.MarshalRecord.node.

Doc from org.eclipse.persistence.oxm.record.MarshalRecord.node.

Receive notification of a node.

Parameters
node:Node

The Node to be added to the document

namespaceResolver:NamespaceResolver

The NamespaceResolver can be used to resolve the

uri:String

replacement root name for the node

name:String

replacement root namespace for the node namespace URI/prefix of the node

Annotations
@Override
openStartElementback to summary
public void openStartElement(XPathFragment<XML_FIELD extends Field> xPathFragment, NamespaceResolver namespaceResolver)

Overrides org.eclipse.persistence.oxm.record.MarshalRecord.openStartElement.

Implements org.eclipse.persistence.internal.oxm.record.MarshalRecord.openStartElement.

INTERNAL:

Parameters
xPathFragment:XPathFragment<XML_FIELD extends Field>

Doc from org.eclipse.persistence.oxm.record.MarshalRecord.openStartElement.

The XPathFragment contains the name and prefix information about the XML element being ended.

namespaceResolver:NamespaceResolver

Doc from org.eclipse.persistence.oxm.record.MarshalRecord.openStartElement.

The NamespaceResolver can be used to resolve the namespace URI for the namespace prefix held by the XPathFragment (if required).

Annotations
@Override
resolveNamespaceback to summary
private String resolveNamespace(NamespaceResolver namespaceResolver, String localName)

INTERNAL: Return the namespace uri for the prefix of the given local name

setDOMback to summary
public void setDOM(Node dom)

Set the Node that the object will be marshalled to.

Parameters
dom:Node

The marshal target.

startDocumentback to summary
public void startDocument(String encoding, String version)

Implements abstract org.eclipse.persistence.oxm.record.MarshalRecord.startDocument.

INTERNAL:

Parameters
encoding:String

Doc from org.eclipse.persistence.oxm.record.MarshalRecord.startDocument.

The XML document will be encoded using this encoding.

version:String

Doc from org.eclipse.persistence.oxm.record.MarshalRecord.startDocument.

This specifies the version of XML.

Annotations
@Override
startPrefixMappingsback to summary
public void startPrefixMappings(NamespaceResolver namespaceResolver)

Overrides org.eclipse.persistence.oxm.record.MarshalRecord.startPrefixMappings.

INTERNAL: override so we don't iterate over namespaces when startPrefixMapping doesn't do anything

Annotations
@Override
transformToXMLback to summary
public String transformToXML()

Overrides org.eclipse.persistence.oxm.record.MarshalRecord.transformToXML.

Annotations
@Override
org.eclipse.persistence.oxm.record back to summary

protected Class NodeRecord.NodeRecordContentHandler

extends MarshalRecordContentHandler
implements LexicalHandler
Class Inheritance
All Implemented Interfaces
org.xml.sax.ext.LexicalHandler

This class will typically be used in conjunction with an XMLFragmentReader. The XMLFragmentReader will walk a given XMLFragment node and report events to this class - the event's data is then used to create required attributes and elements which are appended to the the enclosing class' document.
See Also
org.eclipse.persistence.internal.oxm.record.XMLFragmentReader

Field Summary

Modifier and TypeField and Description
pack-priv Map<String, String>
Inherited from org.eclipse.persistence.internal.oxm.MarshalRecordContentHandler:
marshalRecordresolver

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
comment(char[]
An array holding the characters in the comment.
ch
,
int
The starting position in the array.
start
,
int
The number of characters to use from the array.
length
)

Implements org.xml.sax.ext.LexicalHandler.comment.

Report an XML comment anywhere in the document.
public void
endCDATA()

Implements org.xml.sax.ext.LexicalHandler.endCDATA.

Report the end of a CDATA section.
public void
endDTD()

Implements org.xml.sax.ext.LexicalHandler.endDTD.

Report the end of DTD declarations.
public void
endEntity(String
The name of the entity that is ending.
name
)

Implements org.xml.sax.ext.LexicalHandler.endEntity.

Report the end of an entity.
public void
startCDATA()

Implements org.xml.sax.ext.LexicalHandler.startCDATA.

Report the start of a CDATA section.
public void
startDTD(String
The document type name.
name
,
String
The declared public identifier for the external DTD subset, or null if none was declared.
publicId
,
String
The declared system identifier for the external DTD subset, or null if none was declared. (Note that this is not resolved against the document base URI.)
systemId
)

Implements org.xml.sax.ext.LexicalHandler.startDTD.

Report the start of DTD declarations, if any.
public void
startElement(String
the Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed
namespaceURI
,
String
the local name (without prefix), or the empty string if Namespace processing is not being performed
localName
,
String
the qualified name (with prefix), or the empty string if qualified names are not available
qName
,
Attributes
the attributes attached to the element. If there are no attributes, it shall be an empty Attributes object. The value of this object after startElement returns is undefined
atts
)

Overrides org.eclipse.persistence.internal.oxm.MarshalRecordContentHandler.startElement.

Implements org.xml.sax.ContentHandler.startElement.

Receive notification of the beginning of an element.
public void
startEntity(String
The name of the entity. If it is a parameter entity, the name will begin with '%', and if it is the external DTD subset, it will be "[dtd]".
name
)

Implements org.xml.sax.ext.LexicalHandler.startEntity.

Report the beginning of some internal and external XML entities.
public void
startPrefixMapping(String
the Namespace prefix being declared. An empty string is used for the default element namespace, which has no prefix.
prefix
,
String
the Namespace URI the prefix is mapped to
uri
)

Overrides org.eclipse.persistence.internal.oxm.MarshalRecordContentHandler.startPrefixMapping.

Implements org.xml.sax.ContentHandler.startPrefixMapping.

Begin the scope of a prefix-URI Namespace mapping.
Inherited from org.eclipse.persistence.internal.oxm.MarshalRecordContentHandler:
characterscharactersendDocumentendElementendPrefixMappinggetMarshalRecordignorableWhitespaceprocessingInstructionsetDocumentLocatorsetMarshalRecordsetNilskippedEntitystartDocument

Field Detail

prefixMappingsback to summary
pack-priv Map<String, String> prefixMappings

Constructor Detail

NodeRecordContentHandlerback to summary
public NodeRecordContentHandler(NodeRecord nRec, NamespaceResolver resolver)

Method Detail

commentback to summary
public void comment(char[] ch, int start, int length) throws SAXException

Implements org.xml.sax.ext.LexicalHandler.comment.

Doc from org.xml.sax.ext.LexicalHandler.comment.

Report an XML comment anywhere in the document.

This callback will be used for comments inside or outside the document element, including comments in the external DTD subset (if read). Comments in the DTD must be properly nested inside start/endDTD and start/endEntity events (if used).

Parameters
ch:char[]

An array holding the characters in the comment.

start:int

The starting position in the array.

length:int

The number of characters to use from the array.

Annotations
@Override
Exceptions
SAXException:
The application may raise an exception.
endCDATAback to summary
public void endCDATA() throws SAXException

Implements org.xml.sax.ext.LexicalHandler.endCDATA.

Doc from org.xml.sax.ext.LexicalHandler.endCDATA.

Report the end of a CDATA section.

Annotations
@Override
Exceptions
SAXException:
The application may raise an exception.
endDTDback to summary
public void endDTD() throws SAXException

Implements org.xml.sax.ext.LexicalHandler.endDTD.

Doc from org.xml.sax.ext.LexicalHandler.endDTD.

Report the end of DTD declarations.

This method is intended to report the end of the DOCTYPE declaration; if the document has no DOCTYPE declaration, this method will not be invoked.

Annotations
@Override
Exceptions
SAXException:
The application may raise an exception.
endEntityback to summary
public void endEntity(String name) throws SAXException

Implements org.xml.sax.ext.LexicalHandler.endEntity.

Doc from org.xml.sax.ext.LexicalHandler.endEntity.

Report the end of an entity.

Parameters
name:String

The name of the entity that is ending.

Annotations
@Override
Exceptions
SAXException:
The application may raise an exception.
startCDATAback to summary
public void startCDATA() throws SAXException

Implements org.xml.sax.ext.LexicalHandler.startCDATA.

Doc from org.xml.sax.ext.LexicalHandler.startCDATA.

Report the start of a CDATA section.

The contents of the CDATA section will be reported through the regular characters event; this event is intended only to report the boundary.

Annotations
@Override
Exceptions
SAXException:
The application may raise an exception.
startDTDback to summary
public void startDTD(String name, String publicId, String systemId) throws SAXException

Implements org.xml.sax.ext.LexicalHandler.startDTD.

Doc from org.xml.sax.ext.LexicalHandler.startDTD.

Report the start of DTD declarations, if any.

This method is intended to report the beginning of the DOCTYPE declaration; if the document has no DOCTYPE declaration, this method will not be invoked.

All declarations reported through DTDHandler or DeclHandler events must appear between the startDTD and endDTD events. Declarations are assumed to belong to the internal DTD subset unless they appear between startEntity and endEntity events. Comments and processing instructions from the DTD should also be reported between the startDTD and endDTD events, in their original order of (logical) occurrence; they are not required to appear in their correct locations relative to DTDHandler or DeclHandler events, however.

Note that the start/endDTD events will appear within the start/endDocument events from ContentHandler and before the first startElement event.

Parameters
name:String

The document type name.

publicId:String

The declared public identifier for the external DTD subset, or null if none was declared.

systemId:String

The declared system identifier for the external DTD subset, or null if none was declared. (Note that this is not resolved against the document base URI.)

Annotations
@Override
Exceptions
SAXException:
The application may raise an exception.
startElementback to summary
public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException

Overrides org.eclipse.persistence.internal.oxm.MarshalRecordContentHandler.startElement.

Implements org.xml.sax.ContentHandler.startElement.

Doc from org.xml.sax.ContentHandler.startElement.

Receive notification of the beginning of an element.

The Parser will invoke this method at the beginning of every element in the XML document; there will be a corresponding endElement event for every startElement event (even when the element is empty). All of the element's content will be reported, in order, before the corresponding endElement event.

This event allows up to three name components for each element:

  1. the Namespace URI;
  2. the local name; and
  3. the qualified (prefixed) name.

Any or all of these may be provided, depending on the values of the http://xml.org/sax/features/namespaces and the http://xml.org/sax/features/namespace-prefixes properties:

  • the Namespace URI and local name are required when the namespaces property is true (the default), and are optional when the namespaces property is false (if one is specified, both must be);
  • the qualified name is required when the namespace-prefixes property is true, and is optional when the namespace-prefixes property is false (the default).

Note that the attribute list provided will contain only attributes with explicit values (specified or defaulted): #IMPLIED attributes will be omitted. The attribute list will contain attributes used for Namespace declarations (xmlns* attributes) only if the http://xml.org/sax/features/namespace-prefixes property is true (it is false by default, and support for a true value is optional).

Like characters(), attribute values may have characters that need more than one char value.

Parameters
namespaceURI:String

the Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed

localName:String

the local name (without prefix), or the empty string if Namespace processing is not being performed

qName:String

the qualified name (with prefix), or the empty string if qualified names are not available

atts:Attributes

the attributes attached to the element. If there are no attributes, it shall be an empty Attributes object. The value of this object after startElement returns is undefined

Annotations
@Override
Exceptions
SAXException:
any SAX exception, possibly wrapping another exception
startEntityback to summary
public void startEntity(String name) throws SAXException

Implements org.xml.sax.ext.LexicalHandler.startEntity.

Doc from org.xml.sax.ext.LexicalHandler.startEntity.

Report the beginning of some internal and external XML entities.

The reporting of parameter entities (including the external DTD subset) is optional, and SAX2 drivers that report LexicalHandler events may not implement it; you can use the http://xml.org/sax/features/lexical-handler/parameter-entities feature to query or control the reporting of parameter entities.

General entities are reported with their regular names, parameter entities have '%' prepended to their names, and the external DTD subset has the pseudo-entity name "[dtd]".

When a SAX2 driver is providing these events, all other events must be properly nested within start/end entity events. There is no additional requirement that events from DeclHandler or DTDHandler be properly ordered.

Note that skipped entities will be reported through the skippedEntity event, which is part of the ContentHandler interface.

Because of the streaming event model that SAX uses, some entity boundaries cannot be reported under any circumstances:

  • general entities within attribute values
  • parameter entities within declarations

These will be silently expanded, with no indication of where the original entity boundaries were.

Note also that the boundaries of character references (which are not really entities anyway) are not reported.

All start/endEntity events must be properly nested.

Parameters
name:String

The name of the entity. If it is a parameter entity, the name will begin with '%', and if it is the external DTD subset, it will be "[dtd]".

Annotations
@Override
Exceptions
SAXException:
The application may raise an exception.
startPrefixMappingback to summary
public void startPrefixMapping(String prefix, String uri) throws SAXException

Overrides org.eclipse.persistence.internal.oxm.MarshalRecordContentHandler.startPrefixMapping.

Implements org.xml.sax.ContentHandler.startPrefixMapping.

Doc from org.xml.sax.ContentHandler.startPrefixMapping.

Begin the scope of a prefix-URI Namespace mapping.

The information from this event is not necessary for normal Namespace processing: the SAX XML reader will automatically replace prefixes for element and attribute names when the http://xml.org/sax/features/namespaces feature is true (the default).

There are cases, however, when applications need to use prefixes in character data or in attribute values, where they cannot safely be expanded automatically; the start/endPrefixMapping event supplies the information to the application to expand prefixes in those contexts itself, if necessary.

Note that start/endPrefixMapping events are not guaranteed to be properly nested relative to each other: all startPrefixMapping events will occur immediately before the corresponding startElement event, and all endPrefixMapping events will occur immediately after the corresponding endElement event, but their order is not otherwise guaranteed.

There should never be start/endPrefixMapping events for the "xml" prefix, since it is predeclared and immutable.

Parameters
prefix:String

the Namespace prefix being declared. An empty string is used for the default element namespace, which has no prefix.

uri:String

the Namespace URI the prefix is mapped to

Annotations
@Override
Exceptions
SAXException:
the client may throw an exception during processing