public class MainDocumentPart extends DocumentPart<Document> implements ContentAccessor
commentsExtendedPart, commentsIdsPart, commentsPart, documentSettingsPart, endNotesPart, fontTablePart, footnotesPart, numberingDefinitionsPart, peoplePart, styleDefinitionsPart, themePart, webSettingsPartbinderjaxbElement, jc, MAX_BYTES_Unmarshal_ErrorcontentType, 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.
|
void |
attachTemplate(String templatePath)
Attach a template to this 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, getCommentsIdsPart, getCommentsPart, getComponentsPart, getConditionsPart, getDocumentSettingsPart, getDocumentSettingsPart, getEndNotesPart, getFontTablePart, getFootnote, getFootnotesPart, getNumberingDefinitionsPart, getPeoplePart, getQuestionsPart, getStyleDefinitionsPart, getStyleDefinitionsPart, getThemePart, getWebSettingsPart, getXPathsPart, hasEndnotesPart, hasFootnotesPart, setPartShortcutaddAltChunk, addAltChunk, addAltChunk, addAltChunk, addAltChunk, addAltChunk, addAltChunk, addAltChunk, convertAltChunkscreateBinderAndJaxbElement, getBinder, getJAXBAssociationsForXPath, getJAXBAssociationsForXPath, getJAXBNodesViaXPath, getJAXBNodesViaXPath, setJaxbElement, unmarshal, unmarshaladdMcChoiceNamespace, getContents, getJAXBContext, getJaxbElement, getMcChoiceNamespaces, getXML, isContentEqual, isUnmarshalled, marshal, marshal, marshal, marshal, pipe, pipe, pipe, setContents, setJAXBContext, setJaxbElement, transform, variableReplacegetContentLengthAsLoaded, getOwningRelationshipPart, getPackage, getRelationshipType, getSourceRelationship, getSourceRelationships, getVersion, remove, rename, setContentLengthAsLoaded, setOwningRelationshipPart, setPackage, setRelationshipType, setSourceRelationship, setVersionaddTargetPart, addTargetPart, addTargetPart, addTargetPart, getContentType, getPartName, getRelationshipsPart, getRelationshipsPart, getUserData, reset, setContentType, setPartName, setRelationships, setUserDatapublic MainDocumentPart(PartName partName) throws InvalidFormatException
InvalidFormatExceptionpublic MainDocumentPart()
throws InvalidFormatException
InvalidFormatExceptionpublic void init()
protected void setMceIgnorable(McIgnorableNamespaceDeclarator namespacePrefixMapper)
JaxbXmlPartsetMceIgnorable in class JaxbXmlPart<Document>public String getMceIgnorable()
getMceIgnorable in class JaxbXmlPart<Document>public List<Object> getContent()
getContent in interface ContentAccessorpublic 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 - JAXBExceptionpublic static P.Hyperlink hyperlinkToBookmark(String bookmarkName, String linkText)
bookmarkName - linkText - public void attachTemplate(String templatePath)
templatePath - public GlossaryDocumentPart getGlossaryDocumentPart()
public boolean setPartShortcut(Part part, String relationshipType)
BasesetPartShortcut in class DocumentPart<Document>Copyright © 2007-2020. All Rights Reserved.