gnu.kawa.sax

Class ContentConsumer

Implemented Interfaces:
Attributes, Consumer
Known Direct Subclasses:
KawaXMLReader

public class ContentConsumer
extends java.lang.Object
implements Consumer, Attributes

Forward Consumer events to a SAX2 ContentHandler.

Constructor Summary

ContentConsumer()
ContentConsumer(ContentHandler handler)

Method Summary

void
beginAttribute(String attrName, Object attrType)
Write a attribute for the current group.
void
beginDocument()
void
beginGroup(String typeName, Object type)
void
endAttribute()
void
endDocument()
void
endGroup(String typeName)
void
error(String method, SAXException ex)
void
finalize()
ContentHandler
getContentHandler()
int
getIndex(String qName)
int
getIndex(String uri, String localPart)
int
getLength()
String
getLocalName(int i)
String
getQName(int i)
String
getType(String qName)
String
getType(String uri, String localPart)
String
getType(int i)
String
getURI(int i)
String
getValue(String qName)
String
getValue(String uri, String localPart)
String
getValue(int i)
boolean
ignoring()
True if consumer is ignoring rest of group.
void
setContentHandler(ContentHandler handler)
void
write(char[] buf, int off, int len)
void
writeBoolean(boolean v)
void
writeChar(int v)
void
writeChars(String v)
void
writeDouble(double v)
void
writeFloat(float v)
void
writeInt(int v)
void
writeLong(long v)
void
writeObject(Object v)

Constructor Details

ContentConsumer

public ContentConsumer()

ContentConsumer

public ContentConsumer(ContentHandler handler)

Method Details

beginAttribute

public void beginAttribute(String attrName,
                           Object attrType)
Write a attribute for the current group. This is only allowed immediately after a beginGroup.
Specified by:
beginAttribute in interface Consumer

beginDocument

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

beginGroup

public void beginGroup(String typeName,
                       Object type)
Specified by:
beginGroup in interface Consumer

endAttribute

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

endDocument

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

endGroup

public void endGroup(String typeName)
Specified by:
endGroup in interface Consumer

error

public void error(String method,
                  SAXException ex)

finalize

public void finalize()

getContentHandler

public ContentHandler getContentHandler()

getIndex

public int getIndex(String qName)

getIndex

public int getIndex(String uri,
                    String localPart)

getLength

public int getLength()

getLocalName

public String getLocalName(int i)

getQName

public String getQName(int i)

getType

public String getType(String qName)

getType

public String getType(String uri,
                      String localPart)

getType

public String getType(int i)

getURI

public String getURI(int i)

getValue

public String getValue(String qName)

getValue

public String getValue(String uri,
                       String localPart)

getValue

public String getValue(int i)

ignoring

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

setContentHandler

public void setContentHandler(ContentHandler handler)

write

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

writeBoolean

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

writeChar

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

writeChars

public void writeChars(String v)
Specified by:
writeChars 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