org.apache.poi.hwpf.usermodel

## Class Paragraph

- java.lang.Object
- - org.apache.poi.hwpf.usermodel.Range
  - - org.apache.poi.hwpf.usermodel.Paragraph

- All Implemented Interfaces:
    Duplicatable
  Direct Known Subclasses:
    ListEntry

      public class Paragraph
      extends Range
      implements Duplicatable

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected short` | `_istd`
    `protected SprmBuffer` | `_papx`
    `protected ParagraphProperties` | `_props`
    `static short` | `SPRM_ANLD`
    `static short` | `SPRM_AUTOSPACEDE`
    `static short` | `SPRM_AUTOSPACEDN`
    `static short` | `SPRM_BRCBAR`
    `static short` | `SPRM_BRCBOTTOM`
    `static short` | `SPRM_BRCL`
    `static short` | `SPRM_BRCLEFT`
    `static short` | `SPRM_BRCP`
    `static short` | `SPRM_BRCRIGHT`
    `static short` | `SPRM_BRCTOP`
    `static short` | `SPRM_CHGTABS`
    `static short` | `SPRM_CHGTABSPAPX`
    `static short` | `SPRM_CRLF`
    `static short` | `SPRM_DCS`
    `static short` | `SPRM_DXAABS`
    `static short` | `SPRM_DXAFROMTEXT`
    `static short` | `SPRM_DXALEFT`
    `static short` | `SPRM_DXALEFT1`
    `static short` | `SPRM_DXARIGHT`
    `static short` | `SPRM_DXAWIDTH`
    `static short` | `SPRM_DYAABS`
    `static short` | `SPRM_DYAAFTER`
    `static short` | `SPRM_DYABEFORE`
    `static short` | `SPRM_DYAFROMTEXT`
    `static short` | `SPRM_DYALINE`
    `static short` | `SPRM_FADJUSTRIGHT`
    `static short` | `SPRM_FBIDI`
    `static short` | `SPRM_FINTABLE`
    `static short` | `SPRM_FKEEP`
    `static short` | `SPRM_FKEEPFOLLOW`
    `static short` | `SPRM_FKINSOKU`
    `static short` | `SPRM_FLOCKED`
    `static short` | `SPRM_FNOAUTOHYPH`
    `static short` | `SPRM_FNOLINENUMB`
    `static short` | `SPRM_FNUMRMLNS`
    `static short` | `SPRM_FOVERFLOWPUNCT`
    `static short` | `SPRM_FPAGEBREAKBEFORE`
    `static short` | `SPRM_FRAMETEXTFLOW`
    `static short` | `SPRM_FSIDEBYSIDE`
    `static short` | `SPRM_FTOPLINEPUNCT`
    `static short` | `SPRM_FTTP`
    `static short` | `SPRM_FWIDOWCONTROL`
    `static short` | `SPRM_FWORDWRAP`
    `static short` | `SPRM_ILFO`
    `static short` | `SPRM_ILVL`
    `static short` | `SPRM_JC`
    `static short` | `SPRM_NUMRM`
    `static short` | `SPRM_OUTLVL`
    `static short` | `SPRM_PC`
    `static short` | `SPRM_PROPRMARK`
    `static short` | `SPRM_RULER`
    `static short` | `SPRM_SHD`
    `static short` | `SPRM_SHD80`
    `static short` | `SPRM_USEPGSUSETTINGS`
    `static short` | `SPRM_WALIGNFONT`
    `static short` | `SPRM_WHEIGHTABS`
    `static short` | `SPRM_WR`

    - ### Fields inherited from class org.apache.poi.hwpf.usermodel.Range

      `_characters, _charEnd, _charRangeFound, _charStart, _doc, _end, _paragraphs, _parEnd, _parRangeFound, _parStart, _sectionEnd, _sections, _sectionStart, _start, _text, TYPE_CHARACTER, TYPE_LISTENTRY, TYPE_PARAGRAPH, TYPE_SECTION, TYPE_TABLE, TYPE_TEXT, TYPE_UNDEFINED`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `Paragraph` | `clone()` Deprecated.
    `ParagraphProperties` | `cloneProperties()` Clone the ParagraphProperties object associated with this Paragraph, so that you can apply the same properties to another Paragraph.
    `Paragraph` | `copy()`
    `BorderCode` | `getBarBorder()`
    `BorderCode` | `getBottomBorder()`
    `DropCapSpecifier` | `getDropCap()`
    `int` | `getFirstLineIndent()`
    `int` | `getFontAlignment()`
    `int` | `getIlfo()` Returns the ilfo, an index to the document's hpllfo, which describes the automatic number formatting of the paragraph.
    `int` | `getIlvl()` Returns the multi-level indent for the paragraph.
    `int` | `getIndentFromLeft()`
    `int` | `getIndentFromRight()`
    `int` | `getJustification()`
    `BorderCode` | `getLeftBorder()`
    `LineSpacingDescriptor` | `getLineSpacing()`
    `HWPFList` | `getList()`
    `int` | `getLvl()` Returns the heading level (1-8), or 9 if the paragraph isn't in a heading style.
    `ParagraphProperties` | `getProps()`
    `BorderCode` | `getRightBorder()`
    `ShadingDescriptor` | `getShading()`
    `int` | `getSpacingAfter()`
    `int` | `getSpacingBefore()`
    `short` | `getStyleIndex()` Returns the index of the style which applies to this Paragraph.
    `int` | `getTableLevel()`
    `int` | `getTabStopsNumber()` Returns number of tabs stops defined for paragraph.
    `int[]` | `getTabStopsPositions()` Returns array of positions of itbdMac tab stops
    `BorderCode` | `getTopBorder()`
    `boolean` | `isAutoHyphenated()`
    `boolean` | `isBackward()`
    `boolean` | `isEmbeddedCellMark()`
    `boolean` | `isInList()`
    `boolean` | `isInTable()`
    `boolean` | `isKinsoku()`
    `boolean` | `isLineNotNumbered()`
    `boolean` | `isSideBySide()`
    `boolean` | `isTableRowEnd()`
    `boolean` | `isVertical()`
    `boolean` | `isWidowControlled()`
    `boolean` | `isWordWrapped()`
    `boolean` | `keepOnPage()`
    `boolean` | `keepWithNext()`
    `protected static ParagraphProperties` | `newParagraph_applyStyleProperties(StyleSheet styleSheet, PAPX papx, ParagraphProperties properties)`
    `static Paragraph` | `newParagraph(Range parent, PAPX papx)`
    `boolean` | `pageBreakBefore()`
    `void` | `setAutoHyphenated(boolean autoHyph)`
    `void` | `setBackward(boolean bward)`
    `void` | `setBarBorder(BorderCode bar)`
    `void` | `setBottomBorder(BorderCode bottom)`
    `void` | `setDropCap(DropCapSpecifier dcs)`
    `void` | `setFirstLineIndent(int first)`
    `void` | `setFontAlignment(int align)`
    `void` | `setIndentFromLeft(int dxaLeft)`
    `void` | `setIndentFromRight(int dxaRight)`
    `void` | `setJustification(byte jc)`
    `void` | `setKeepOnPage(boolean fKeep)`
    `void` | `setKeepWithNext(boolean fKeepFollow)`
    `void` | `setKinsoku(boolean kinsoku)`
    `void` | `setLeftBorder(BorderCode left)`
    `void` | `setLineNotNumbered(boolean fNoLnn)`
    `void` | `setLineSpacing(LineSpacingDescriptor lspd)`
    `void` | `setPageBreakBefore(boolean fPageBreak)`
    `void` | `setRightBorder(BorderCode right)`
    `void` | `setShading(ShadingDescriptor shd)`
    `void` | `setSideBySide(boolean fSideBySide)`
    `void` | `setSpacingAfter(int after)`
    `void` | `setSpacingBefore(int before)`
    `void` | `setTopBorder(BorderCode top)`
    `void` | `setVertical(boolean vertical)`
    `void` | `setWidowControl(boolean widowControl)`
    `void` | `setWordWrapped(boolean wrap)`
    `java.lang.String` | `toString()`

    - ### Methods inherited from class org.apache.poi.hwpf.usermodel.Range

      `adjustFIB, delete, getCharacterRun, getDocument, getEndOffset, getParagraph, getSection, getStartOffset, getTable, initAll, insertAfter, insertBefore, insertTableBefore, numCharacterRuns, numParagraphs, numSections, replaceText, replaceText, replaceText, reset, sanityCheck, stripFields, text`

    - ### Methods inherited from class java.lang.Object

      `equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### SPRM_JC

          public static final short SPRM_JC

      See Also:
        Constant Field Values

    - #### SPRM_FSIDEBYSIDE

          public static final short SPRM_FSIDEBYSIDE

      See Also:
        Constant Field Values

    - #### SPRM_FKEEP

          public static final short SPRM_FKEEP

      See Also:
        Constant Field Values

    - #### SPRM_FKEEPFOLLOW

          public static final short SPRM_FKEEPFOLLOW

      See Also:
        Constant Field Values

    - #### SPRM_FPAGEBREAKBEFORE

          public static final short SPRM_FPAGEBREAKBEFORE

      See Also:
        Constant Field Values

    - #### SPRM_BRCL

          public static final short SPRM_BRCL

      See Also:
        Constant Field Values

    - #### SPRM_BRCP

          public static final short SPRM_BRCP

      See Also:
        Constant Field Values

    - #### SPRM_ILVL

          public static final short SPRM_ILVL

      See Also:
        Constant Field Values

    - #### SPRM_ILFO

          public static final short SPRM_ILFO

      See Also:
        Constant Field Values

    - #### SPRM_FNOLINENUMB

          public static final short SPRM_FNOLINENUMB

      See Also:
        Constant Field Values

    - #### SPRM_CHGTABSPAPX

          public static final short SPRM_CHGTABSPAPX

      See Also:
        Constant Field Values

    - #### SPRM_DXARIGHT

          public static final short SPRM_DXARIGHT

      See Also:
        Constant Field Values

    - #### SPRM_DXALEFT

          public static final short SPRM_DXALEFT

      See Also:
        Constant Field Values

    - #### SPRM_DXALEFT1

          public static final short SPRM_DXALEFT1

      See Also:
        Constant Field Values

    - #### SPRM_DYALINE

          public static final short SPRM_DYALINE

      See Also:
        Constant Field Values

    - #### SPRM_DYABEFORE

          public static final short SPRM_DYABEFORE

      See Also:
        Constant Field Values

    - #### SPRM_DYAAFTER

          public static final short SPRM_DYAAFTER

      See Also:
        Constant Field Values

    - #### SPRM_CHGTABS

          public static final short SPRM_CHGTABS

      See Also:
        Constant Field Values

    - #### SPRM_FINTABLE

          public static final short SPRM_FINTABLE

      See Also:
        Constant Field Values

    - #### SPRM_FTTP

          public static final short SPRM_FTTP

      See Also:
        Constant Field Values

    - #### SPRM_DXAABS

          public static final short SPRM_DXAABS

      See Also:
        Constant Field Values

    - #### SPRM_DYAABS

          public static final short SPRM_DYAABS

      See Also:
        Constant Field Values

    - #### SPRM_DXAWIDTH

          public static final short SPRM_DXAWIDTH

      See Also:
        Constant Field Values

    - #### SPRM_PC

          public static final short SPRM_PC

      See Also:
        Constant Field Values

    - #### SPRM_WR

          public static final short SPRM_WR

      See Also:
        Constant Field Values

    - #### SPRM_BRCTOP

          public static final short SPRM_BRCTOP

      See Also:
        Constant Field Values

    - #### SPRM_BRCLEFT

          public static final short SPRM_BRCLEFT

      See Also:
        Constant Field Values

    - #### SPRM_BRCBOTTOM

          public static final short SPRM_BRCBOTTOM

      See Also:
        Constant Field Values

    - #### SPRM_BRCRIGHT

          public static final short SPRM_BRCRIGHT

      See Also:
        Constant Field Values

    - #### SPRM_BRCBAR

          public static final short SPRM_BRCBAR

      See Also:
        Constant Field Values

    - #### SPRM_FNOAUTOHYPH

          public static final short SPRM_FNOAUTOHYPH

      See Also:
        Constant Field Values

    - #### SPRM_WHEIGHTABS

          public static final short SPRM_WHEIGHTABS

      See Also:
        Constant Field Values

    - #### SPRM_DCS

          public static final short SPRM_DCS

      See Also:
        Constant Field Values

    - #### SPRM_SHD80

          public static final short SPRM_SHD80

      See Also:
        Constant Field Values

    - #### SPRM_SHD

          public static final short SPRM_SHD

      See Also:
        Constant Field Values

    - #### SPRM_DYAFROMTEXT

          public static final short SPRM_DYAFROMTEXT

      See Also:
        Constant Field Values

    - #### SPRM_DXAFROMTEXT

          public static final short SPRM_DXAFROMTEXT

      See Also:
        Constant Field Values

    - #### SPRM_FLOCKED

          public static final short SPRM_FLOCKED

      See Also:
        Constant Field Values

    - #### SPRM_FWIDOWCONTROL

          public static final short SPRM_FWIDOWCONTROL

      See Also:
        Constant Field Values

    - #### SPRM_RULER

          public static final short SPRM_RULER

      See Also:
        Constant Field Values

    - #### SPRM_FKINSOKU

          public static final short SPRM_FKINSOKU

      See Also:
        Constant Field Values

    - #### SPRM_FWORDWRAP

          public static final short SPRM_FWORDWRAP

      See Also:
        Constant Field Values

    - #### SPRM_FOVERFLOWPUNCT

          public static final short SPRM_FOVERFLOWPUNCT

      See Also:
        Constant Field Values

    - #### SPRM_FTOPLINEPUNCT

          public static final short SPRM_FTOPLINEPUNCT

      See Also:
        Constant Field Values

    - #### SPRM_AUTOSPACEDE

          public static final short SPRM_AUTOSPACEDE

      See Also:
        Constant Field Values

    - #### SPRM_AUTOSPACEDN

          public static final short SPRM_AUTOSPACEDN

      See Also:
        Constant Field Values

    - #### SPRM_WALIGNFONT

          public static final short SPRM_WALIGNFONT

      See Also:
        Constant Field Values

    - #### SPRM_FRAMETEXTFLOW

          public static final short SPRM_FRAMETEXTFLOW

      See Also:
        Constant Field Values

    - #### SPRM_ANLD

          public static final short SPRM_ANLD

      See Also:
        Constant Field Values

    - #### SPRM_PROPRMARK

          public static final short SPRM_PROPRMARK

      See Also:
        Constant Field Values

    - #### SPRM_OUTLVL

          public static final short SPRM_OUTLVL

      See Also:
        Constant Field Values

    - #### SPRM_FBIDI

          public static final short SPRM_FBIDI

      See Also:
        Constant Field Values

    - #### SPRM_FNUMRMLNS

          public static final short SPRM_FNUMRMLNS

      See Also:
        Constant Field Values

    - #### SPRM_CRLF

          public static final short SPRM_CRLF

      See Also:
        Constant Field Values

    - #### SPRM_NUMRM

          public static final short SPRM_NUMRM

      See Also:
        Constant Field Values

    - #### SPRM_USEPGSUSETTINGS

          public static final short SPRM_USEPGSUSETTINGS

      See Also:
        Constant Field Values

    - #### SPRM_FADJUSTRIGHT

          public static final short SPRM_FADJUSTRIGHT

      See Also:
        Constant Field Values

    - #### _istd

          protected short _istd

    - #### _props

          protected ParagraphProperties _props

    - #### _papx

          protected SprmBuffer _papx

  - ### Method Detail

    - #### newParagraph

          @Internal
          public static Paragraph newParagraph(Range parent,
                                                         PAPX papx)

    - #### newParagraph_applyStyleProperties

          protected static ParagraphProperties newParagraph_applyStyleProperties(StyleSheet styleSheet,
                                                                                 PAPX papx,
                                                                                 ParagraphProperties properties)

    - #### getStyleIndex

          public short getStyleIndex()

      Returns the index of the style which applies to this Paragraph. Details of the style can be looked up from the `StyleSheet`, via `StyleSheet.getStyleDescription(int)`

    - #### isInTable

          public boolean isInTable()

    - #### isTableRowEnd

          public boolean isTableRowEnd()

      Returns:
        `true`, if table trailer paragraph (last in table row), `false` otherwise

    - #### getTableLevel

          public int getTableLevel()

    - #### isEmbeddedCellMark

          public boolean isEmbeddedCellMark()

      Returns:
        `true`, if the end of paragraph mark is really an end of cell mark for a nested table cell, `false` otherwise

    - #### getJustification

          public int getJustification()

    - #### setJustification

          public void setJustification(byte jc)

    - #### keepOnPage

          public boolean keepOnPage()

    - #### setKeepOnPage

          public void setKeepOnPage(boolean fKeep)

    - #### keepWithNext

          public boolean keepWithNext()

    - #### setKeepWithNext

          public void setKeepWithNext(boolean fKeepFollow)

    - #### pageBreakBefore

          public boolean pageBreakBefore()

    - #### setPageBreakBefore

          public void setPageBreakBefore(boolean fPageBreak)

    - #### isLineNotNumbered

          public boolean isLineNotNumbered()

    - #### setLineNotNumbered

          public void setLineNotNumbered(boolean fNoLnn)

    - #### isSideBySide

          public boolean isSideBySide()

    - #### setSideBySide

          public void setSideBySide(boolean fSideBySide)

    - #### isAutoHyphenated

          public boolean isAutoHyphenated()

    - #### setAutoHyphenated

          public void setAutoHyphenated(boolean autoHyph)

    - #### isWidowControlled

          public boolean isWidowControlled()

    - #### setWidowControl

          public void setWidowControl(boolean widowControl)

    - #### getIndentFromRight

          public int getIndentFromRight()

    - #### setIndentFromRight

          public void setIndentFromRight(int dxaRight)

    - #### getIndentFromLeft

          public int getIndentFromLeft()

    - #### setIndentFromLeft

          public void setIndentFromLeft(int dxaLeft)

    - #### getFirstLineIndent

          public int getFirstLineIndent()

    - #### setFirstLineIndent

          public void setFirstLineIndent(int first)

    - #### getLineSpacing

          public LineSpacingDescriptor getLineSpacing()

    - #### setLineSpacing

          public void setLineSpacing(LineSpacingDescriptor lspd)

    - #### getSpacingBefore

          public int getSpacingBefore()

    - #### setSpacingBefore

          public void setSpacingBefore(int before)

    - #### getSpacingAfter

          public int getSpacingAfter()

    - #### setSpacingAfter

          public void setSpacingAfter(int after)

    - #### isKinsoku

          public boolean isKinsoku()

    - #### setKinsoku

          public void setKinsoku(boolean kinsoku)

    - #### isWordWrapped

          public boolean isWordWrapped()

    - #### setWordWrapped

          public void setWordWrapped(boolean wrap)

    - #### getFontAlignment

          public int getFontAlignment()

    - #### setFontAlignment

          public void setFontAlignment(int align)

    - #### isVertical

          public boolean isVertical()

    - #### setVertical

          public void setVertical(boolean vertical)

    - #### isBackward

          public boolean isBackward()

    - #### setBackward

          public void setBackward(boolean bward)

    - #### getTopBorder

          public BorderCode getTopBorder()

    - #### setTopBorder

          public void setTopBorder(BorderCode top)

    - #### getLeftBorder

          public BorderCode getLeftBorder()

    - #### setLeftBorder

          public void setLeftBorder(BorderCode left)

    - #### getBottomBorder

          public BorderCode getBottomBorder()

    - #### setBottomBorder

          public void setBottomBorder(BorderCode bottom)

    - #### getRightBorder

          public BorderCode getRightBorder()

    - #### setRightBorder

          public void setRightBorder(BorderCode right)

    - #### getBarBorder

          public BorderCode getBarBorder()

    - #### setBarBorder

          public void setBarBorder(BorderCode bar)

    - #### getShading

          public ShadingDescriptor getShading()

    - #### setShading

          public void setShading(ShadingDescriptor shd)

    - #### getDropCap

          public DropCapSpecifier getDropCap()

    - #### setDropCap

          public void setDropCap(DropCapSpecifier dcs)

    - #### getIlfo

          public int getIlfo()

      Returns the ilfo, an index to the document's hpllfo, which describes the automatic number formatting of the paragraph. A value of zero means it isn't numbered.

    - #### getIlvl

          public int getIlvl()

      Returns the multi-level indent for the paragraph. Will be zero for non-list paragraphs, and the first level of any list. Subsequent levels in hold values 1-8.

    - #### getLvl

          public int getLvl()

      Returns the heading level (1-8), or 9 if the paragraph isn't in a heading style.

    - #### getTabStopsNumber

          public int getTabStopsNumber()

      Returns number of tabs stops defined for paragraph. Must be >= 0 and <= 64.
      Returns:
        number of tabs stops defined for paragraph. Must be >= 0 and <= 64

    - #### getTabStopsPositions

          public int[] getTabStopsPositions()

      Returns array of positions of itbdMac tab stops
      Returns:
        array of positions of itbdMac tab stops

    - #### getList

          public HWPFList getList()

    - #### isInList

          public boolean isInList()

    - #### cloneProperties

          public ParagraphProperties cloneProperties()

      Clone the ParagraphProperties object associated with this Paragraph, so that you can apply the same properties to another Paragraph.

    - #### clone

          @Deprecated
           @Removal(version="5.0.0")
          public Paragraph clone()

      Deprecated.
      Overrides:
        `clone` in class `java.lang.Object`

    - #### copy

          public Paragraph copy()

      Specified by:
        `copy` in interface `Duplicatable`
      Returns:
        a deep copy of the implementing class / instance

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `Range`

    - #### getProps

          @Internal
          public ParagraphProperties getProps()

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