gnu.lists

Class FilterConsumer

Implemented Interfaces:
Consumer
Known Direct Subclasses:
HttpPrinter, NamedChildrenFilter, OrderedTuples, RelativeStepFilter, VoidConsumer

public class FilterConsumer
extends java.lang.Object
implements Consumer

A Consumer that wraps some other Consumer.

Field Summary

protected Object
attributeType
The 'attribute type' from the most recent startAttribute.
protected Consumer
base
protected boolean
inAttribute
We seen a startAttribute but not the closing endAttribute.
protected boolean
skipping

Constructor Summary

FilterConsumer(Consumer base)

Method Summary

protected void
beforeContent()
void
endAttribute()
End of an attribute or end of an actual parameter.
void
endDocument()
void
endElement()
boolean
ignoring()
True if consumer is ignoring rest of element.
void
startAttribute(Object attrType)
Write a attribute for the current element.
void
startDocument()
void
startElement(Object type)
void
write(CharSequence str, int start, int length)
void
write(String str)
void
write(char[] buf, int off, int len)
void
write(int 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)

Field Details

attributeType

protected Object attributeType
The 'attribute type' from the most recent startAttribute.

base

protected Consumer base

inAttribute

protected boolean inAttribute
We seen a startAttribute but not the closing endAttribute.

skipping

protected boolean skipping

Constructor Details

FilterConsumer

public FilterConsumer(Consumer base)

Method Details

beforeContent

protected void beforeContent()

endAttribute

public void endAttribute()
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 interface Consumer

endDocument

public void endDocument()
Specified by:
endDocument in interface Consumer

endElement

public void endElement()
Specified by:
endElement in interface Consumer

ignoring

public boolean ignoring()
True if consumer is ignoring rest of element. The producer can use this information to skip ahead.
Specified by:
ignoring in interface Consumer

startAttribute

public void startAttribute(Object attrType)
Write a attribute for the current element. This is only allowed immediately after a startElement.
Specified by:
startAttribute in interface Consumer

startDocument

public void startDocument()
Specified by:
startDocument in interface Consumer

startElement

public void startElement(Object type)
Specified by:
startElement in interface Consumer

write

public void write(CharSequence str,
                  int start,
                  int length)
Specified by:
write in interface Consumer

write

public void write(String str)
Specified by:
write in interface Consumer

write

public void write(char[] buf,
                  int off,
                  int len)
Specified by:
write in interface Consumer

write

public void write(int v)
Specified by:
write in interface Consumer

writeBoolean

public void writeBoolean(boolean v)
Specified by:
writeBoolean in interface Consumer

writeDouble

public void writeDouble(double v)
Specified by:
writeDouble in interface Consumer

writeFloat

public void writeFloat(float v)
Specified by:
writeFloat in interface Consumer

writeInt

public void writeInt(int v)
Specified by:
writeInt in interface Consumer

writeLong

public void writeLong(long v)
Specified by:
writeLong in interface Consumer

writeObject

public void writeObject(Object v)
Specified by:
writeObject in interface Consumer