|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectit.unimi.dsi.parser.callback.DebugCallbackDecorator
public class DebugCallbackDecorator
A decorator that prints on standard error all calls to the underlying callback.
| Field Summary |
|---|
| Fields inherited from interface it.unimi.dsi.parser.callback.Callback |
|---|
EMPTY_CALLBACK_ARRAY |
| Constructor Summary | |
|---|---|
DebugCallbackDecorator(Callback callback)
|
|
| Method Summary | |
|---|---|
boolean |
cdata(Element element,
char[] text,
int offset,
int length)
Receive notification of the content of a CDATA section. |
boolean |
characters(char[] text,
int offset,
int length,
boolean flowBroken)
Receive notification of character data inside an element. |
void |
configure(BulletParser parser)
Configure the parser for usage with this callback. |
void |
endDocument()
Receive notification of the end of the document. |
boolean |
endElement(Element element)
Receive notification of the end of an element. |
boolean |
equals(Object obj)
|
int |
hashCode()
|
void |
startDocument()
Receive notification of the beginning of the document. |
boolean |
startElement(Element element,
Map<Attribute,MutableString> attrMap)
Receive notification of the start of an element. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public DebugCallbackDecorator(Callback callback)
| Method Detail |
|---|
public boolean cdata(Element element,
char[] text,
int offset,
int length)
CallbackCDATA sections in an HTML document are the result of meeting a STYLE or SCRIPT element. In that case, the element will be passed as first argument.
You must not write into text, as it could be passed
around to many callbacks.
cdata in interface Callbackelement - the element enclosing the CDATA section, or null if the
CDATA section was created with explicit markup.text - an array containing the character data.offset - the start position in the array.length - the number of characters to read from the array.
public boolean characters(char[] text,
int offset,
int length,
boolean flowBroken)
CallbackYou must not write into text, as it could be passed
around to many callbacks.
flowBroken will be true iff
the flow was broken before text. This feature makes it possible
to extract quickly the text in a document without looking at the elements.
characters in interface Callbacktext - an array containing the character data.offset - the start position in the array.length - the number of characters to read from the array.flowBroken - whether the flow is broken at the start of text.
public void configure(BulletParser parser)
CallbackWhen a callback is registered with a parser, it needs to set up the parser so that all data required by the callback is actually parsed. The configuration must be a monotone process—you can only set properties and add attribute types to be parsed.
configure in interface Callbackpublic void endDocument()
Callback
endDocument in interface Callbackpublic boolean endElement(Element element)
CallbackThis method will never be called for element without closing tags, even if such a tag is found.
endElement in interface Callbackelement - the element whose closing tag was found.
public boolean equals(Object obj)
equals in class Objectpublic int hashCode()
hashCode in class Objectpublic void startDocument()
CallbackThe callback must use this method to reset its internal state so that it can be resued. It must be safe to invoke this method several times.
startDocument in interface Callback
public boolean startElement(Element element,
Map<Attribute,MutableString> attrMap)
CallbackFor simple elements, this is the only notification that the callback will ever receive.
startElement in interface Callbackelement - the element whose opening tag was found.attrMap - a map from Attributes to MutableStrings.
public String toString()
toString in class Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||