The ResultFormatter class used by the RuleProcessor to
send results to. This class wraps a ResultHandler and
does some common processing, such as namespace
management.
attribute
public void attribute(String name,
String value,
String nsURI)
Adds the given attribute to the result tree if attributes
are allowed at the given time
name
- the name of the attributevalue
- the value of the attribute
attsAllowed
public boolean attsAllowed()
Returns true if an attribute can be successfully added
to the current node.
- true if an attribute can be successfully added
to the current node.
cdata
public void cdata(String data)
Signals a block of CDATA content.
data
- the CDATA section content
cdata
public void cdata(char[] chars,
int start,
int length)
Signals a block of CDATA content.
chars
- a char[] containing the CDATA section contentstart
- the start offset into the char[]length
- the number of characters
characters
public void characters(String data)
Signals a block of character content.
data
- the character content
characters
public void characters(char[] chars,
int start,
int length)
Signals a block of character content.
chars
- a char[] containing the charactersstart
- the starting index into the char[]length
- the number of characters
comment
public void comment(String data)
Signals to recieve a comment.
declareNamespace
public void declareNamespace(String prefix,
String uri)
Declares the given namespace, the namespace will
be added to the next element.
endElement
public void endElement(String name,
String nsURI)
Signals the end of the current element.
name
- the name of the element
entityReference
public void entityReference(String name)
Signals to recieve an entity reference with the given name.
name
- the name of the entity reference
flush
public void flush()
The processor state doesn't always send data to the Formatter,
until necessary. This method will force a "flush" of any saved
data.
getResultHandler
public ResultHandler getResultHandler()
Returns the ResultHandler being used by this ResultFormatter.
- the ResultHandler being used by this ResultFormatter
ignorableWhitespace
public void ignorableWhitespace(char[] chars,
int start,
int length)
Signals the start of ignorable whitespace characters.
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
isNamespaceDeclared
public boolean isNamespaceDeclared(String namespace)
Returns true if the given namespace has been
declared.
namespace
- the namespace to check the declaration for
- true if the given namespace has been
declared
processingInstruction
public void processingInstruction(String target,
String data)
Signals to receive the processing instruction.
target
- data
-
startElement
public void startElement(String name,
String nsURI)
Signals the start of an element.
name
- the name of the element, this must
be the local name of the element. Any prefixes
will be automatically stripped.
unescapedCharacters
public void unescapedCharacters(String data)
Signals to receive characters which should not be escaped.
data
- the character data to receive
unescapedCharacters
public void unescapedCharacters(char[] chars,
int start,
int length)
Signals to receive characters which should not be escaped.
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