|
||||||||||
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.SignificantInlineChecker
public final class SignificantInlineChecker
Checks whether elements that require significant inline content have it.
Nested Class Summary | |
---|---|
(package private) class |
SignificantInlineChecker.StackNode
Inner class for wrapping a mutable boolean in an object. |
Field Summary | |
---|---|
private static com.ibm.icu.text.UnicodeSet |
INSIGNIFICANT_CHARACTERS
A thread-safe set of insignificant chacarcters. |
private boolean |
needToCheck
Indicates whether checking for significant inline content is necessary. |
private char |
prev
A holder for the previous UTF-16 code unit for dealing with high surrogates. |
private static String[] |
REQUIRE_SIGNIFICANT_CONTENT
A lexicographically sorted array of names of XHTML elements that require significant inline content. |
private static String[] |
SIGNIFICANT_ELEMENTS
A lexicographically sorted array of names of XHTML elements that count as significant inline content. |
private LinkedList<SignificantInlineChecker.StackNode> |
stack
The stack for keeping track of which elements have already had significant inline content. |
Constructor Summary | |
---|---|
SignificantInlineChecker()
Constructor. |
Method Summary | |
---|---|
void |
characters(char[] ch,
int start,
int length)
|
void |
endElement(String uri,
String localName,
String qName)
|
private static boolean |
isSignificantCharacter(int c)
Returns true if teh argument is a significant character. |
private static boolean |
isSignificantElement(String localName)
Returns true if the argument names an XHTML element that
counts as significant inline content. |
private void |
markSignificant()
Marks the currently open elements as having significant inline content. |
private static boolean |
requiresSignificantContent(String localName)
Returns true if the argument names an XHTML element that
requires significant inline content. |
void |
reset()
Does nothing. |
void |
startElement(String uri,
String localName,
String qName,
Attributes atts)
|
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 static final com.ibm.icu.text.UnicodeSet INSIGNIFICANT_CHARACTERS
private static final String[] SIGNIFICANT_ELEMENTS
private static final String[] REQUIRE_SIGNIFICANT_CONTENT
private LinkedList<SignificantInlineChecker.StackNode> stack
private boolean needToCheck
private char prev
Constructor Detail |
---|
public SignificantInlineChecker()
Method Detail |
---|
private static boolean isSignificantElement(String localName)
true
if the argument names an XHTML element that
counts as significant inline content.
localName
- name of an HTML element
true
if the argument names an XHTML element that
counts as significant inline contentprivate static boolean requiresSignificantContent(String localName)
true
if the argument names an XHTML element that
requires significant inline content.
localName
- name of an HTML element
true
if the argument names an XHTML element that
requires significant inline contentprivate static boolean isSignificantCharacter(int c)
true
if teh argument is a significant character.
c
- a Unicode code point
true
if teh argument is a significant characterpublic 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)
private void markSignificant()
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 |