E
- type of the content tree objectpublic abstract class JaxbXmlPart<E> extends Part
Modifier and Type | Field and Description |
---|---|
protected E |
jaxbElement
The content tree (ie JAXB representation of the Part)
|
protected javax.xml.bind.JAXBContext |
jc |
protected static org.slf4j.Logger |
log |
contentType, partName, relationships
Constructor and Description |
---|
JaxbXmlPart(PartName partName) |
JaxbXmlPart(PartName partName,
javax.xml.bind.JAXBContext jc) |
Modifier and Type | Method and Description |
---|---|
E |
getContents()
Get the live contents of this part (the JAXB object model).
|
javax.xml.bind.JAXBContext |
getJAXBContext() |
E |
getJaxbElement()
Deprecated.
|
protected String |
getMceIgnorable() |
String |
getXML()
See your content as XML.
|
boolean |
isContentEqual(Part other) |
boolean |
isUnmarshalled() |
void |
marshal(Node node)
Marshal the content tree rooted at jaxbElement into a DOM tree.
|
void |
marshal(Node node,
Object namespacePrefixMapper)
Marshal the content tree rooted at jaxbElement into a DOM tree.
|
void |
marshal(OutputStream os)
Marshal the content tree rooted at jaxbElement into an output
stream, using org.docx4j.jaxb.NamespacePrefixMapper.
|
void |
marshal(OutputStream os,
Object namespacePrefixMapper)
Marshal the content tree rooted at jaxbElement into an output
stream
|
void |
pipe(SAXHandler saxHandler)
Replace the contents of this part with the output of passing it through your SAXHandler.
|
void |
pipe(StAXHandlerInterface handler)
Replace the contents of this part with the output of passing it through your StAXHandler.
|
void |
pipe(StAXHandlerInterface handler,
javax.xml.stream.StreamFilter filter)
Replace the contents of this part with the output of passing it through your StAXHandler.
|
void |
setContents(E jaxbElement)
Set the contents of this part.
|
void |
setJAXBContext(javax.xml.bind.JAXBContext jc) |
void |
setJaxbElement(E jaxbElement) |
void |
setJaxbElement(javax.xml.bind.util.JAXBResult result) |
protected void |
setMceIgnorable(McIgnorableNamespaceDeclarator namespacePrefixMapper)
Where the mc:Ignorable attribute is present,
ensure its contents matches the ignorable namespaces
actually present.
|
E |
unmarshal(Element el) |
E |
unmarshal(InputStream is)
Unmarshal XML data from the specified InputStream and return the
resulting content tree.
|
void |
variableReplace(HashMap<String,String> mappings)
unmarshallFromTemplate.
|
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, setContentType, setPartName, setRelationships, setUserData
protected static org.slf4j.Logger log
protected javax.xml.bind.JAXBContext jc
protected E jaxbElement
public JaxbXmlPart(PartName partName) throws InvalidFormatException
InvalidFormatException
public JaxbXmlPart(PartName partName, javax.xml.bind.JAXBContext jc) throws InvalidFormatException
InvalidFormatException
public void setJAXBContext(javax.xml.bind.JAXBContext jc)
public javax.xml.bind.JAXBContext getJAXBContext()
public E getContents() throws Docx4JException
Docx4JException
@Deprecated public E getJaxbElement()
public void setJaxbElement(E jaxbElement)
public void setContents(E jaxbElement)
jaxbElement
- public void setJaxbElement(javax.xml.bind.util.JAXBResult result) throws javax.xml.bind.JAXBException
javax.xml.bind.JAXBException
public String getXML()
public boolean isUnmarshalled()
public void variableReplace(HashMap<String,String> mappings) throws javax.xml.bind.JAXBException, Docx4JException
mappings
- javax.xml.bind.JAXBException
Docx4JException
public void pipe(SAXHandler saxHandler) throws ParserConfigurationException, SAXException, Docx4JException, IOException, javax.xml.bind.JAXBException
saxHandler
- ParserConfigurationException
SAXException
Docx4JException
IOException
javax.xml.bind.JAXBException
public void pipe(StAXHandlerInterface handler) throws javax.xml.stream.XMLStreamException, Docx4JException, javax.xml.bind.JAXBException
handler
- javax.xml.stream.XMLStreamException
Docx4JException
javax.xml.bind.JAXBException
public void pipe(StAXHandlerInterface handler, javax.xml.stream.StreamFilter filter) throws javax.xml.stream.XMLStreamException, Docx4JException, javax.xml.bind.JAXBException
handler
- filter
- javax.xml.stream.XMLStreamException
Docx4JException
javax.xml.bind.JAXBException
public void marshal(Node node) throws javax.xml.bind.JAXBException
node
- DOM nodes will be added as children of this node.
This parameter must be a Node that accepts children
(Document
,
DocumentFragment
, or
Element
)javax.xml.bind.JAXBException
- If any unexpected problem occurs during the marshalling.public void marshal(Node node, Object namespacePrefixMapper) throws javax.xml.bind.JAXBException
node
- DOM nodes will be added as children of this node.
This parameter must be a Node that accepts children
(Document
,
DocumentFragment
, or
Element
)javax.xml.bind.JAXBException
- If any unexpected problem occurs during the marshalling.public void marshal(OutputStream os) throws javax.xml.bind.JAXBException
os
- XML will be added to this stream.javax.xml.bind.JAXBException
- If any unexpected problem occurs during the marshalling.public void marshal(OutputStream os, Object namespacePrefixMapper) throws javax.xml.bind.JAXBException
os
- XML will be added to this stream.namespacePrefixMapper
- namespacePrefixMapperjavax.xml.bind.JAXBException
- If any unexpected problem occurs during the marshalling.protected String getMceIgnorable()
protected void setMceIgnorable(McIgnorableNamespaceDeclarator namespacePrefixMapper)
public E unmarshal(InputStream is) throws javax.xml.bind.JAXBException
Implements Unmarshal Global Root Element.
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
javax.xml.bind.JAXBException
public boolean isContentEqual(Part other) throws Docx4JException
isContentEqual
in class Part
Docx4JException
Copyright © 2007-2016. All Rights Reserved.