Package uk.ac.starlink.table.formats
Class RowEvaluator.Decoder
- java.lang.Object
-
- uk.ac.starlink.table.formats.RowEvaluator.Decoder
-
- Enclosing class:
- RowEvaluator
public abstract static class RowEvaluator.Decoder extends java.lang.Object
Interface for an object that can turn a string into a cell content object.
-
-
Constructor Summary
Constructors Constructor Description Decoder(java.lang.Class<?> clazz)
Constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description ColumnInfo
createColumnInfo(java.lang.String name)
Returns a new ColumnInfo suitable for the decoded values.abstract java.lang.Object
decode(java.lang.String value)
Decodes a value.abstract boolean
isValid(java.lang.String value)
Indicates whether this decoder is capable of decoding a given string.
-
-
-
Method Detail
-
createColumnInfo
public ColumnInfo createColumnInfo(java.lang.String name)
Returns a new ColumnInfo suitable for the decoded values.- Parameters:
name
- column name- Returns:
- new metadata object
-
decode
public abstract java.lang.Object decode(java.lang.String value)
Decodes a value. Will complete without exception ifisValid(java.lang.String)
returns true for the presentedvalue
; otherwise may throw an unchecked exception.- Parameters:
value
- string to decode- Returns:
- typed object corresponding to
value
-
isValid
public abstract boolean isValid(java.lang.String value)
Indicates whether this decoder is capable of decoding a given string.- Parameters:
value
- string to decode- Returns:
- true iff this decoder can make sense of the string
-
-