com.aspose.words

Class NodeType

  • java.lang.Object
    • com.aspose.words.NodeType
public class NodeType 
extends java.lang.Object

Utility class containing constants. Specifies the type of a Word document node.

Example:

Shows how to enumerate immediate children of a CompositeNode using the enumerator provided by the ChildNodes collection.
Document doc = new Document();

Paragraph paragraph = (Paragraph) doc.getChild(NodeType.PARAGRAPH, 0, true);
paragraph.appendChild(new Run(doc, "Hello world!"));
paragraph.appendChild(new Run(doc, " Hello again!"));

NodeCollection children = paragraph.getChildNodes();

// Paragraph may contain children of various types such as runs, shapes and so on
for (Node child : (Iterable<Node>) children)
    if (((child.getNodeType()) == (NodeType.RUN))) {
        Run run = (Run) child;
        System.out.println(run.getText());
    }

Field Summary
static final intANY = 0
Indicates all node types. Allows to select all children.
static final intDOCUMENT = 1

A Document object that, as the root of the document tree, provides access to the entire Word document.

A Document node can have Section nodes.

static final intSECTION = 2

A Section object that corresponds to one section in a Word document.

A Section node can have Body and HeaderFooter nodes.

static final intBODY = 3

A Body object that contains the main text of a section (main text story).

A Body node can have Paragraph and Table nodes.

static final intHEADER_FOOTER = 4

A HeaderFooter object that contains text of a particular header or footer inside a section.

A HeaderFooter node can have Paragraph and Table nodes.

static final intTABLE = 5

A Table object that represents a table in a Word document.

A Table node can have Row nodes.

static final intROW = 6

A row of a table.

A Row node can have Cell nodes.

static final intCELL = 7

A cell of a table row.

A Cell node can have Paragraph and Table nodes.

static final intPARAGRAPH = 8

A paragraph of text.

A Paragraph node is a container for inline level elements Run, FieldStart, FieldSeparator, FieldEnd, FormField, Shape, GroupShape, Footnote, Comment, SpecialChar, as well as BookmarkStart and BookmarkEnd.

static final intBOOKMARK_START = 9

A beginning of a bookmark marker.

static final intBOOKMARK_END = 10

An end of a bookmark marker.

static final intEDITABLE_RANGE_START = 11

A beginning of an editable range.

static final intEDITABLE_RANGE_END = 12

An end of an editable range.

static final intMOVE_FROM_RANGE_START = 13

A beginning of an MoveFrom range.

static final intMOVE_FROM_RANGE_END = 14

An end of an MoveFrom range.

static final intMOVE_TO_RANGE_START = 15

A beginning of an MoveTo range.

static final intMOVE_TO_RANGE_END = 16

An end of an MoveTo range.

static final intGROUP_SHAPE = 17

A group of shapes, images, OLE objects or other group shapes.

A GroupShape node can contain other Shape and GroupShape nodes.

static final intSHAPE = 18

A drawing object, such as an OfficeArt shape, image or an OLE object.

A Shape node can contain Paragraph and Table nodes.

static final intCOMMENT = 19

A comment in a Word document.

A Comment node can have Paragraph and Table nodes.

static final intFOOTNOTE = 20

A footnote or endnote in a Word document.

A Footnote node can have Paragraph and Table nodes.

static final intRUN = 21

A run of text.

static final intFIELD_START = 22

A special character that designates the start of a Word field.

static final intFIELD_SEPARATOR = 23

A special character that separates the field code from the field result.

static final intFIELD_END = 24

A special character that designates the end of a Word field.

static final intFORM_FIELD = 25

A form field.

static final intSPECIAL_CHAR = 26

A special character that is not one of the more specific special character types.

static final intSMART_TAG = 27

A smart tag around one or more inline structures (runs, images, fields,etc.) within a paragraph

static final intSTRUCTURED_DOCUMENT_TAG = 28

Allows to define customer-specific information and its means of presentation.

static final intSTRUCTURED_DOCUMENT_TAG_RANGE_START = 29

A start of ranged structured document tag which accepts multi-sections content.

static final intSTRUCTURED_DOCUMENT_TAG_RANGE_END = 30

A end of ranged structured document tag which accepts multi-sections content.

static final intGLOSSARY_DOCUMENT = 31

A glossary document within the main document.

static final intBUILDING_BLOCK = 32

A building block within a glossary document (e.g. glossary document entry).

static final intCOMMENT_RANGE_START = 33
A marker node that represents the start of a commented range.
static final intCOMMENT_RANGE_END = 34
A marker node that represents the end of a commented range.
static final intOFFICE_MATH = 35

An Office Math object. Can be equation, function, matrix or one of other mathematical objects. Can be a collection of mathematical object and also can contain some non-mathematical objects such as runs of text.

static final intSUB_DOCUMENT = 36
A subdocument node which is a link to another document.
static final intSYSTEM = 37
Reserved for internal use by Aspose.Words.
static final intNULL = 38
Reserved for internal use by Aspose.Words.
 

    • Field Detail

      • ANY = 0

        public static final int ANY
        Indicates all node types. Allows to select all children.
      • DOCUMENT = 1

        public static final int DOCUMENT

        A Document object that, as the root of the document tree, provides access to the entire Word document.

        A Document node can have Section nodes.

      • SECTION = 2

        public static final int SECTION

        A Section object that corresponds to one section in a Word document.

        A Section node can have Body and HeaderFooter nodes.

      • BODY = 3

        public static final int BODY

        A Body object that contains the main text of a section (main text story).

        A Body node can have Paragraph and Table nodes.

      • HEADER_FOOTER = 4

        public static final int HEADER_FOOTER

        A HeaderFooter object that contains text of a particular header or footer inside a section.

        A HeaderFooter node can have Paragraph and Table nodes.

      • TABLE = 5

        public static final int TABLE

        A Table object that represents a table in a Word document.

        A Table node can have Row nodes.

      • ROW = 6

        public static final int ROW

        A row of a table.

        A Row node can have Cell nodes.

      • CELL = 7

        public static final int CELL

        A cell of a table row.

        A Cell node can have Paragraph and Table nodes.

      • BOOKMARK_START = 9

        public static final int BOOKMARK_START

        A beginning of a bookmark marker.

      • BOOKMARK_END = 10

        public static final int BOOKMARK_END

        An end of a bookmark marker.

      • EDITABLE_RANGE_START = 11

        public static final int EDITABLE_RANGE_START

        A beginning of an editable range.

      • EDITABLE_RANGE_END = 12

        public static final int EDITABLE_RANGE_END

        An end of an editable range.

      • MOVE_FROM_RANGE_START = 13

        public static final int MOVE_FROM_RANGE_START

        A beginning of an MoveFrom range.

      • MOVE_FROM_RANGE_END = 14

        public static final int MOVE_FROM_RANGE_END

        An end of an MoveFrom range.

      • MOVE_TO_RANGE_START = 15

        public static final int MOVE_TO_RANGE_START

        A beginning of an MoveTo range.

      • MOVE_TO_RANGE_END = 16

        public static final int MOVE_TO_RANGE_END

        An end of an MoveTo range.

      • GROUP_SHAPE = 17

        public static final int GROUP_SHAPE

        A group of shapes, images, OLE objects or other group shapes.

        A GroupShape node can contain other Shape and GroupShape nodes.

      • SHAPE = 18

        public static final int SHAPE

        A drawing object, such as an OfficeArt shape, image or an OLE object.

        A Shape node can contain Paragraph and Table nodes.

      • COMMENT = 19

        public static final int COMMENT

        A comment in a Word document.

        A Comment node can have Paragraph and Table nodes.

      • FOOTNOTE = 20

        public static final int FOOTNOTE

        A footnote or endnote in a Word document.

        A Footnote node can have Paragraph and Table nodes.

      • RUN = 21

        public static final int RUN

        A run of text.

      • FIELD_START = 22

        public static final int FIELD_START

        A special character that designates the start of a Word field.

      • FIELD_SEPARATOR = 23

        public static final int FIELD_SEPARATOR

        A special character that separates the field code from the field result.

      • FIELD_END = 24

        public static final int FIELD_END

        A special character that designates the end of a Word field.

      • FORM_FIELD = 25

        public static final int FORM_FIELD

        A form field.

      • SPECIAL_CHAR = 26

        public static final int SPECIAL_CHAR

        A special character that is not one of the more specific special character types.

      • SMART_TAG = 27

        public static final int SMART_TAG

        A smart tag around one or more inline structures (runs, images, fields,etc.) within a paragraph

      • STRUCTURED_DOCUMENT_TAG = 28

        public static final int STRUCTURED_DOCUMENT_TAG

        Allows to define customer-specific information and its means of presentation.

      • STRUCTURED_DOCUMENT_TAG_RANGE_START = 29

        public static final int STRUCTURED_DOCUMENT_TAG_RANGE_START

        A start of ranged structured document tag which accepts multi-sections content.

      • STRUCTURED_DOCUMENT_TAG_RANGE_END = 30

        public static final int STRUCTURED_DOCUMENT_TAG_RANGE_END

        A end of ranged structured document tag which accepts multi-sections content.

      • GLOSSARY_DOCUMENT = 31

        public static final int GLOSSARY_DOCUMENT

        A glossary document within the main document.

      • BUILDING_BLOCK = 32

        public static final int BUILDING_BLOCK

        A building block within a glossary document (e.g. glossary document entry).

      • COMMENT_RANGE_START = 33

        public static final int COMMENT_RANGE_START
        A marker node that represents the start of a commented range.
      • COMMENT_RANGE_END = 34

        public static final int COMMENT_RANGE_END
        A marker node that represents the end of a commented range.
      • OFFICE_MATH = 35

        public static final int OFFICE_MATH

        An Office Math object. Can be equation, function, matrix or one of other mathematical objects. Can be a collection of mathematical object and also can contain some non-mathematical objects such as runs of text.

      • SUB_DOCUMENT = 36

        public static final int SUB_DOCUMENT
        A subdocument node which is a link to another document.
      • SYSTEM = 37

        public static final int SYSTEM
        Reserved for internal use by Aspose.Words.
      • NULL = 38

        public static final int NULL
        Reserved for internal use by Aspose.Words.