LazyJavaCompletionProposal javaProposal = (LazyJavaCompletionProposal) o;
//TODO: FIXME: this is very fragile as it uses reflection to access the private completion field.
//Yet this is needed to do mvel filtering based on the method signtures, IF we use the richer JDT completion
Object field = ReflectionUtils.getField(o, "fProposal");
if ( field != null && field instanceof CompletionProposal ) {
CompletionProposal proposal = (CompletionProposal) field;
String completion = new String( proposal.getCompletion() );
String propertyOrMethodName = null;
boolean isSetter = false;
boolean isAccessor = false;
if ( settersOnly ) {
// get the eventual writable property name for that method name and signature
propertyOrMethodName = CompletionUtil.getWritablePropertyName( completion,
proposal.getSignature() );
// if we got a property name that differs from the orginal method name
//then this is a bean accessor
isSetter = !completion.equals( propertyOrMethodName );
} else {
// get the eventual property name for that method name and signature
propertyOrMethodName = CompletionUtil.getPropertyName( completion,
proposal.getSignature() );
//if we got a property name that differs from the orginal method name
//then this is a bean accessor
isAccessor = !completion.equals( propertyOrMethodName );
}