Package net.sf.saxon.option.jdom2
Class JDOM2DocumentWrapper
java.lang.Object
net.sf.saxon.om.GenericTreeInfo
net.sf.saxon.option.jdom2.JDOM2DocumentWrapper
- All Implemented Interfaces:
Source
,ActiveSource
,TreeInfo
The tree information for a tree acting as a wrapper for a JDOM2 Document.
- Since:
- 9.7: this class no longer implements NodeInfo; the document node itself is now an instance of JDOM2NodeWrapper.
-
Field Summary
FieldsFields inherited from class net.sf.saxon.om.GenericTreeInfo
root
-
Constructor Summary
ConstructorsConstructorDescriptionJDOM2DocumentWrapper
(org.jdom2.Document doc, Configuration config) Create a Saxon wrapper for a JDOM document -
Method Summary
Modifier and TypeMethodDescriptionvoid
deliver
(Receiver receiver, ParseOptions options) Implement the ActiveSource interfaceGet the element with a given ID, if anyWrap a node in the JDOM document.Methods inherited from class net.sf.saxon.om.GenericTreeInfo
getConfiguration, getDocumentNumber, getDurability, getPublicId, getRootNode, getSpaceStrippingRule, getSystemId, getUnparsedEntity, getUnparsedEntityNames, getUserData, isMutable, isStreamed, setConfiguration, setDocumentNumber, setDurability, setRootNode, setSpaceStrippingRule, setSystemId, setUserData
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.xml.transform.Source
getSystemId, isEmpty, setSystemId
-
Field Details
-
config
-
documentNumber
protected long documentNumber
-
-
Constructor Details
-
JDOM2DocumentWrapper
Create a Saxon wrapper for a JDOM document- Parameters:
doc
- The JDOM documentconfig
- The Saxon Configuration
-
-
Method Details
-
deliver
Implement the ActiveSource interface- Specified by:
deliver
in interfaceActiveSource
- Parameters:
receiver
- the receiver to which events representing the parsed XML document will be sentoptions
- options for parsing the source- Throws:
XPathException
- if parsing fails for any reason. The detailed diagnostics will have been sent to the error reporter.
-
wrap
Wrap a node in the JDOM document.- Parameters:
node
- The node to be wrapped. This must be a node in the same document (the system does not check for this).- Returns:
- the wrapping NodeInfo object
-
selectID
Get the element with a given ID, if any- Specified by:
selectID
in interfaceTreeInfo
- Overrides:
selectID
in classGenericTreeInfo
- Parameters:
id
- the required ID valuegetParent
- true if requesting the parent element of an ID-valued element- Returns:
- the element node with the given ID if there is one, otherwise null.
-