public abstract class Field extends Object
| Modifier and Type | Field and Description |
|---|---|
static Set<IllegalCharacter> |
ILLEGAL_CHARACTERS
Keep any illegal character sequences and their respective replacements here.
|
String |
name |
Table |
referenceTable
Indicates that this field acts as a foreign key to this referenced table.
|
Requirement |
requirement |
| Constructor and Description |
|---|
Field(String name,
Requirement requirement) |
| Modifier and Type | Method and Description |
|---|---|
protected static ValidateFieldResult<String> |
cleanString(String string) |
protected static ValidateFieldResult<String> |
cleanString(ValidateFieldResult<String> previousResult) |
String |
getColumnExpression(String prefix,
boolean csvOutput)
Get the expression used to select this column from the database based on the prefix.
|
static int |
getFieldIndex(Field[] fields,
String name)
Finds the index of the field given a string name.
|
String |
getSqlDeclaration() |
abstract SQLType |
getSqlType() |
String |
getSqlTypeName() |
Field |
indexThisColumn()
Fluent method that indicates that a newly constructed field should be indexed after the table is loaded.
|
boolean |
isEmptyValuePermitted()
Check if empty values are permitted for this field.
|
boolean |
isForeignReference()
More than one foreign reference should not be created on the same table to the same foreign table.
|
Field |
isReferenceTo(Table table)
Fluent method indicates that this field is a reference to an entry in the table provided as an argument.
|
boolean |
isRequired() |
boolean |
missingRequired(String string)
Generally any required field should be present on every row.
|
Field |
permitEmptyValue()
Fluent method to permit empty values for this field.
|
void |
setNull(PreparedStatement preparedStatement,
int oneBasedIndex) |
abstract Set<NewGTFSError> |
setParameter(PreparedStatement preparedStatement,
int oneBasedIndex,
String string) |
boolean |
shouldBeIndexed() |
abstract ValidateFieldResult<String> |
validateAndConvert(String original)
Check the supplied string to see if it can be parsed as the proper data type.
|
public final String name
public static final Set<IllegalCharacter> ILLEGAL_CHARACTERS
public final Requirement requirement
public Table referenceTable
public Field(String name, Requirement requirement)
public abstract ValidateFieldResult<String> validateAndConvert(String original)
original - a non-null Stringpublic abstract Set<NewGTFSError> setParameter(PreparedStatement preparedStatement, int oneBasedIndex, String string)
public void setNull(PreparedStatement preparedStatement, int oneBasedIndex) throws SQLException
SQLExceptionpublic static int getFieldIndex(Field[] fields, String name)
public abstract SQLType getSqlType()
public String getSqlTypeName()
public String getSqlDeclaration()
protected static ValidateFieldResult<String> cleanString(String string)
protected static ValidateFieldResult<String> cleanString(ValidateFieldResult<String> previousResult)
public boolean missingRequired(String string)
public boolean isRequired()
public boolean isForeignReference()
public Field indexThisColumn()
public boolean shouldBeIndexed()
public Field isReferenceTo(Table table)
table - public Field permitEmptyValue()
public boolean isEmptyValuePermitted()
public String getColumnExpression(String prefix, boolean csvOutput)
Copyright © 2019. All rights reserved.