Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.poi.xwpf.usermodel
Class XWPFSettings

    java.lang.Object
      org.apache.poi.POIXMLDocumentPart
          org.apache.poi.xwpf.usermodel.XWPFSettings

    public class XWPFSettings

extends POIXMLDocumentPart

Field Summary

Fields inherited from class org.apache.poi.POIXMLDocumentPart
`DEFAULT_XML_OPTIONS`

Constructor Summary
`XWPFSettings()`
`XWPFSettings(PackagePart part, PackageRelationship rel)`

Method Summary
`protected void` | `commit()` Save the content in the underlying package part.
`boolean` | `isEnforcedWith(org.openxmlformats.schemas.wordprocessingml.x2006.main.STDocProtect.Enum 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) sample snippet from settings.xml
`void` | `removeEnforcement()` Removes protection enforcement. In the documentProtection tag inside settings.xml file it sets the value of enforcement to "0" (w:enforcement="0")
`void` | `setEnforcementEditValue(org.openxmlformats.schemas.wordprocessingml.x2006.main.STDocProtect.Enum editValue)` Enforces the protection with the option specified by passed editValue. In the documentProtection tag inside settings.xml file it sets the value of enforcement to "1" (w:enforcement="1") and the value of edit to the passed editValue (w:edit="[passed editValue]") sample snippet from settings.xml

Methods inherited from class org.apache.poi.POIXMLDocumentPart
`addRelation, createRelationship, createRelationship, createRelationship, getPackagePart, getPackageRelationship, getParent, getRelations, onDocumentCreate, onDocumentRead, onSave, read, rebase, removeRelation, toString`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### XWPFSettings

    public XWPFSettings(PackagePart part,
                        PackageRelationship rel)
                 throws java.io.IOException

Throws:
  `java.io.IOException`

### XWPFSettings

    public XWPFSettings()

Method Detail

### isEnforcedWith

    public boolean isEnforcedWith(org.openxmlformats.schemas.wordprocessingml.x2006.main.STDocProtect.Enum 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)
  sample snippet from settings.xml

           <w:settings  ... >
               <w:documentProtection w:edit="readOnly" w:enforcement="1"/>

  Returns:
    true if documentProtection is enforced with option readOnly

### setEnforcementEditValue

    public void setEnforcementEditValue(org.openxmlformats.schemas.wordprocessingml.x2006.main.STDocProtect.Enum editValue)

  Enforces the protection with the option specified by passed editValue.
  In the documentProtection tag inside settings.xml file
  it sets the value of enforcement to "1" (w:enforcement="1")
  and the value of edit to the passed editValue (w:edit="[passed editValue]")
  sample snippet from settings.xml

           <w:settings  ... >
               <w:documentProtection w:edit="[passed editValue]" w:enforcement="1"/>

### 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")

### commit

    protected void commit()
                   throws java.io.IOException

  Description copied from class: `POIXMLDocumentPart`
  Save the content in the underlying package part. Default implementation is empty meaning that the package part is left unmodified. Sub-classes should override and add logic to marshal the "model" into Ooxml4J. For example, the code saving a generic XML entry may look as follows:

       protected void commit() throws IOException {
         PackagePart part = getPackagePart();
         OutputStream out = part.getOutputStream();
         XmlObject bean = getXmlBean(); //the "model" which holds changes in memory
         bean.save(out, DEFAULT_XML_OPTIONS);
         out.close();
       }

  Overrides:
    `commit` in class `POIXMLDocumentPart`
  Throws:
    `java.io.IOException`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright 2010 The Apache Software Foundation or its licensors, as applicable.