Package ch.njol.skript.config
Class Node
java.lang.Object
ch.njol.skript.config.Node
- Direct Known Subclasses:
EntryNode,SectionNode,SimpleNode,VoidNode
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedprotectedNode(String key, SectionNode parent)protectedNode(String key, String comment, SectionNode parent, int lineNum) -
Method Summary
Modifier and TypeMethodDescriptionbooleandebug()protected @Nullable Stringprotected String@Nullable StringgetKey()Key of this node.intgetLine()@Nullable SectionNodebooleanisVoid()voidmove(SectionNode newParent)voidremove()Removes this node from its parent.voidsave()voidsave(PrintWriter w)static NonNullPair<String,String>Splits a line into value and comment.toString()returns information about this node which looks like the following:
node value #including comments (config.sk, line xyz)
-
Field Details
-
key
-
comment
-
lineNum
protected final int lineNum -
parent
-
config
-
-
Constructor Details
-
Node
-
Node
-
Node
-
-
Method Details
-
getKey
Key of this node. null for empty or invalid nodes, and the config's main node. -
getConfig
-
rename
-
move
-
splitLine
Splits a line into value and comment.Whitespace is preserved (whitespace in front of the comment is added to the value), and any ## in the value are replaced by a single #. The comment is returned with a leading #, except if there is no comment in which case it will be the empty string.
- Parameters:
line-- Returns:
- A pair (value, comment).
-
getComment
-
getIndentation
-
save
-
save
-
getParent
-
remove
public void remove()Removes this node from its parent. Does nothing if this node does not have a parent node. -
getLine
public int getLine()- Returns:
- Original line of this node at the time it was loaded. -1 if this node was created dynamically.
-
isVoid
public boolean isVoid()- Returns:
- Whether this node does not hold information (i.e. is empty or invalid)
-
toString
returns information about this node which looks like the following:
node value #including comments (config.sk, line xyz) -
debug
public boolean debug()
-