@ SuppressWarnings ( "static-method" ) public Boolean toBooleanPrimitiveWrapperConstant ( XExpression expression ) { if ( expression instanceof XBooleanLiteral ) { return ( ( XBooleanLiteral ) expression ) . isIsTrue ( ) ? Boolean . TRUE : Boolean . FALSE ; } if ( expression instanceof XMemberFeatureCall ) { final XMemberFeatureCall call = ( XMemberFeatureCall ) expression ; final XExpression receiver = call . getMemberCallTarget ( ) ; if ( receiver instanceof XFeatureCall ) { final XFeatureCall call2 = ( XFeatureCall ) receiver ; final String call2Identifier = call2 . getConcreteSyntaxFeatureName ( ) ; if ( Boolean . class . getSimpleName ( ) . equals ( call2Identifier ) || Boolean . class . getName ( ) . equals ( call2Identifier ) ) { final String callIdentifier = call . getConcreteSyntaxFeatureName ( ) ; if ( "TRUE" . equals ( callIdentifier ) ) { //$NON-NLS-1$ return Boolean . TRUE ; } else if ( "FALSE" . equals ( callIdentifier ) ) { //$NON-NLS-1$ return Boolean . FALSE ; } } } } return null ; }
Convert the boolean constant to the object equivalent if possible .