}
}
}
if ( implicit != null ) {
Target right = getRightTarget( extractor );
Target left = (implicit.isPatternDeclaration() && !(Date.class.isAssignableFrom( implicit.getExtractor().getExtractToClass() ) || Number.class.isAssignableFrom( implicit.getExtractor().getExtractToClass() ))) ? Target.HANDLE : Target.FACT;
final Evaluator evaluator = getEvaluator( context,
qiRestrictionDescr,
extractor.getValueType(),
qiRestrictionDescr.getEvaluator(),
qiRestrictionDescr.isNegated(),
qiRestrictionDescr.getParameterText(),
left,
right );
if ( evaluator == null ) {
return null;
}
return new VariableRestriction( extractor,
implicit,
evaluator );
}
}
final int lastDot = qiRestrictionDescr.getText().lastIndexOf( '.' );
final String className = qiRestrictionDescr.getText().substring( 0,
lastDot );
final String fieldName = qiRestrictionDescr.getText().substring( lastDot + 1 );
try {
final Class staticClass = context.getDialect().getTypeResolver().resolveType( className );
field = FieldFactory.getFieldValue( staticClass.getField( fieldName ).get( null ),
extractor.getValueType(),
context.getPackageBuilder().getDateFormats() );
if ( field.isObjectField() ) {
((ObjectFieldImpl) field).setEnum( true );
((ObjectFieldImpl) field).setEnumName( staticClass.getName() );
((ObjectFieldImpl) field).setFieldName( fieldName );
}
} catch ( final ClassNotFoundException e ) {
// nothing to do, as it is not a class name with static field
} catch ( final Exception e ) {
context.getErrors().add( new DescrBuildError( context.getParentDescr(),
qiRestrictionDescr,
e,
"Unable to create a Field value of type '" + extractor.getValueType() + "' and value '" + qiRestrictionDescr.getText() + "'" ) );
}
if ( field == null ) {
return null;
}
Target right = getRightTarget( extractor );
Target left = Target.FACT;
final Evaluator evaluator = getEvaluator( context,
qiRestrictionDescr,
extractor.getValueType(),
qiRestrictionDescr.getEvaluator(),
qiRestrictionDescr.isNegated(),