Class DocumentSettingsPart
java.lang.Object
org.docx4j.openpackaging.Base
org.docx4j.openpackaging.parts.Part
org.docx4j.openpackaging.parts.JaxbXmlPart<E>
org.docx4j.openpackaging.parts.JaxbXmlPartXPathAware<CTSettings>
org.docx4j.openpackaging.parts.WordprocessingML.DocumentSettingsPart
- All Implemented Interfaces:
XPathEnabled<CTSettings>
-
Field Summary
Fields inherited from class org.docx4j.openpackaging.parts.JaxbXmlPartXPathAware
binderFields inherited from class org.docx4j.openpackaging.parts.JaxbXmlPart
jaxbElement, jc, MAX_BYTES_Unmarshal_ErrorFields inherited from class org.docx4j.openpackaging.Base
contentType, partName, relationships -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidattachTemplate(String templatePath) getWordCompatSetting(String name) Get a compatibility setting in the Word namespace, by namevoidinit()booleanisRestrictEditingWith(STDocProtect editValue) Verifies the documentProtection tag inside settings.xml file if the protection is enforced (w:enforcement="1") and if the kind of protection equals to passed (STDocProtect.Enum editValue)booleanGet the value of compatSetting overrideTableStyleFontSizeAndJustificationvoidprotectRestrictEditing(STDocProtect editValue, String password, HashAlgorithm hashAlgo) Enforces the protection with the option specified by passed editValue, password, and HashAlgorithm for the password.voidprotectRestrictFormatting(boolean autoFormatOverride, boolean styleLockTheme, boolean styleLockQFSet, String password, HashAlgorithm hashAlgo) Restrict allowed formatting to specified styles.voidRemoves protection enforcement.
In the documentProtection tag inside settings.xml file
it sets the value of enforcement to "0" (w:enforcement="0")protected voidsetMceIgnorable(McIgnorableNamespaceDeclarator namespacePrefixMapper) Where the mc:Ignorable attribute is present, ensure its contents matches the ignorable namespaces actually present.voidsetOverrideTableStyleFontSizeAndJustification(boolean val) voidsetWordCompatSetting(String name, String val) booleanvalidateProtectionPassword(String password) Validates the existing passwordMethods inherited from class org.docx4j.openpackaging.parts.JaxbXmlPartXPathAware
createBinderAndJaxbElement, getBinder, getJAXBAssociationsForXPath, getJAXBAssociationsForXPath, getJAXBNodesViaXPath, getJAXBNodesViaXPath, setJaxbElement, unmarshal, unmarshalMethods inherited from class org.docx4j.openpackaging.parts.JaxbXmlPart
addMcChoiceNamespace, getConfiguredUnmarshaller, getContents, getJAXBContext, getJaxbElement, getMcChoiceNamespaces, getXML, getXMLStreamReader, inputStreamToXSR, isContentEqual, isUnmarshalled, marshal, marshal, marshal, marshal, pipe, pipe, pipe, preprocess, replacePartContent, setContents, setJAXBContext, setJaxbElement, transform, transformToDom, variableReplaceMethods inherited from class org.docx4j.openpackaging.parts.Part
getContentLengthAsLoaded, getOwningRelationshipPart, getPackage, getRelationshipType, getSourceRelationship, getSourceRelationships, getVersion, remove, rename, setContentLengthAsLoaded, setOwningRelationshipPart, setPackage, setPartShortcut, setRelationshipType, setSourceRelationship, setVersionMethods inherited from class org.docx4j.openpackaging.Base
addTargetPart, addTargetPart, addTargetPart, addTargetPart, getContentType, getPartName, getRelationshipsPart, getRelationshipsPart, getUserData, reset, setContentType, setPartName, setRelationships, setUserData
-
Constructor Details
-
DocumentSettingsPart
- Throws:
InvalidFormatException
-
DocumentSettingsPart
- Throws:
InvalidFormatException
-
-
Method Details
-
init
public void init() -
setMceIgnorable
Description copied from class:JaxbXmlPartWhere the mc:Ignorable attribute is present, ensure its contents matches the ignorable namespaces actually present.- Overrides:
setMceIgnorablein classJaxbXmlPart<CTSettings>
-
getMceIgnorable
- Overrides:
getMceIgnorablein classJaxbXmlPart<CTSettings>
-
getWordCompatSetting
Get a compatibility setting in the Word namespace, by name- Parameters:
name-- Returns:
- Throws:
Docx4JException
-
setWordCompatSetting
-
overrideTableStyleFontSizeAndJustification
public boolean overrideTableStyleFontSizeAndJustification()Get the value of compatSetting overrideTableStyleFontSizeAndJustification- Since:
- 3.3.0
-
setOverrideTableStyleFontSizeAndJustification
public void setOverrideTableStyleFontSizeAndJustification(boolean val) -
protectRestrictFormatting
public void protectRestrictFormatting(boolean autoFormatOverride, boolean styleLockTheme, boolean styleLockQFSet, String password, HashAlgorithm hashAlgo) throws Docx4JException Restrict allowed formatting to specified styles. You don't want to use this directly; use the method with the same name in WordprocessingMLPackage- Parameters:
allowedStyleNames-autoFormatOverride-styleLockTheme-styleLockQFSet-- Throws:
Docx4JException- Since:
- 3.3.0
-
isRestrictEditingWith
Verifies the documentProtection tag inside settings.xml file if the protection is enforced (w:enforcement="1") and if the kind of protection equals to passed (STDocProtect.Enum editValue)- Returns:
- true if documentProtection is enforced with option readOnly
- Since:
- 3.3.0
-
protectRestrictEditing
Enforces the protection with the option specified by passed editValue, password, and HashAlgorithm for the password.- Parameters:
editValue- the protection typepassword- the plaintext password, if null no password will be appliedhashAlgo- the hash algorithm - only md2, m5, sha1, sha256, sha384 and sha512 are supported. if null, it will default default to sha512 (like Word 2013)- Since:
- 3.3.0
-
validateProtectionPassword
Validates the existing password- Parameters:
password-- Returns:
- true, only if password was set and equals, false otherwise
- Since:
- 3.3.0
-
removeEnforcement
public void removeEnforcement()Removes protection enforcement.
In the documentProtection tag inside settings.xml file
it sets the value of enforcement to "0" (w:enforcement="0")- Since:
- 3.3.0
-
attachTemplate
- Parameters:
templatePath-- Since:
- 6.1.0
-