public class SAXEventQueue extends Object implements ContentHandler, LexicalHandler, ErrorHandler, SAXEventStream
ContentHandler
(for receiving open tags, close tags, character data
and processing instructions),
LexicalHandler
(for receiving comments), and
ErrorHandler
.SAXEventStream
, which must be actively
polled by a consumer process, and supports to set a ErrorHandler
,
to which the incoming errors are transparently propagated.
ArrayBlockingQueue
,
the other a
LinkedBlockingQueue
.
ContentHandler
interface,
the consumer the eu.bandm.tools.util.SAXEventStream
interface.
drainTo()
.
SAXEventStream.EtherealMatcher, SAXEventStream.MatchException
Constructor and Description |
---|
SAXEventQueue() |
SAXEventQueue(int size) |
Modifier and Type | Method and Description |
---|---|
void |
characters(char[] data,
int offset,
int length) |
void |
clear()
FIXME benötigt??
|
void |
comment(char[] ch,
int start,
int length) |
void |
consume()
Must only be called after (at least) one invocation of
lookahead() . |
String |
consumeCharacters()
Consumes any chararcter data event, and returns the data.
|
void |
consumedEthereals(SAXEventStream.EtherealMatcher matcher)
Visits all ethereals which have been colleced immediately PRECEDING the last
consumed event (start tag/end tag/char data/end of document)
Visit them in source text order (=reverse order of the linked list).
|
void |
drainTo(ContentHandler drain) |
void |
dump(PrintStream os) |
void |
endCDATA() |
void |
endDocument()
Write the last tag (a close tag) to the queue, because now it must have
all its Ethereals.
|
void |
endDTD() |
void |
endElement(String uri,
String name,
String qName) |
void |
endEntity(String name) |
void |
endPrefixMapping(String prefix) |
void |
error(SAXParseException e) |
void |
fatalError(SAXParseException e) |
Attributes |
getAttributes() |
@Opt XMLDocumentIdentifier |
getDocumentId()
CHECK FIXME ist das wirklich "public" notwendig?
|
ErrorHandler |
getErrorHandler() |
String |
getLocalName()
Returns the local name of the current head, i.e.
|
Location<XMLDocumentIdentifier> |
getLocation()
Delivers the location of the current NEXT Event, i.e.
|
NamespaceName |
getNamespaceName()
Returns the namespace name of the current head, i.e.
|
String |
getNamespaceURI()
Returns the namespace URI of the current head, i.e.
|
String |
getQualifiedName()
Returns the qualified name of the current head, i.e.
|
String |
headToString()
Returns the conventional textual representation of the current head.
|
void |
ignorableWhitespace(char[] data,
int offset,
int length) |
boolean |
lookaheadCharacters()
Returns whether the next SAX event represents character data.
|
boolean |
lookaheadEndDocument()
Returns whether the next SAX event is the "End of Document" element.
|
boolean |
lookaheadEndElement()
Returns whether the next SAX event is any end element event
(= close element tag)
|
boolean |
lookaheadEndElement(NamespaceName name)
Returns whether the next SAX event is a certain end element event
(= close element tag)
|
boolean |
lookaheadEndElement(String qname)
Returns whether the next SAX event is a certain end element event
(= close element tag)
|
boolean |
lookaheadStartElement()
Returns whether the next SAX event is any start element event
(= open element tag)
|
boolean |
lookaheadStartElement(NamespaceName name)
Returns whether the next SAX event is a certain start element event
(= open element tag)
|
boolean |
lookaheadStartElement(String qname)
Returns whether the next SAX event is a certain start element event
(= open element tag)
|
Location<XMLDocumentIdentifier> |
matchedEtherealLocation() |
void |
matchEndDocument()
Consumes the first element (if it is the indicated end document element).
|
void |
matchEndElement(NamespaceName name)
Consumes the first element (if it is the indicated end element).
|
void |
matchEndElement(String name)
Consumes the first element (if it is the indicated end element).
|
Attributes |
matchStartElement(NamespaceName name)
Consumes the first element (if it is the indicated start element) and
returns its attribute set.
|
Attributes |
matchStartElement(String qname)
Consumes the first element (if it is the indicated start element) and
returns its attribute set.
|
void |
processingInstruction(String target,
String body) |
protected void |
readInterrupted() |
void |
setDocumentLocator(Locator locator) |
void |
setErrorHandler(ErrorHandler errorHandler) |
void |
sink()
FIXME DOKU WAS SOLL DAS ?
|
void |
skippedEntity(String name) |
void |
startCDATA() |
void |
startDocument() |
void |
startDTD(String name,
String publicId,
String systemId) |
void |
startElement(String uri,
String name,
String qName,
Attributes atts) |
void |
startEntity(String name) |
void |
startPrefixMapping(String prefix,
String uri) |
void |
warning(SAXParseException e) |
protected void |
writeInterrupted() |
public SAXEventQueue()
public SAXEventQueue(int size)
public void setErrorHandler(ErrorHandler errorHandler)
public ErrorHandler getErrorHandler()
public void clear()
public void sink()
public void dump(PrintStream os)
protected void readInterrupted()
protected void writeInterrupted()
public void characters(char[] data, int offset, int length)
characters
in interface ContentHandler
public void startDocument()
startDocument
in interface ContentHandler
public void endDocument()
endDocument
in interface ContentHandler
public void startPrefixMapping(String prefix, String uri)
startPrefixMapping
in interface ContentHandler
public void endPrefixMapping(String prefix)
endPrefixMapping
in interface ContentHandler
public void ignorableWhitespace(char[] data, int offset, int length)
ignorableWhitespace
in interface ContentHandler
public void processingInstruction(String target, String body)
processingInstruction
in interface ContentHandler
public void skippedEntity(String name)
skippedEntity
in interface ContentHandler
public void setDocumentLocator(Locator locator)
setDocumentLocator
in interface ContentHandler
public void startElement(String uri, String name, String qName, Attributes atts)
startElement
in interface ContentHandler
public void endElement(String uri, String name, String qName)
endElement
in interface ContentHandler
public void comment(char[] ch, int start, int length)
comment
in interface LexicalHandler
public void endCDATA()
endCDATA
in interface LexicalHandler
public void endDTD()
endDTD
in interface LexicalHandler
public void endEntity(String name)
endEntity
in interface LexicalHandler
public void startCDATA()
startCDATA
in interface LexicalHandler
public void startDTD(String name, String publicId, String systemId)
startDTD
in interface LexicalHandler
public void startEntity(String name)
startEntity
in interface LexicalHandler
public void warning(SAXParseException e) throws SAXException
warning
in interface ErrorHandler
SAXException
public void error(SAXParseException e) throws SAXException
error
in interface ErrorHandler
SAXException
public void fatalError(SAXParseException e) throws SAXException
fatalError
in interface ErrorHandler
SAXException
public boolean lookaheadCharacters()
SAXEventStream
lookaheadCharacters
in interface SAXEventStream
public boolean lookaheadStartElement(NamespaceName name)
SAXEventStream
lookaheadStartElement
in interface SAXEventStream
public boolean lookaheadStartElement(String qname)
SAXEventStream
lookaheadStartElement
in interface SAXEventStream
public boolean lookaheadStartElement()
SAXEventStream
lookaheadStartElement
in interface SAXEventStream
public Attributes matchStartElement(NamespaceName name) throws SAXEventStream.MatchException
SAXEventStream
matchStartElement
in interface SAXEventStream
SAXEventStream.MatchException
public Attributes matchStartElement(String qname) throws SAXEventStream.MatchException
SAXEventStream
matchStartElement
in interface SAXEventStream
SAXEventStream.MatchException
public boolean lookaheadEndElement(NamespaceName name)
SAXEventStream
lookaheadEndElement
in interface SAXEventStream
public boolean lookaheadEndElement(String qname)
SAXEventStream
lookaheadEndElement
in interface SAXEventStream
public boolean lookaheadEndElement()
SAXEventStream
lookaheadEndElement
in interface SAXEventStream
public void matchEndElement(NamespaceName name) throws SAXEventStream.MatchException
SAXEventStream
matchEndElement
in interface SAXEventStream
SAXEventStream.MatchException
public void matchEndElement(String name) throws SAXEventStream.MatchException
SAXEventStream
matchEndElement
in interface SAXEventStream
SAXEventStream.MatchException
public boolean lookaheadEndDocument()
SAXEventStream
lookaheadEndDocument
in interface SAXEventStream
public void matchEndDocument() throws SAXEventStream.MatchException
SAXEventStream
matchEndDocument
in interface SAXEventStream
SAXEventStream.MatchException
public String consumeCharacters()
SAXEventStream
consumeCharacters
in interface SAXEventStream
public Attributes getAttributes()
public String getNamespaceURI()
SAXEventStream
getNamespaceURI
in interface SAXEventStream
public String getLocalName()
SAXEventStream
getLocalName
in interface SAXEventStream
public String getQualifiedName()
SAXEventStream
getQualifiedName
in interface SAXEventStream
public NamespaceName getNamespaceName()
SAXEventStream
getNamespaceName
in interface SAXEventStream
public final void consume()
lookahead()
.
Afterwards, lookahead()
may may block again.
GLO OUT consumedEtherealsconsume
in interface SAXEventStream
public void consumedEthereals(SAXEventStream.EtherealMatcher matcher)
consumedEthereals
in interface SAXEventStream
public Location<XMLDocumentIdentifier> matchedEtherealLocation()
matchedEtherealLocation
in interface SAXEventStream
@Opt public @Opt XMLDocumentIdentifier getDocumentId()
public Location<XMLDocumentIdentifier> getLocation()
getLocation
in interface SAXEventStream
public String headToString()
SAXEventStream
headToString
in interface SAXEventStream
public void drainTo(ContentHandler drain) throws SAXException
SAXException
see also the complete user documentation .