public class StructuredDocumentTagRangeEnd extends Node
StructuredDocumentTagRangeStart node.
To learn more, visit the Structured Document Tags or Content Control documentation article.
Remarks:
Can be immediate child of Body node only.
Examples:
Shows how to get the properties of multi-section structured document tags.
Document doc = new Document(getMyDir() + "Multi-section structured document tags.docx");
StructuredDocumentTagRangeStart rangeStartTag = (StructuredDocumentTagRangeStart) doc.getChildNodes(NodeType.STRUCTURED_DOCUMENT_TAG_RANGE_START, true).get(0);
StructuredDocumentTagRangeEnd rangeEndTag = (StructuredDocumentTagRangeEnd) doc.getChildNodes(NodeType.STRUCTURED_DOCUMENT_TAG_RANGE_END, true).get(0);
System.out.println("StructuredDocumentTagRangeStart values:");
System.out.println(MessageFormat.format("\t|Id: {0}", rangeStartTag.getId()));
System.out.println(MessageFormat.format("\t|Title: {0}", rangeStartTag.getTitle()));
System.out.println(MessageFormat.format("\t|PlaceholderName: {0}", rangeStartTag.getPlaceholderName()));
System.out.println(MessageFormat.format("\t|IsShowingPlaceholderText: {0}", rangeStartTag.isShowingPlaceholderText()));
System.out.println(MessageFormat.format("\t|LockContentControl: {0}", rangeStartTag.getLockContentControl()));
System.out.println(MessageFormat.format("\t|LockContents: {0}", rangeStartTag.getLockContents()));
System.out.println(MessageFormat.format("\t|Level: {0}", rangeStartTag.getLevel()));
System.out.println(MessageFormat.format("\t|NodeType: {0}", rangeStartTag.getNodeType()));
System.out.println(MessageFormat.format("\t|RangeEnd: {0}", rangeStartTag.getRangeEnd()));
System.out.println(MessageFormat.format("\t|Color: {0}", rangeStartTag.getColor()));
System.out.println(MessageFormat.format("\t|SdtType: {0}", rangeStartTag.getSdtType()));
System.out.println(MessageFormat.format("\t|FlatOpcContent: {0}", rangeStartTag.getWordOpenXML()));
System.out.println(MessageFormat.format("\t|Tag: {0}\n", rangeStartTag.getTag()));
System.out.println("StructuredDocumentTagRangeEnd values:");
System.out.println("\t|Id: {rangeEndTag.Id}");
System.out.println("\t|NodeType: {rangeEndTag.NodeType}");
| Constructor and Description |
|---|
StructuredDocumentTagRangeEnd(DocumentBase doc,
int id)
Initializes a new instance of the Structured document tag range end class.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
accept(DocumentVisitor visitor)
Accepts a visitor.
|
int |
getId()
Specifies a unique read-only persistent numerical Id for this StructuredDocumentTagRange node.
|
int |
getNodeType()
|
deepClone, getAncestor, getAncestor, getCustomNodeId, getDocument, getNextSibling, getParentNode, getPreviousSibling, getRange, getText, isComposite, memberwiseClone, nextPreOrder, nodeTypeToString, previousPreOrder, remove, setCustomNodeId, toString, toString, toString, visitorActionToBoolpublic StructuredDocumentTagRangeEnd(DocumentBase doc, int id)
Examples:
Shows how to create/remove structured document tag and its content.
public void sdtRangeExtendedMethods() throws Exception
{
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.writeln("StructuredDocumentTag element");
StructuredDocumentTagRangeStart rangeStart = insertStructuredDocumentTagRanges(doc);
// Removes ranged structured document tag, but keeps content inside.
rangeStart.removeSelfOnly();
rangeStart = (StructuredDocumentTagRangeStart)doc.getChild(
NodeType.STRUCTURED_DOCUMENT_TAG_RANGE_START, 0, false);
Assert.assertEquals(null, rangeStart);
StructuredDocumentTagRangeEnd rangeEnd = (StructuredDocumentTagRangeEnd)doc.getChild(
NodeType.STRUCTURED_DOCUMENT_TAG_RANGE_END, 0, false);
Assert.assertEquals(null, rangeEnd);
Assert.assertEquals("StructuredDocumentTag element", doc.getText().trim());
rangeStart = insertStructuredDocumentTagRanges(doc);
Node paragraphNode = rangeStart.getLastChild();
if (paragraphNode != null)
Assert.assertEquals("StructuredDocumentTag element", paragraphNode.getText().trim());
// Removes ranged structured document tag and content inside.
rangeStart.removeAllChildren();
paragraphNode = rangeStart.getLastChild();
Assert.assertEquals("", paragraphNode.getText());
}doc - The owner document.id - Identifier of the corresponding structured document tag range start.public int getNodeType()
getNodeType in class NodeNodeType.STRUCTURED_DOCUMENT_TAG_RANGE_END. The returned value is one of NodeType constants.public boolean accept(DocumentVisitor visitor) throws java.lang.Exception
Remarks:
Enumerates over this node and all of its children. Each node calls a corresponding method on DocumentVisitor.
For more info see the Visitor design pattern.
accept in class Nodevisitor - The visitor that will visit the nodes.DocumentVisitor stopped the operation before visiting all nodes.java.lang.Exceptionpublic int getId()
StructuredDocumentTagRangeStart node has the same StructuredDocumentTagRangeStart.getId().
Examples:
Shows how to get the properties of multi-section structured document tags.
Document doc = new Document(getMyDir() + "Multi-section structured document tags.docx");
StructuredDocumentTagRangeStart rangeStartTag = (StructuredDocumentTagRangeStart) doc.getChildNodes(NodeType.STRUCTURED_DOCUMENT_TAG_RANGE_START, true).get(0);
StructuredDocumentTagRangeEnd rangeEndTag = (StructuredDocumentTagRangeEnd) doc.getChildNodes(NodeType.STRUCTURED_DOCUMENT_TAG_RANGE_END, true).get(0);
System.out.println("StructuredDocumentTagRangeStart values:");
System.out.println(MessageFormat.format("\t|Id: {0}", rangeStartTag.getId()));
System.out.println(MessageFormat.format("\t|Title: {0}", rangeStartTag.getTitle()));
System.out.println(MessageFormat.format("\t|PlaceholderName: {0}", rangeStartTag.getPlaceholderName()));
System.out.println(MessageFormat.format("\t|IsShowingPlaceholderText: {0}", rangeStartTag.isShowingPlaceholderText()));
System.out.println(MessageFormat.format("\t|LockContentControl: {0}", rangeStartTag.getLockContentControl()));
System.out.println(MessageFormat.format("\t|LockContents: {0}", rangeStartTag.getLockContents()));
System.out.println(MessageFormat.format("\t|Level: {0}", rangeStartTag.getLevel()));
System.out.println(MessageFormat.format("\t|NodeType: {0}", rangeStartTag.getNodeType()));
System.out.println(MessageFormat.format("\t|RangeEnd: {0}", rangeStartTag.getRangeEnd()));
System.out.println(MessageFormat.format("\t|Color: {0}", rangeStartTag.getColor()));
System.out.println(MessageFormat.format("\t|SdtType: {0}", rangeStartTag.getSdtType()));
System.out.println(MessageFormat.format("\t|FlatOpcContent: {0}", rangeStartTag.getWordOpenXML()));
System.out.println(MessageFormat.format("\t|Tag: {0}\n", rangeStartTag.getTag()));
System.out.println("StructuredDocumentTagRangeEnd values:");
System.out.println("\t|Id: {rangeEndTag.Id}");
System.out.println("\t|NodeType: {rangeEndTag.NodeType}");
int value.