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 ContentConsumerappend(char c)ContentConsumerappend(CharSequence csq)ContentConsumerappend(CharSequence csq, int start, int end)voidendAttribute()End of an attribute or end of an actual parameter.voidendDocument()voidendElement()voidendStartTag()voiderror(String method, SAXException ex)voidfinalize()ContentHandlergetContentHandler()booleanignoring()True if consumer is ignoring rest of element.voidsetContentHandler(ContentHandler handler)voidstartAttribute(Object attrType)Write a attribute for the current element.voidstartDocument()voidstartElement(Object type)voidwrite(char[] buf, int off, int len)voidwrite(int v)voidwrite(CharSequence str, int start, int length)voidwrite(String v)voidwriteBoolean(boolean v)voidwriteDouble(double v)voidwriteFloat(float v)voidwriteInt(int v)voidwriteLong(long v)voidwriteObject(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:
startElementin interfaceConsumer
-
startAttribute
public void startAttribute(Object attrType)
Description copied from interface:ConsumerWrite a attribute for the current element. This is only allowed immediately after a startElement.- Specified by:
startAttributein interfaceConsumer
-
endAttribute
public void endAttribute()
Description copied from interface:ConsumerEnd 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:
endAttributein interfaceConsumer
-
startDocument
public void startDocument()
- Specified by:
startDocumentin interfaceConsumer
-
endDocument
public void endDocument()
- Specified by:
endDocumentin interfaceConsumer
-
endElement
public void endElement()
- Specified by:
endElementin interfaceConsumer
-
write
public void write(CharSequence str, int start, int length)
-
append
public ContentConsumer append(char c)
- Specified by:
appendin interfaceAppendable- Specified by:
appendin interfaceConsumer
-
append
public ContentConsumer append(CharSequence csq)
- Specified by:
appendin interfaceAppendable- Specified by:
appendin interfaceConsumer
-
append
public ContentConsumer append(CharSequence csq, int start, int end)
- Specified by:
appendin interfaceAppendable- Specified by:
appendin interfaceConsumer
-
writeObject
public void writeObject(Object v)
- Specified by:
writeObjectin interfaceConsumer
-
writeBoolean
public void writeBoolean(boolean v)
- Specified by:
writeBooleanin interfaceConsumer
-
writeFloat
public void writeFloat(float v)
- Specified by:
writeFloatin interfaceConsumer
-
writeDouble
public void writeDouble(double v)
- Specified by:
writeDoublein interfaceConsumer
-
ignoring
public boolean ignoring()
Description copied from interface:ConsumerTrue 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()
-
-