|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnu.validator.htmlparser.impl.NormalizationChecker
public final class NormalizationChecker
| Field Summary | |
|---|---|
private boolean |
alreadyComplainedAboutThisRun
Indicates whether the current run has already caused an error. |
private boolean |
atStartOfRun
Indicates whether the checker the next call to characters()
is the first call in a run. |
private char[] |
buf
A buffer for holding sequences overlap the SAX buffer boundary. |
private char[] |
bufHolder
A holder for the original buffer (for the memory leak prevention mechanism). |
private static com.ibm.icu.text.UnicodeSet |
COMPOSING_CHARACTERS
A thread-safe set of composing characters as per Charmod Norm. |
private ErrorHandler |
errorHandler
|
private Locator |
locator
|
private int |
pos
The current used length of the buffer, i.e. |
| Constructor Summary | |
|---|---|
NormalizationChecker(Locator locator)
Constructor with mode selection. |
|
| Method Summary | |
|---|---|
private void |
appendToBuf(char[] ch,
int start,
int end)
Appends a slice of an UTF-16 code unit array to the internal buffer. |
void |
characters(char[] ch,
int start,
int length)
|
void |
end()
|
void |
err(String message)
Emit an error. |
private void |
errAboutTextRun()
Emits an error stating that the current text run or the source text is not in NFC. |
private static boolean |
isComposingChar(int c)
Returns true if the argument is a composing character
and false otherwise. |
private static boolean |
isComposingCharOrSurrogate(char c)
Returns true if the argument is a composing BMP character
or a surrogate and false otherwise. |
void |
setErrorHandler(ErrorHandler errorHandler)
|
void |
start()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private ErrorHandler errorHandler
private Locator locator
private static final com.ibm.icu.text.UnicodeSet COMPOSING_CHARACTERS
private char[] buf
private char[] bufHolder
private int pos
private boolean atStartOfRun
characters()
is the first call in a run.
private boolean alreadyComplainedAboutThisRun
| Constructor Detail |
|---|
public NormalizationChecker(Locator locator)
sourceTextMode - whether the source text-related messages
should be enabled.| Method Detail |
|---|
public void err(String message)
throws SAXException
message - the error message
SAXException - if something goes wrongprivate static boolean isComposingCharOrSurrogate(char c)
true if the argument is a composing BMP character
or a surrogate and false otherwise.
c - a UTF-16 code unit
true if the argument is a composing BMP character
or a surrogate and false otherwiseprivate static boolean isComposingChar(int c)
true if the argument is a composing character
and false otherwise.
c - a Unicode code point
true if the argument is a composing character
false otherwisepublic void start()
start in interface CharacterHandlerCharacterHandler.start()
public void characters(char[] ch,
int start,
int length)
throws SAXException
characters in interface CharacterHandlerSAXExceptionCharacterHandler.characters(char[], int, int)
private void errAboutTextRun()
throws SAXException
SAXException - if the ErrorHandler throws
private void appendToBuf(char[] ch,
int start,
int end)
ch - the array from which to copystart - the index of the first element that is copiedend - the index of the first element that is not copied
public void end()
throws SAXException
end in interface CharacterHandlerSAXExceptionCharacterHandler.end()public void setErrorHandler(ErrorHandler errorHandler)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||