public class DefaultNodeFormatter extends Object implements NodeFormatter
NodeFormatter
interface.Modifier and Type | Field and Description |
---|---|
protected String[] |
ebrackets
Open [0] and close [1] brackets for element indexes.
|
protected String[] |
kbrackets
Open [0] and close [1] brackets for key indexes.
|
protected String |
separator
Path separator.
|
DEFAULT
Constructor and Description |
---|
DefaultNodeFormatter(String separator)
Constructs a new
DefaultNodeFormatter with the specified
path separator. |
DefaultNodeFormatter(String separator,
String[] ebrackets,
String[] kbrackets)
Constructs a new
DefaultNodeFormatter with the specified
path separator and index brackets. |
Modifier and Type | Method and Description |
---|---|
protected void |
appendIndex(ViolationException node,
StringBuilder buf)
Appends index value of the specified violation node to the specified
path buffer.
|
void |
appendNode(ViolationException node,
StringBuilder buf)
Appends the specified violation node to the specified path buffer.
|
void |
appendSeparator(StringBuilder buf)
Appends path separator to the specified path buffer.
|
protected final String separator
protected final String[] ebrackets
protected final String[] kbrackets
public DefaultNodeFormatter(String separator)
DefaultNodeFormatter
with the specified
path separator.separator
- Path separator.public DefaultNodeFormatter(String separator, String[] ebrackets, String[] kbrackets)
DefaultNodeFormatter
with the specified
path separator and index brackets.separator
- Path separator.ebrackets
- Open [0] and close [1] brackets for element indexes.kbrackets
- Open [0] and close [1] brackets for key indexes.public void appendSeparator(StringBuilder buf)
appendSeparator
in interface NodeFormatter
buf
- Path buffer to append.public void appendNode(ViolationException node, StringBuilder buf)
appendNode
in interface NodeFormatter
node
- Node to be appended.buf
- Path buffer to append.protected void appendIndex(ViolationException node, StringBuilder buf)
node
- Node which index to be appended.buf
- Path buffer to append.Copyright © 2011–2020 FoxLabs. All rights reserved.