Module io.sf.carte.tokenproducer
Package io.sf.carte.uparser
Interface ContentHandler<E extends Exception>
- All Known Subinterfaces:
- TokenHandler,- TokenHandler2,- TokenHandler3<E>
- All Known Implementing Classes:
- CommentRemovalHandler,- MinificationHandler
public interface ContentHandler<E extends Exception>
To be implemented by listeners that handle the content-related events
 generated by the 
TokenProducer3.- 
Method SummaryModifier and TypeMethodDescriptionvoidcharacter(int index, int codePoint) Other characters including punctuation (excluding connector punctuation) and symbols (Sc, Sm and Sk unicode categories) was found, that was not one of the non-alphanumeric characters allowed in words.voidA commented string was found by the parser.voidendOfStream(int len) The stream that was being parsed reached its end.default voidendPunctuation(int index, int codePoint) Called when end punctuation (Pe) codepoints are found (except characters handled byrightCurlyBracket(int),rightParenthesis(int)andrightSquareBracket(int)).voidescaped(int index, int codePoint) A codepoint preceded with a backslash was found outside of quoted text.voidleftCurlyBracket(int index) Called when the{codepoint is found.voidleftParenthesis(int index) Called when the(codepoint is found.voidleftSquareBracket(int index) Called when the[codepoint is found.voidquoted(int index, CharSequence quoted, int quote) A quoted string was found by the parser.voidquotedWithControl(int index, CharSequence quoted, int quoteCp) A quoted string was found by the parser, and contains high control characters.voidrightCurlyBracket(int index) Called when the}codepoint is found.voidrightParenthesis(int index) Called when the)codepoint is found.voidrightSquareBracket(int index) Called when the]codepoint is found.voidseparator(int index, int codePoint) A separator (Zs, Zl and Zp unicode categories) was found.default voidstartPunctuation(int index, int codePoint) Called when start punctuation (Ps) codepoints are found (except characters handled byleftCurlyBracket(int),leftParenthesis(int)andleftSquareBracket(int)).voidword(int index, CharSequence word) A word was found by the parser (includes connector punctuation).
- 
Method Details- 
wordA word was found by the parser (includes connector punctuation).- Parameters:
- index- the index at which the word was found.
- word- the word.
- Throws:
- E- in case of an error when processing the tokens.
 
- 
separatorvoid separator(int index, int codePoint) throws E A separator (Zs, Zl and Zp unicode categories) was found.- Parameters:
- index- the index at which the separator was found.
- codePoint- the codepoint of the found separator.
- Throws:
- E- in case of an error when processing the tokens.
 
- 
quotedA quoted string was found by the parser.- Parameters:
- index- the index at which the quoted string was found.
- quoted- the quoted sequence of characters, without the quotes.
- quote- the quote character.
- Throws:
- E- in case of an error when processing the tokens.
 
- 
quotedWithControlA quoted string was found by the parser, and contains high control characters.- Parameters:
- index- the index at which the quoted string was found.
- quoted- the quoted sequence of characters, without the quotes.
- quoteCp- the quote character codepoint.
- Throws:
- E- in case of an error when processing the tokens.
 
- 
leftParenthesisvoid leftParenthesis(int index) throws E Called when the(codepoint is found.- Parameters:
- index- the index at which the codepoint was found.
- Throws:
- E- in case of an error when processing the tokens.
 
- 
leftSquareBracketvoid leftSquareBracket(int index) throws E Called when the[codepoint is found.- Parameters:
- index- the index at which the codepoint was found.
- Throws:
- E- in case of an error when processing the tokens.
 
- 
leftCurlyBracketvoid leftCurlyBracket(int index) throws E Called when the{codepoint is found.- Parameters:
- index- the index at which the codepoint was found.
- Throws:
- E- in case of an error when processing the tokens.
 
- 
rightParenthesisvoid rightParenthesis(int index) throws E Called when the)codepoint is found.- Parameters:
- index- the index at which the codepoint was found.
- Throws:
- E- in case of an error when processing the tokens.
 
- 
rightSquareBracketvoid rightSquareBracket(int index) throws E Called when the]codepoint is found.- Parameters:
- index- the index at which the codepoint was found.
- Throws:
- E- in case of an error when processing the tokens.
 
- 
rightCurlyBracketvoid rightCurlyBracket(int index) throws E Called when the}codepoint is found.- Parameters:
- index- the index at which the codepoint was found.
- Throws:
- E- in case of an error when processing the tokens.
 
- 
startPunctuationdefault void startPunctuation(int index, int codePoint) throws E Called when start punctuation (Ps) codepoints are found (except characters handled byleftCurlyBracket(int),leftParenthesis(int)andleftSquareBracket(int)).- Parameters:
- index- the index at which the codepoint was found.
- codePoint- the found codepoint.
- Throws:
- E- in case of an error when processing the tokens.
 
- 
endPunctuationdefault void endPunctuation(int index, int codePoint) throws E Called when end punctuation (Pe) codepoints are found (except characters handled byrightCurlyBracket(int),rightParenthesis(int)andrightSquareBracket(int)).- Parameters:
- index- the index at which the codepoint was found.
- codePoint- the found codepoint.
- Throws:
- E- in case of an error when processing the tokens.
 
- 
charactervoid character(int index, int codePoint) throws E Other characters including punctuation (excluding connector punctuation) and symbols (Sc, Sm and Sk unicode categories) was found, that was not one of the non-alphanumeric characters allowed in words.Symbols in So category are considered part of words and won't be handled by this method. - Parameters:
- index- the index at which the punctuation was found.
- codePoint- the codepoint of the found punctuation.
- Throws:
- E- in case of an error when processing the tokens.
 
- 
escapedvoid escaped(int index, int codePoint) throws E A codepoint preceded with a backslash was found outside of quoted text.- Parameters:
- index- the index at which the escaped codepoint was found.
- codePoint- the escaped codepoint.
- Throws:
- E- in case of an error when processing the tokens.
 
- 
commentedA commented string was found by the parser.- Parameters:
- index- the index at which the commented string was found.
- commentType- the type of comment.
- comment- the commented string.
- Throws:
- E- in case of an error when processing the tokens.
 
- 
endOfStreamvoid endOfStream(int len) throws E The stream that was being parsed reached its end.- Parameters:
- len- the length of the processed stream.
- Throws:
- E- in case of an error when processing the tokens.
 
 
-