Package gnu.kawa.sax
Class ContentConsumer
- java.lang.Object
-
- gnu.kawa.sax.ContentConsumer
-
- All Implemented Interfaces:
Consumer,java.lang.Appendable,java.util.function.Consumer<java.lang.Object>,java.util.function.DoubleConsumer,java.util.function.IntConsumer,java.util.function.LongConsumer
- Direct Known Subclasses:
KawaXMLReader
public class ContentConsumer extends java.lang.Object implements Consumer
Forward Consumer events to a SAX2 ContentHandler.
-
-
Constructor Summary
Constructors Constructor Description ContentConsumer()ContentConsumer(org.xml.sax.ContentHandler handler)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ContentConsumerappend(char c)ContentConsumerappend(java.lang.CharSequence csq)ContentConsumerappend(java.lang.CharSequence csq, int start, int end)voidendAttribute()End of an attribute or end of an actual parameter.voidendDocument()voidendElement()voidendStartTag()voiderror(java.lang.String method, org.xml.sax.SAXException ex)voidfinalize()org.xml.sax.ContentHandlergetContentHandler()booleanignoring()True if consumer is ignoring rest of element.voidsetContentHandler(org.xml.sax.ContentHandler handler)voidstartAttribute(java.lang.Object attrType)Write a attribute for the current element.voidstartDocument()voidstartElement(java.lang.Object type)voidwrite(char[] buf, int off, int len)voidwrite(int v)voidwrite(java.lang.CharSequence str, int start, int length)voidwrite(java.lang.String v)voidwriteBoolean(boolean v)voidwriteDouble(double v)voidwriteFloat(float v)voidwriteInt(int v)voidwriteLong(long v)voidwriteObject(java.lang.Object v)
-
-
-
Method Detail
-
error
public void error(java.lang.String method, org.xml.sax.SAXException ex)
-
endStartTag
public void endStartTag()
-
startElement
public void startElement(java.lang.Object type)
- Specified by:
startElementin interfaceConsumer
-
startAttribute
public void startAttribute(java.lang.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(java.lang.CharSequence str, int start, int length)
-
append
public ContentConsumer append(char c)
-
append
public ContentConsumer append(java.lang.CharSequence csq)
-
append
public ContentConsumer append(java.lang.CharSequence csq, int start, int end)
-
writeObject
public void writeObject(java.lang.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
-
finalize
public void finalize()
- Overrides:
finalizein classjava.lang.Object
-
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(org.xml.sax.ContentHandler handler)
-
getContentHandler
public org.xml.sax.ContentHandler getContentHandler()
-
-