isJavaDialect,
boundParams,
dmo );
fcfp.setFactPattern( factPattern );
ExpressionFormLine expression = new ExpressionFormLine();
fcfp.setExpression( expression );
String dataSource = from.getDataSource().toString();
String[] splitSource = dataSource.split( "\\." );
ModelField[] fields = null;
for ( int i = 0; i < splitSource.length; i++ ) {
String sourcePart = splitSource[ i ];
if ( i == 0 ) {
String type = boundParams.get( sourcePart );
expression.appendPart( new ExpressionVariable( sourcePart,
type,
DataType.TYPE_NUMERIC ) );
fields = findFields( m,
dmo,
type );
} else {
ModelField modelField = null;
for ( ModelField field : fields ) {
if ( field.getName().equals( sourcePart ) ) {
modelField = field;
break;
}
}
if ( modelField == null ) {
final String previousClassName = expression.getClassType();
final List<MethodInfo> mis = dmo.getProjectMethodInformation().get( previousClassName );
boolean isMethod = false;
if ( mis != null ) {
for ( MethodInfo mi : mis ) {
if ( mi.getName().equals( sourcePart ) ) {
expression.appendPart( new ExpressionMethod( mi.getName(),
mi.getReturnClassType(),
mi.getGenericType(),
mi.getParametricReturnType() ) );
isMethod = true;
break;
}
}
}
if ( isMethod == false ) {
expression.appendPart( new ExpressionText( sourcePart ) );
}
} else {
expression.appendPart( new ExpressionField( sourcePart,
modelField.getClassName(),
modelField.getType() ) );
fields = findFields( m,
dmo,
modelField.getClassName() );