Class DocumentSettingsPart

All Implemented Interfaces:
XPathEnabled<CTSettings>

public final class DocumentSettingsPart
extends JaxbXmlPartXPathAware<CTSettings>
  • Constructor Details

  • Method Details

    • init

      public void init()
    • setMceIgnorable

      protected void setMceIgnorable​(McIgnorableNamespaceDeclarator namespacePrefixMapper)
      Description copied from class: JaxbXmlPart
      Where the mc:Ignorable attribute is present, ensure its contents matches the ignorable namespaces actually present.
      Overrides:
      setMceIgnorable in class JaxbXmlPart<CTSettings>
    • getMceIgnorable

      public java.lang.String getMceIgnorable()
      Overrides:
      getMceIgnorable in class JaxbXmlPart<CTSettings>
    • getWordCompatSetting

      public CTCompatSetting getWordCompatSetting​(java.lang.String name)
      Get a compatibility setting in the Word namespace, by name
      Parameters:
      name -
      Returns:
      Throws:
      Docx4JException
    • setWordCompatSetting

      public void setWordCompatSetting​(java.lang.String name, java.lang.String val)
    • 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, java.lang.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

      public boolean isRestrictEditingWith​(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)
      Returns:
      true if documentProtection is enforced with option readOnly
      Since:
      3.3.0
    • protectRestrictEditing

      public void protectRestrictEditing​(STDocProtect editValue, java.lang.String password, HashAlgorithm hashAlgo)
      Enforces the protection with the option specified by passed editValue, password, and HashAlgorithm for the password.
      Parameters:
      editValue - the protection type
      password - the plaintext password, if null no password will be applied
      hashAlgo - 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

      public boolean validateProtectionPassword​(java.lang.String password)
      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

      public void attachTemplate​(java.lang.String templatePath)
      Parameters:
      templatePath -
      Since:
      6.1.0