public class SQLightable.Reflection.Column
extends java.lang.Object
SQLiteColumn
field.
Used by SQLightable.Reflection
.
Replaces SQLiteHouse#getColumnDefinitionClause(QueryContext)
.Modifier and Type | Field and Description |
---|---|
protected SQLiteColumn |
m_antColumn
The annotation that defines the column schema.
|
protected boolean |
m_bKey
Indicates whether the column is also annotated as a key.
|
protected java.lang.reflect.Field |
m_fldColumn
The field that defines the column schema.
|
protected Refractor |
m_lens
The
Refractor implementation to be used for the column. |
protected int |
m_nSince
The version of the schema in which the column was added to the
reflected table.
|
Constructor and Description |
---|
Column(java.lang.reflect.Field fld)
Initializes the object with the selected field's data.
|
Modifier and Type | Method and Description |
---|---|
protected Refractor |
discoverRefractor()
Discovers the
Refractor implementation to be used for
this column field. |
SQLiteColumn |
getColAttrs()
Accesses the schematic annotation.
|
java.lang.String |
getColumnCreationClause()
Generates the SQL clause that will create this column as part of
a
CREATE TABLE or ALTER TABLE ADD COLUMN
statement. |
java.lang.reflect.Field |
getField()
Accesses the schematic field.
|
java.lang.String |
getName()
Shorthand to get the DB column name from the annotation.
|
Refractor |
getRefractor()
Accesses the column's
Refractor implementation. |
int |
getSince() |
java.lang.String |
getSQLColumnValueFrom(T o)
Tries to discover the value of this column within the
corresponding field of an instance of the schematic class that
defines it.
|
boolean |
isKey()
Indicates whether the column was annotated as a key.
|
protected SQLightable.Reflection.Column |
setSince(int n) |
protected java.lang.reflect.Field m_fldColumn
protected SQLiteColumn m_antColumn
protected boolean m_bKey
protected int m_nSince
since
value
in the annotations on the field's declaration, the enclosing
class's declaration, or any SQLiteInheritColumns
found
while tracing the reflected class's lineage.public Column(java.lang.reflect.Field fld) throws SchematicException, IntrospectionException
fld
- the field to be analyzedSchematicException
- if the field does not have a
SQLiteColumn
annotationIntrospectionException
- if something goes wrong while
analyzing the fieldprotected Refractor discoverRefractor() throws IntrospectionException, SchematicException
Refractor
implementation to be used for
this column field.IntrospectionException
- if the refractor instance can't be
createdSchematicException
- if the refractor class can't be
resolvedpublic java.lang.reflect.Field getField()
public SQLiteColumn getColAttrs()
public boolean isKey()
public java.lang.String getName()
public int getSince()
protected SQLightable.Reflection.Column setSince(int n)
public java.lang.String getColumnCreationClause()
CREATE TABLE
or ALTER TABLE ADD COLUMN
statement.public java.lang.String getSQLColumnValueFrom(T o)
o
- an instance of the schematic class that defined this
columnSchematicException
- if something goes wrong while trying
to discover the value