Package gnu.kawa.sax
Class ContentConsumer
- java.lang.Object
-
- gnu.kawa.sax.ContentConsumer
-
- All Implemented Interfaces:
Consumer
,Appendable
,Consumer<Object>
,DoubleConsumer
,IntConsumer
,LongConsumer
- Direct Known Subclasses:
KawaXMLReader
public class ContentConsumer extends Object implements Consumer
Forward Consumer events to a SAX2 ContentHandler.
-
-
Constructor Summary
Constructors Constructor Description ContentConsumer()
ContentConsumer(ContentHandler handler)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ContentConsumer
append(char c)
ContentConsumer
append(CharSequence csq)
ContentConsumer
append(CharSequence csq, int start, int end)
void
endAttribute()
End of an attribute or end of an actual parameter.void
endDocument()
void
endElement()
void
endStartTag()
void
error(String method, SAXException ex)
void
finalize()
ContentHandler
getContentHandler()
boolean
ignoring()
True if consumer is ignoring rest of element.void
setContentHandler(ContentHandler handler)
void
startAttribute(Object attrType)
Write a attribute for the current element.void
startDocument()
void
startElement(Object type)
void
write(char[] buf, int off, int len)
void
write(int v)
void
write(CharSequence str, int start, int length)
void
write(String v)
void
writeBoolean(boolean v)
void
writeDouble(double v)
void
writeFloat(float v)
void
writeInt(int v)
void
writeLong(long v)
void
writeObject(Object v)
-
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.function.DoubleConsumer
andThen
-
Methods inherited from interface java.util.function.IntConsumer
andThen
-
Methods inherited from interface java.util.function.LongConsumer
andThen
-
-
-
-
Constructor Detail
-
ContentConsumer
public ContentConsumer()
-
ContentConsumer
public ContentConsumer(ContentHandler handler)
-
-
Method Detail
-
error
public void error(String method, SAXException ex)
-
endStartTag
public void endStartTag()
-
startElement
public void startElement(Object type)
- Specified by:
startElement
in interfaceConsumer
-
startAttribute
public void startAttribute(Object attrType)
Description copied from interface:Consumer
Write a attribute for the current element. This is only allowed immediately after a startElement.- Specified by:
startAttribute
in interfaceConsumer
-
endAttribute
public void endAttribute()
Description copied from interface:Consumer
End of an attribute or end of an actual parameter. The former use matches a startAttribute; the latter may not, and can be used to separate parameters in a parameter list. This double duty suggsts the method should at least be re-named.- Specified by:
endAttribute
in interfaceConsumer
-
startDocument
public void startDocument()
- Specified by:
startDocument
in interfaceConsumer
-
endDocument
public void endDocument()
- Specified by:
endDocument
in interfaceConsumer
-
endElement
public void endElement()
- Specified by:
endElement
in interfaceConsumer
-
write
public void write(CharSequence str, int start, int length)
-
append
public ContentConsumer append(char c)
- Specified by:
append
in interfaceAppendable
- Specified by:
append
in interfaceConsumer
-
append
public ContentConsumer append(CharSequence csq)
- Specified by:
append
in interfaceAppendable
- Specified by:
append
in interfaceConsumer
-
append
public ContentConsumer append(CharSequence csq, int start, int end)
- Specified by:
append
in interfaceAppendable
- Specified by:
append
in interfaceConsumer
-
writeObject
public void writeObject(Object v)
- Specified by:
writeObject
in interfaceConsumer
-
writeBoolean
public void writeBoolean(boolean v)
- Specified by:
writeBoolean
in interfaceConsumer
-
writeFloat
public void writeFloat(float v)
- Specified by:
writeFloat
in interfaceConsumer
-
writeDouble
public void writeDouble(double v)
- Specified by:
writeDouble
in interfaceConsumer
-
ignoring
public boolean ignoring()
Description copied from interface:Consumer
True if consumer is ignoring rest of element. The producer can use this information to skip ahead.
-
setContentHandler
public void setContentHandler(ContentHandler handler)
-
getContentHandler
public ContentHandler getContentHandler()
-
-