|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.starlink.ttools.votlint.ElementHandler
public class ElementHandler
Provides checking of a VOTable element during a SAX parse.
There is one ElementHandler for each element encountered by the SAX
parser; it is manipulated chiefly by the VotLintContentHandler
which
calls various methods on it in a controlled sequence as its life
cycle progresses to handle the current state of the parse.
Element-specific subclasses should generally override only the
startElement()
, endElement()
and characters(char[], int, int)
methods, which are invoked by the ContentHandler's similarly named
methods.
The checking done by an ElementHandler does not attempt to repeat or replace that done by validating against a DTD, it provides additional semantic checks based on what it knows about VOTables.
Constructor Summary | |
---|---|
ElementHandler()
|
Method Summary | |
---|---|
void |
characters(char[] ch,
int start,
int length)
Called when character content is found in the element. |
void |
configure(String localName,
VotLintContext context)
Sets this handler up ready for use. |
void |
endElement()
Called when the element has ended. |
void |
error(String msg)
Writes an error message through the context. |
Ancestry |
getAncestry()
Returns an object containing the family relationships of this handler. |
String |
getAttribute(String name)
Returns the value of a named attribute. |
VotLintContext |
getContext()
Returns this handler's context. |
String |
getName()
Returns the localName for this element. |
ElementRef |
getRef()
Returns a reference for this element. |
void |
info(String msg)
Writes an info message through the context. |
void |
registerChildName(ElementRef child,
String name)
Called to indicate that a child of this element has a "name" attribute. |
void |
setAncestry(Ancestry ancestry)
Sets the ancestry of this handler. |
void |
setAttributes(Map atts)
Sets this handler's attributes. |
void |
startElement()
Called after the attributes have been set and checked. |
String |
toString()
|
void |
warning(String msg)
Writes a warning message through the context. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ElementHandler()
Method Detail |
---|
public void configure(String localName, VotLintContext context)
localName
- local name of the element this handler knows aboutcontext
- lint contextpublic void setAncestry(Ancestry ancestry)
ancestry
- family valuespublic Ancestry getAncestry()
public ElementRef getRef()
public String getName()
public void setAttributes(Map atts)
atts
- name -> value map representing this element's attributespublic String getAttribute(String name)
name
- attribute name
public void startElement()
public void endElement()
public void characters(char[] ch, int start, int length)
public void registerChildName(ElementRef child, String name)
child
- child elementname
- value of child's name attributepublic VotLintContext getContext()
public void info(String msg)
msg
- messagepublic void warning(String msg)
msg
- messagepublic void error(String msg)
msg
- messagepublic String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |