Body
Overview
Body is a class in Aspose.Words FOSS for Java.
Inherits from: Story.
Represents a container for the main text of a section.
Edition status of its 21 listed members (a property and its accessor methods are listed separately, overloads once): 21 not yet exercised by a verified example.
This class declares 14 methods for Body objects in Java programs.
Available methods include: Body, accept, acceptEnd, acceptStart, appendParagraph, deleteShapes, ensureMinimum, getFirstParagraph, getLastParagraph, getNodeType, getParagraphs, getParentSection, and 2 additional methods.
Public members are accessible to any Java application after installing the Aspose.Words FOSS for Java package.
Properties: firstParagraph, lastParagraph, nodeType, paragraphs, parentSection, storyType, and 1 more.
Properties
| Name | Type | Access | Description |
|---|---|---|---|
nodeType | int | Read | Returns Body. |
parentSection | Section | Read | Gets the parent section of this story. |
storyType | int | Read | Gets the type of this story. |
firstParagraph | Paragraph | Read | Gets the first paragraph in the story. |
lastParagraph | Paragraph | Read | Gets the last paragraph in the story. |
paragraphs | ParagraphCollection | Read | Gets a collection of paragraphs that are immediate children of the story. |
tables | TableCollection | Read | Gets a collection of tables that are immediate children of the story. |
Methods
| Signature | Description |
|---|---|
Body(doc: DocumentBase) | Initializes a new instance of the Body class. |
getNodeType() → int | Returns Body. |
getParentSection() → Section | Gets the parent section of this story. |
accept(visitor: DocumentVisitor) → boolean | Calls accept(visitor) on this Body instance. |
acceptStart(visitor: DocumentVisitor) → int | Accepts a visitor for visiting the start of the document’s body. |
acceptEnd(visitor: DocumentVisitor) → int | Accepts a visitor for visiting the end of the document’s body. |
ensureMinimum() | If the last child is not a paragraph, creates and appends one empty paragraph. |
getStoryType() → int | Gets the type of this story. |
getFirstParagraph() → Paragraph | Gets the first paragraph in the story. |
getLastParagraph() → Paragraph | Gets the last paragraph in the story. |
getParagraphs() → ParagraphCollection | Gets a collection of paragraphs that are immediate children of the story. |
getTables() → TableCollection | Gets a collection of tables that are immediate children of the story. |
deleteShapes() | Deletes all shapes from the text of this story. |
appendParagraph(text: String) → Paragraph | A shortcut method that creates a Paragraph object with optional text and appends it to the end of this object. |