public class ResultFormatter extends ErrorObserverAdapter
FATAL, NORMAL, WARNING
Constructor and Description |
---|
ResultFormatter(ResultHandler handler)
Creates a new ResultFormatter using the given ResultHandler
|
Modifier and Type | Method and Description |
---|---|
void |
attribute(java.lang.String name,
java.lang.String value,
java.lang.String nsURI)
Adds the given attribute to the result tree if attributes
are allowed at the given time
|
boolean |
attsAllowed()
Returns true if an attribute can be successfully added
to the current node.
|
void |
cdata(char[] chars,
int start,
int length)
Signals a block of CDATA content.
|
void |
cdata(java.lang.String data)
Signals a block of CDATA content.
|
void |
characters(char[] chars,
int start,
int length)
Signals a block of character content.
|
void |
characters(java.lang.String data)
Signals a block of character content.
|
void |
comment(java.lang.String data)
Signals to recieve a comment.
|
void |
declareNamespace(java.lang.String prefix,
java.lang.String uri)
Declares the given namespace, the namespace will
be added to the next element.
|
void |
endElement(java.lang.String name,
java.lang.String nsURI)
Signals the end of the current element.
|
void |
entityReference(java.lang.String name)
Signals to recieve an entity reference with the given name.
|
void |
flush()
The processor state doesn't always send data to the Formatter,
until necessary.
|
ResultHandler |
getResultHandler()
Returns the ResultHandler being used by this ResultFormatter.
|
void |
ignorableWhitespace(char[] chars,
int start,
int length)
Signals the start of ignorable whitespace characters.
|
boolean |
isNamespaceDeclared(java.lang.String namespace)
Returns true if the given namespace has been
declared.
|
void |
processingInstruction(java.lang.String target,
java.lang.String data)
Signals to receive the processing instruction.
|
void |
startElement(java.lang.String name,
java.lang.String nsURI)
Signals the start of an element.
|
void |
unescapedCharacters(char[] chars,
int start,
int length)
Signals to receive characters which should not be escaped.
|
void |
unescapedCharacters(java.lang.String data)
Signals to receive characters which should not be escaped.
|
addErrorObserver, receiveError, receiveError, receiveError, receiveError, receiveError, receiveError, removeAllErrorObservers, removeErrorObserver
public ResultFormatter(ResultHandler handler)
handler
- the ResultHandler to send data topublic void attribute(java.lang.String name, java.lang.String value, java.lang.String nsURI)
name
- the name of the attributevalue
- the value of the attributepublic boolean attsAllowed()
public void cdata(java.lang.String data)
data
- the CDATA section contentpublic void cdata(char[] chars, int start, int length)
chars
- a char[] containing the CDATA section contentstart
- the start offset into the char[]length
- the number of characterspublic void characters(java.lang.String data)
data
- the character contentpublic void characters(char[] chars, int start, int length)
chars
- a char[] containing the charactersstart
- the starting index into the char[]length
- the number of characterspublic void comment(java.lang.String data)
data,
- the content of the commentpublic void declareNamespace(java.lang.String prefix, java.lang.String uri)
public void endElement(java.lang.String name, java.lang.String nsURI)
name
- the name of the elementpublic void entityReference(java.lang.String name)
name
- the name of the entity referencepublic void flush()
public ResultHandler getResultHandler()
public void ignorableWhitespace(char[] chars, int start, int length)
chars
- the character array containing the characters
to receivestart
- the index into the character array to start receiving
characters atlength
- the number of characters to recievepublic boolean isNamespaceDeclared(java.lang.String namespace)
namespace
- the namespace to check the declaration forpublic void processingInstruction(java.lang.String target, java.lang.String data)
target
- data
- public void startElement(java.lang.String name, java.lang.String nsURI)
name
- the name of the element, this must
be the local name of the element. Any prefixes
will be automatically stripped.public void unescapedCharacters(java.lang.String data)
data
- the character data to receivepublic void unescapedCharacters(char[] chars, int start, int length)
chars
- the character array containing the characters
to receivestart
- the index into the character array to start receiving
characters atlength
- the number of characters to recieve