if ( asTrait && ( "core".equals(fieldName) || "fields".equals(fieldName) ) ) {
continue;
}
if ( !inspector.isNonGetter( fieldName ) && setters.keySet().contains( fieldName ) ) {
Position position = null;
if ( ! concrete.isInterface() ) {
try {
Field fld = concrete.getDeclaredField( fieldName );
position = fld.getAnnotation( Position.class );
} catch ( NoSuchFieldException nsfe ) {
// @Position can only annotate fields. This x means that a getter/setter pair was found with no field
}
}
Class ret = methods.get( fieldName ).getReturnType();
TypeFieldDescr field = new TypeFieldDescr( );
field.setFieldName( fieldName );
field.setPattern( new PatternDescr( ret.getName() ) );
field.setIndex( position != null ? position.value() : -1 );
fields.put( fieldName, field );
}
}
if ( ! fields.isEmpty() ) {
List<FieldDefinition> fieldDefs = sortFields( fields, null, null );