Method | Description | |
---|---|---|
Create ( ) : String |
This is used to create an indent which can later be pushed on to the stack. If the number of spaces to be added is zero then this will return a single character string with a line feed.
|
|
Indent ( int index ) : String |
This is used to acquire the indent at the specified index. If the indent does not exist at the specified index then on is created using the current value of the indent. The very first indent taken from this will be an empty string value.
|
|
Indenter ( |
Constructor for the
|
|
Pop ( ) : String |
This is used to pop an indent from the cache. This reduces the length of the current indent and is typically used when an end tag is added to an XML document. If the number of pop requests exceeds the number of push requests then an empty string is returned from this method.
|
|
Push ( ) : String |
This is used to push an indent on to the cache. The first indent created by this is an empty string, this is because an indent is not required for the start of an XML file. If there are multiple roots written to the same writer then the start and end tags of a root element will exist on the same line.
|
|
Top ( ) : String |
This returns the current indent for this indenter. This should be used to write elements or comments that should be at the same indentation level as the XML element that will follow.
|
Method | Description | |
---|---|---|
Indenter ( |
Constructor for the
|
public Indent ( int index ) : String | ||
index | int | /// this is the index to acquire the indent from /// |
return | String |
public Indenter ( |
||
format | /// determines the number of spaces per indent /// | |
return | System |