Interface TemplateElement
- All Known Subinterfaces:
Printable
,TemplateDocument
public interface TemplateElement
Interface representing a node of a
template document
.- Since:
- 4.0.17
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiongetChildAt
(int index) Provides the child element stored at the given index.int
Provides the number of children of this element.int
First column is at index 1.int
First line is at index 1.void
insertChild
(int index, Printable newChild) Insert a child node at the specified index.boolean
isEmpty()
Indicates this element to have no children.void
printSource
(PrintWriter out) Print the source of this template fragment toout
- used for logging of error conditionsvoid
removeChild
(int index) Removes the child node at the specified index.
-
Method Details
-
getSourceLine
int getSourceLine()First line is at index 1.- Returns:
- the first source line number for this element
- Since:
- 4.0.17
-
getSourceColumn
int getSourceColumn()First column is at index 1.- Returns:
- the first source column number for this element
- Since:
- 4.0.17
-
printSource
Print the source of this template fragment toout
- used for logging of error conditions- Parameters:
out
- the print writer where the output is send to- Since:
- 4.0.17
-
insertChild
Insert a child node at the specified index. Please ensure that you do not construct loops!- Parameters:
index
- Index to add element at.newChild
- Child to add.- Since:
- 5.1.4
-
removeChild
void removeChild(int index) Removes the child node at the specified index.- Parameters:
index
- Index to remove element at.- Since:
- 5.1.4
-
getChildCount
int getChildCount()Provides the number of children of this element.- Returns:
- Number of children.
- Since:
- 4.0.17
-
getChildAt
Provides the child element stored at the given index.- Parameters:
index
- The index to look up.- Returns:
- The stored child element.
- Since:
- 4.0.17
-
isEmpty
boolean isEmpty()Indicates this element to have no children.- Returns:
true
, if it has no children.- Since:
- 4.0.17
-