public abstract class JaxbXmlPartXPathAware<E> extends JaxbXmlPart<E> implements XPathEnabled<E>
Modifier and Type | Field and Description |
---|---|
protected javax.xml.bind.Binder<Node> |
binder |
protected static org.slf4j.Logger |
log |
jaxbElement, jc
contentType, partName, relationships
Constructor and Description |
---|
JaxbXmlPartXPathAware(PartName partName) |
Modifier and Type | Method and Description |
---|---|
E |
createBinderAndJaxbElement(E source)
Set the JAXBElement for this part, and a corresponding
binder, based on the object provided.
|
javax.xml.bind.Binder<Node> |
getBinder()
Enables synchronization between XML infoset nodes and JAXB objects
representing same XML document.
|
List<JAXBAssociation> |
getJAXBAssociationsForXPath(Object someJaxbElement,
String xpathExpr,
boolean refreshXmlFirst)
Fetch DOM node / JAXB object pairs matching an XPath (for example ".//w:p" - note the dot,
which is necessary for this sort of relative path).
|
List<JAXBAssociation> |
getJAXBAssociationsForXPath(String xpathExpr,
boolean refreshXmlFirst)
Fetch DOM node / JAXB object pairs matching an XPath (for example "//w:p").
|
List<Object> |
getJAXBNodesViaXPath(String xpathExpr,
boolean refreshXmlFirst)
Fetch JAXB Nodes matching an XPath (for example "//w:p").
|
List<Object> |
getJAXBNodesViaXPath(String xpathExpr,
Object someJaxbElement,
boolean refreshXmlFirst)
Fetch JAXB Nodes matching an XPath (for example ".//w:p" - note the dot,
which is necessary for this sort of relative path).
|
void |
setJaxbElement(E jaxbElement)
You can't use this override to create/update a binder, since this would set the
jaxbElement field to something different to the object being passed in
(as a consequence of the process to create a binder).
|
E |
unmarshal(Element el) |
E |
unmarshal(InputStream is)
Unmarshal XML data from the specified InputStream and return the
resulting content tree.
|
getContents, getJAXBContext, getJaxbElement, getMceIgnorable, getXML, isContentEqual, isUnmarshalled, marshal, marshal, marshal, marshal, pipe, pipe, pipe, setContents, setJAXBContext, setJaxbElement, setMceIgnorable, transform, variableReplace
getContentLengthAsLoaded, getOwningRelationshipPart, getPackage, getRelationshipType, getSourceRelationship, getSourceRelationships, getVersion, remove, rename, setContentLengthAsLoaded, setOwningRelationshipPart, setPackage, setPartShortcut, setRelationshipType, setSourceRelationship, setVersion
addTargetPart, addTargetPart, addTargetPart, addTargetPart, getContentType, getPartName, getRelationshipsPart, getRelationshipsPart, getUserData, reset, setContentType, setPartName, setRelationships, setUserData
protected static org.slf4j.Logger log
protected javax.xml.bind.Binder<Node> binder
public JaxbXmlPartXPathAware(PartName partName) throws InvalidFormatException
InvalidFormatException
public javax.xml.bind.Binder<Node> getBinder()
getBinder
in interface XPathEnabled<E>
public void setJaxbElement(E jaxbElement)
setJaxbElement
in class JaxbXmlPart<E>
public E createBinderAndJaxbElement(E source) throws javax.xml.bind.JAXBException
createBinderAndJaxbElement
in interface XPathEnabled<E>
source
- javax.xml.bind.JAXBException
public List<Object> getJAXBNodesViaXPath(String xpathExpr, boolean refreshXmlFirst) throws javax.xml.bind.JAXBException, XPathBinderAssociationIsPartialException
getJAXBNodesViaXPath
in interface XPathEnabled<E>
xpathExpr
- refreshXmlFirst
- javax.xml.bind.JAXBException
XPathBinderAssociationIsPartialException
public List<Object> getJAXBNodesViaXPath(String xpathExpr, Object someJaxbElement, boolean refreshXmlFirst) throws javax.xml.bind.JAXBException, XPathBinderAssociationIsPartialException
getJAXBNodesViaXPath
in interface XPathEnabled<E>
xpathExpr
- someJaxbElement
- refreshXmlFirst
- javax.xml.bind.JAXBException
XPathBinderAssociationIsPartialException
public List<JAXBAssociation> getJAXBAssociationsForXPath(String xpathExpr, boolean refreshXmlFirst) throws javax.xml.bind.JAXBException, XPathBinderAssociationIsPartialException
getJAXBAssociationsForXPath
in interface XPathEnabled<E>
binder
- jaxbElement
- xpathExpr
- refreshXmlFirst
- javax.xml.bind.JAXBException
XPathBinderAssociationIsPartialException
public List<JAXBAssociation> getJAXBAssociationsForXPath(Object someJaxbElement, String xpathExpr, boolean refreshXmlFirst) throws javax.xml.bind.JAXBException, XPathBinderAssociationIsPartialException
getJAXBAssociationsForXPath
in interface XPathEnabled<E>
binder
- jaxbElement
- xpathExpr
- refreshXmlFirst
- javax.xml.bind.JAXBException
XPathBinderAssociationIsPartialException
public E unmarshal(InputStream is) throws javax.xml.bind.JAXBException
Implements Unmarshal Global Root Element.
unmarshal
in class JaxbXmlPart<E>
is
- the InputStream to unmarshal XML data fromjavax.xml.bind.JAXBException
- If any unexpected errors occur while unmarshallingpublic E unmarshal(Element el) throws javax.xml.bind.JAXBException
unmarshal
in class JaxbXmlPart<E>
javax.xml.bind.JAXBException
Copyright © 2007-2018. All Rights Reserved.