public class MainDocumentPart extends DocumentPart<Document> implements ContentAccessor
commentsExtendedPart, commentsPart, documentSettingsPart, endNotesPart, fontTablePart, footnotesPart, numberingDefinitionsPart, peoplePart, styleDefinitionsPart, themePart, webSettingsPart
binder
jaxbElement, jc, MAX_BYTES_Unmarshal_Error
contentType, partName, relationships
Constructor and Description |
---|
MainDocumentPart() |
MainDocumentPart(PartName partName) |
Modifier and Type | Method and Description |
---|---|
void |
addObject(Object o)
Add the object o to the document.
|
P |
addParagraph(String pXml)
Create a paragraph from the xml string
|
P |
addParagraphOfText(String simpleText)
Create a paragraph containing the string simpleText,
and add it to the document.
|
P |
addStyledParagraphOfText(String styleId,
String text)
Create a paragraph containing the string simpleText, styled
using the specified style
(up to user to ensure it is a paragraph style)
and add it to the document.
|
P |
createParagraphOfText(String simpleText)
Create a paragraph containing the string simpleText,
without adding it to the document.
|
P |
createStyledParagraphOfText(String styleId,
String text)
Create a paragraph containing the string simpleText, styled
using the specified style (up to user to ensure it is a paragraph style)
without adding it to the document.
|
Set<String> |
fontsInUse()
Traverse the document, looking for fonts which have been applied, either
directly, or via a style.
|
List<Object> |
getContent()
Convenience method to getJaxbElement().getBody().getContent()
|
GlossaryDocumentPart |
getGlossaryDocumentPart() |
String |
getMceIgnorable() |
PropertyResolver |
getPropertyResolver() |
Set<String> |
getStylesInUse()
Traverse the document, and return a map of all styles which are used
directly in the document.
|
StyleTree |
getStyleTree() |
StyleTree |
getStyleTree(boolean refresh) |
static P.Hyperlink |
hyperlinkToBookmark(String bookmarkName,
String linkText)
Create a Hyperlink object, which is suitable for adding to a w:p
|
void |
init() |
protected void |
setMceIgnorable(McIgnorableNamespaceDeclarator namespacePrefixMapper)
Where the mc:Ignorable attribute is present,
ensure its contents matches the ignorable namespaces
actually present.
|
boolean |
setPartShortcut(Part part,
String relationshipType)
Tell the source Part about this target Part, so the
source can use this part via a convenience method.
|
getBibliographyPart, getCommentsExtendedPart, getCommentsPart, getComponentsPart, getConditionsPart, getDocumentSettingsPart, getDocumentSettingsPart, getEndNotesPart, getFontTablePart, getFootnote, getFootnotesPart, getNumberingDefinitionsPart, getPeoplePart, getQuestionsPart, getStyleDefinitionsPart, getStyleDefinitionsPart, getThemePart, getWebSettingsPart, getXPathsPart, hasEndnotesPart, hasFootnotesPart, setPartShortcut
addAltChunk, addAltChunk, addAltChunk, addAltChunk, convertAltChunks
createBinderAndJaxbElement, getBinder, getJAXBAssociationsForXPath, getJAXBAssociationsForXPath, getJAXBNodesViaXPath, getJAXBNodesViaXPath, setJaxbElement, unmarshal, unmarshal
addMcChoiceNamespace, getContents, getJAXBContext, getJaxbElement, getMcChoiceNamespaces, getXML, isContentEqual, isUnmarshalled, marshal, marshal, marshal, marshal, pipe, pipe, pipe, setContents, setJAXBContext, setJaxbElement, transform, variableReplace
getContentLengthAsLoaded, getOwningRelationshipPart, getPackage, getRelationshipType, getSourceRelationship, getSourceRelationships, getVersion, remove, rename, setContentLengthAsLoaded, setOwningRelationshipPart, setPackage, setRelationshipType, setSourceRelationship, setVersion
addTargetPart, addTargetPart, addTargetPart, addTargetPart, getContentType, getPartName, getRelationshipsPart, getRelationshipsPart, getUserData, reset, setContentType, setPartName, setRelationships, setUserData
public MainDocumentPart(PartName partName) throws InvalidFormatException
InvalidFormatException
public MainDocumentPart() throws InvalidFormatException
InvalidFormatException
public void init()
protected void setMceIgnorable(McIgnorableNamespaceDeclarator namespacePrefixMapper)
JaxbXmlPart
setMceIgnorable
in class JaxbXmlPart<Document>
public String getMceIgnorable()
getMceIgnorable
in class JaxbXmlPart<Document>
public List<Object> getContent()
getContent
in interface ContentAccessor
public PropertyResolver getPropertyResolver()
public StyleTree getStyleTree()
public StyleTree getStyleTree(boolean refresh)
public Set<String> fontsInUse()
public Set<String> getStylesInUse()
public P addStyledParagraphOfText(String styleId, String text)
styleId
- text
- public P createStyledParagraphOfText(String styleId, String text)
styleId
- text
- public P addParagraphOfText(String simpleText)
simpleText
- public P createParagraphOfText(String simpleText)
simpleText
- public void addObject(Object o)
o
- public P addParagraph(String pXml) throws JAXBException
simpleText
- JAXBException
public static P.Hyperlink hyperlinkToBookmark(String bookmarkName, String linkText)
bookmarkName
- linkText
- public GlossaryDocumentPart getGlossaryDocumentPart()
public boolean setPartShortcut(Part part, String relationshipType)
Base
setPartShortcut
in class DocumentPart<Document>
Copyright © 2007-2018. All Rights Reserved.