implicit = this.createDeclarationObject( context,
parts[1],
decl.getPattern() );
} else {
context.getErrors().add( new RuleError( context.getRule(),
qiRestrictionDescr,
"",
"Not possible to directly access the property '" + parts[1] + "' of declaration '" + parts[0] + "' since it is not a pattern" ) );
return null;
}
}
}
if( implicit != null ) {
final Evaluator evaluator = getEvaluator( context,
qiRestrictionDescr,
extractor.getValueType(),
qiRestrictionDescr.getEvaluator() );
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() );
} 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 RuleError( context.getRule(),
qiRestrictionDescr,
e,
"Unable to create a Field value of type '" + extractor.getValueType() + "' and value '" + qiRestrictionDescr.getText() + "'" ) );
}