|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.xeril.xml.Indent
This class encapsulates the notion of indentation. It maintains
internally a 'level' of indentation that you should modify with
inc
or dec
. You can also specify which
characters will be used to display the indentation (most of the time it
will be spaces).
Constructor Summary | |
Indent()
Constructor. |
|
Indent(int level)
Constructor. |
|
Indent(java.lang.String indent_string)
Constructor. |
|
Indent(java.lang.String indent_string,
int level)
Constructor. |
Method Summary | |
void |
dec()
Decrements the level of indentation |
java.lang.String |
getIndentation()
Returns the indentation depending on the level. |
java.lang.String |
getIndentString()
Access function. |
int |
getLevel()
Access function. |
void |
inc()
Increments the level of indentation |
static java.lang.String |
indentBlock(java.lang.String block,
Indent indent)
Indents a block of text. |
void |
setIndentString(java.lang.String indent_string)
Access function. |
void |
setLevel(int level)
Access function. |
java.lang.String |
toString()
Convenient method : returns the indentation depending on the level. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Indent()
public Indent(java.lang.String indent_string)
indent_string
- the indentation representationpublic Indent(int level)
level
- the level of indetation to startpublic Indent(java.lang.String indent_string, int level)
indent_string
- the indentation representationlevel
- the level of indetation to startMethod Detail |
public java.lang.String getIndentString()
public void setIndentString(java.lang.String indent_string)
indent_string
- the string representation of the indentationpublic int getLevel()
public void setLevel(int level)
inc
or dec
instead.
level
- the indentation levelpublic void inc()
public void dec()
public java.lang.String getIndentation()
public java.lang.String toString()
toString
in class java.lang.Object
public static java.lang.String indentBlock(java.lang.String block, Indent indent)
block
- the block of text to indentindent
- the indentation object to use
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |