public abstract class ValueParser
extends java.lang.Object
Constructor and Description |
---|
ValueParser() |
Modifier and Type | Method and Description |
---|---|
abstract void |
checkStream(java.io.InputStream in)
Checks the value of a table element which is encoded in a BINARY
stream.
|
abstract void |
checkString(java.lang.String text)
Checks the value of a string which contains the value.
|
void |
error(java.lang.String msg)
Writes an error mesage to the user.
|
abstract java.lang.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(java.lang.String msg)
Writes an info mesage to the user.
|
static ValueParser |
makeParser(ElementHandler handler,
java.lang.String datatype,
java.lang.String arraysize)
Constructs a ValueParsers for a given element.
|
void |
setContext(VotLintContext context)
Sets this parser's context.
|
static void |
slurpStream(java.io.InputStream in,
int nbyte,
VotLintContext context)
Uncritically reads in a fixed number of bytes from a stream.
|
void |
warning(java.lang.String msg)
Writes a warning mesage to the user.
|
public abstract void checkString(java.lang.String text)
text
- value stringpublic abstract void checkStream(java.io.InputStream in) throws java.io.IOException
in
- input streamjava.io.IOException
public abstract java.lang.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(java.lang.String msg)
msg
- messagepublic void warning(java.lang.String msg)
msg
- messagepublic void error(java.lang.String msg)
msg
- messagepublic static ValueParser makeParser(ElementHandler handler, java.lang.String datatype, java.lang.String arraysize)
handler
- element handlerdatatype
- datatype attribute valuearraysize
- arraysize attribute valuepublic static void slurpStream(java.io.InputStream in, int nbyte, VotLintContext context) throws java.io.IOException
in
- input streamnbyte
- number of bytes to readcontext
- error reporting contextjava.io.IOException
Copyright © 2017 Central Laboratory of the Research Councils. All Rights Reserved.