shillelagh-processor/src/main/java/shillelagh/internal/ShillelaghProcessor.java
private void checkForFields(TableObject tableObject, Element columnElement) {
    Column columnAnnotation = columnElement.getAnnotation(Column.class);
    if (columnAnnotation == null) return;

    // Convert the element from a field to a type
    final Element typeElement = typeUtils.asElement(columnElement.asType());
    final String type = typeElement == null ? columnElement.asType().toString()
        : elementUtils.getBinaryName((TypeElement) typeElement).toString();

    TableColumn tableColumn = new TableColumn(columnElement, type, columnAnnotation.name());
    if (tableColumn.isBlob() && !tableColumn.isByteArray()) {
      String columnType = columnElement.asType().toString();
      logger.d("Column Element Type: " + columnType);
      if (!checkForSuperType(columnElement, Serializable.class)
          && !columnType.equals("java.lang.Byte[]")
          && !columnType.startsWith("java.util.Map")
          && !columnType.startsWith("java.util.List")) {
        logger.e(String.format(
            "%s in %s is not Serializable and will not be able to be converted to a byte array",
            columnElement.toString(), tableObject.getTableName()));
      }
    } else if (tableColumn.isOneToMany()) {
      // List<T> should only have one generic type. Get that type and make sure
      // it has @Table annotation
      TypeMirror typeMirror = ((DeclaredType) columnElement.asType()).getTypeArguments().get(0);
      if (typeUtils.asElement(typeMirror).getAnnotation(Table.class) == null) {
        logger.e("One to many relationship in class %s where %s is not annotated with @Table",
            tableObject.getTableName(), tableColumn.getColumnName());
      }
      oneToManyCache.put(typeMirror.toString(), tableObject);
      TypeElement childColumnElement = elementUtils.getTypeElement(typeMirror.toString());
      tableColumn.setType(getClassName(childColumnElement, getPackageName(childColumnElement)));
    } else if (tableColumn.getSqlType() == SqliteType.UNKNOWN) {
      @SuppressWarnings("ConstantConditions") Table annotation =
          typeElement.getAnnotation(Table.class);
      if (annotation == null) {
        logger.e(String.format(
            "%s in %s needs to be marked as a blob or should be " + "annotated with @Table",
            columnElement.toString(), tableObject.getTableName()));
      }
      tableColumn.setOneToOne(true);
    }
    tableObject.addColumn(tableColumn);
  }
private void checkForFields(TableObject tableObject, Element columnElement) {
    Column columnAnnotation = columnElement.getAnnotation(Column.class);
    if (columnAnnotation == null) return;

    // Convert the element from a field to a type
    final Element typeElement = typeUtils.asElement(columnElement.asType());
    final String type = typeElement == null ? columnElement.asType().toString()
        : elementUtils.getBinaryName((TypeElement) typeElement).toString();

    TableColumn tableColumn = new TableColumn(columnElement, type, columnAnnotation.name());
    if (tableColumn.isBlob() && !tableColumn.isByteArray()) {
      String columnType = columnElement.asType().toString();
      logger.d("Column Element Type: " + columnType);
      if (!checkForSuperType(columnElement, Serializable.class)
          && !columnType.equals("java.lang.Byte[]")
          && !columnType.startsWith("java.util.Map")
          && !columnType.startsWith("java.util.List")) {
        logger.e(String.format(
            "%s in %s is not Serializable and will not be able to be converted to a byte array",
            columnElement.toString(), tableObject.getTableName()));
      }
    } else if (tableColumn.isOneToMany()) {
      // List<T> should only have one generic type. Get that type and make sure
      // it has @Table annotation
      TypeMirror typeMirror = ((DeclaredType) columnElement.asType()).getTypeArguments().get(0);
      if (typeUtils.asElement(typeMirror).getAnnotation(Table.class) == null) {
        logger.e("One to many relationship in class %s where %s is not annotated with @Table",
            tableObject.getTableName(), tableColumn.getColumnName());
      }
      oneToManyCache.put(typeMirror.toString(), tableObject);
      TypeElement childColumnElement = elementUtils.getTypeElement(typeMirror.toString());
      tableColumn.setType(getClassName(childColumnElement, getPackageName(childColumnElement)));
    } else if (tableColumn.getSqlType() == SqliteType.UNKNOWN) {
      @SuppressWarnings("ConstantConditions") Table annotation =
          typeElement.getAnnotation(Table.class);
      if (annotation == null) {
        logger.e(String.format(
            "%s in %s needs to be marked as a blob or should be " + "annotated with @Table",
            columnElement.toString(), tableObject.getTableName()));
      }
      tableColumn.setOneToOne(true);
    }
    tableObject.addColumn(tableColumn);
  }
private void checkForFields ( TableObject tableObject , Element columnElement ) { Column columnAnnotation = columnElement . getAnnotation ( Column . class ) ; if ( columnAnnotation == null ) return ; // Convert the element from a field to a type final Element typeElement = typeUtils . asElement ( columnElement . asType ( ) ) ; final String type = typeElement == null ? columnElement . asType ( ) . toString ( ) : elementUtils . getBinaryName ( ( TypeElement ) typeElement ) . toString ( ) ; TableColumn tableColumn = new TableColumn ( columnElement , type , columnAnnotation . name ( ) ) ; if ( tableColumn . isBlob ( ) && ! tableColumn . isByteArray ( ) ) { String columnType = columnElement . asType ( ) . toString ( ) ; logger . d ( "Column Element Type: " + columnType ) ; if ( ! checkForSuperType ( columnElement , Serializable . class ) && ! columnType . equals ( "java.lang.Byte[]" ) && ! columnType . startsWith ( "java.util.Map" ) && ! columnType . startsWith ( "java.util.List" ) ) { logger . e ( String . format ( "%s in %s is not Serializable and will not be able to be converted to a byte array" , columnElement . toString ( ) , tableObject . getTableName ( ) ) ) ; } } else if ( tableColumn . isOneToMany ( ) ) { // List<T> should only have one generic type. Get that type and make sure // it has @Table annotation TypeMirror typeMirror = ( ( DeclaredType ) columnElement . asType ( ) ) . getTypeArguments ( ) . get ( 0 ) ; if ( typeUtils . asElement ( typeMirror ) . getAnnotation ( Table . class ) == null ) { logger . e ( "One to many relationship in class %s where %s is not annotated with @Table" , tableObject . getTableName ( ) , tableColumn . getColumnName ( ) ) ; } oneToManyCache . put ( typeMirror . toString ( ) , tableObject ) ; TypeElement childColumnElement = elementUtils . getTypeElement ( typeMirror . toString ( ) ) ; tableColumn . setType ( getClassName ( childColumnElement , getPackageName ( childColumnElement ) ) ) ; } else if ( tableColumn . getSqlType ( ) == SqliteType . UNKNOWN ) { @ SuppressWarnings ( "ConstantConditions" ) Table annotation = typeElement . getAnnotation ( Table . class ) ; if ( annotation == null ) { logger . e ( String . format ( "%s in %s needs to be marked as a blob or should be " + "annotated with @Table" , columnElement . toString ( ) , tableObject . getTableName ( ) ) ) ; } tableColumn . setOneToOne ( true ) ; } tableObject . addColumn ( tableColumn ) ; }
Check if the element has a @Field annotation if it does parse it and
add it to the table object
Check if the element has a