|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object fi.iki.hsivonen.xml.checker.Checker fi.iki.hsivonen.xml.checker.TextContentChecker
public final class TextContentChecker
Checks the textContent
of elements whose
textContent
need special non-schema treatment. To smooth code
reuse between a conformance checker and editors that only allow RELAX NG plus
custom datatypes, this class uses objects that implement
DatatypeStreamingValidator
.
Examples of elements handled by this class are time
,
meter
and progress
.
Field Summary | |
---|---|
private LinkedList<DatatypeStreamingValidator> |
stack
The stack of DatatypeStreamingValidator s corresponding to
open elements. |
Constructor Summary | |
---|---|
TextContentChecker()
Constructor. |
Method Summary | |
---|---|
void |
characters(char[] ch,
int start,
int length)
|
void |
endElement(String uri,
String localName,
String qName)
|
void |
reset()
Does nothing. |
void |
startElement(String uri,
String localName,
String qName,
Attributes atts)
|
private DatatypeStreamingValidator |
streamingValidatorFor(String uri,
String localName,
Attributes atts)
Returns a DatatypeStreamingValidator for the element if it
needs textContent checking or null if it does
not. |
Methods inherited from class fi.iki.hsivonen.xml.checker.Checker |
---|
endDocument, endPrefixMapping, err, getDocumentLocator, getErrorHandler, ignorableWhitespace, processingInstruction, setDocumentLocator, setErrorHandler, skippedEntity, startDocument, startPrefixMapping, warn |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final LinkedList<DatatypeStreamingValidator> stack
DatatypeStreamingValidator
s corresponding to
open elements. Stack entry is null
if the corresponding
element does not need textContent
checking. Grows from the
tail.
Constructor Detail |
---|
public TextContentChecker()
Method Detail |
---|
private DatatypeStreamingValidator streamingValidatorFor(String uri, String localName, Attributes atts)
DatatypeStreamingValidator
for the element if it
needs textContent
checking or null
if it does
not.
uri
- the namespace URI of the elementlocalName
- the local name of the elementatts
- the attributes
DatatypeStreamingValidator
or null
if
checks not necessarypublic void characters(char[] ch, int start, int length) throws SAXException
characters
in interface ContentHandler
characters
in class Checker
SAXException
Checker.characters(char[], int, int)
public void endElement(String uri, String localName, String qName) throws SAXException
endElement
in interface ContentHandler
endElement
in class Checker
SAXException
Checker.endElement(java.lang.String,
java.lang.String, java.lang.String)
public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException
startElement
in interface ContentHandler
startElement
in class Checker
SAXException
Checker.startElement(java.lang.String,
java.lang.String, java.lang.String, org.xml.sax.Attributes)
public void reset()
Checker
reset
in class Checker
Checker.reset()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |