|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.starlink.ttools.votlint.ValueParser
public abstract class ValueParser
Object which knows how to interpret the values associated with a FIELD or PARAM object. This interpretation takes the form only of checking whether it is encoded legally, writing some message to the context if it is not, and throwing away the result (if it was ever calculated in the first place).
Constructor Summary | |
---|---|
ValueParser()
|
Method Summary | |
---|---|
abstract void |
checkStream(InputStream in)
Checks the value of a table element which is encoded in a BINARY stream. |
abstract void |
checkString(String text)
Checks the value of a string which contains the value. |
void |
error(String msg)
Writes an error mesage to the user. |
abstract Class |
getContentClass()
Returns the class of values which would be used in Java to represent an object parsed by this parser, although this class does not actually return such values. |
VotLintContext |
getContext()
Returns this parser's context. |
abstract int |
getElementCount()
Returns the number of items of class getContentClass() which
correspond to values parsed by this parser. |
void |
info(String msg)
Writes an info mesage to the user. |
static ValueParser |
makeParser(ElementHandler handler,
String datatype,
String arraysize)
Constructs a ValueParsers for a given element. |
void |
setContext(VotLintContext context)
Sets this parser's context. |
static void |
slurpStream(InputStream in,
int nbyte,
VotLintContext context)
Uncritically reads in a fixed number of bytes from a stream. |
void |
warning(String msg)
Writes a warning mesage to the user. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ValueParser()
Method Detail |
---|
public abstract void checkString(String text)
text
- value stringpublic abstract void checkStream(InputStream in) throws IOException
in
- input stream
IOException
public abstract Class getContentClass()
ValueInfo.getContentClass()
would return for this object if a StarTable was being built.
public abstract int getElementCount()
getContentClass()
which
correspond to values parsed by this parser. This should be the
same as the product of shape elements returned by
ValueInfo.getShape()
.
If the number is indeterminate, -1 should be returned.
public void setContext(VotLintContext context)
context
- lint contextpublic VotLintContext getContext()
public void info(String msg)
msg
- messagepublic void warning(String msg)
msg
- messagepublic void error(String msg)
msg
- messagepublic static ValueParser makeParser(ElementHandler handler, String datatype, String arraysize)
handler
- element handlerdatatype
- datatype attribute valuearraysize
- arraysize attribute value
public static void slurpStream(InputStream in, int nbyte, VotLintContext context) throws IOException
in
- input streamnbyte
- number of bytes to readcontext
- error reporting context
IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |