Index: C:/Naidu/Projects/eclipse/june_policy_workspace/apache/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/compiler/IdentPrimaryTuple.java =================================================================== --- C:/Naidu/Projects/eclipse/june_policy_workspace/apache/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/compiler/IdentPrimaryTuple.java (revision 669804) +++ C:/Naidu/Projects/eclipse/june_policy_workspace/apache/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/compiler/IdentPrimaryTuple.java (working copy) @@ -97,11 +97,31 @@ } catch(SPLException splex) { - String accessorMethodName = getAccessorMethodName(_identifier); - sym = _symbolTable.getSymbol(_classType + "." + accessorMethodName); - returnValue = AnchorMethodInvokeAction.invokeClassMethod(_symbolTable, - _classType, qualifier, accessorMethodName, _paramList,instance); - } } + String accessorMethodName = getAccessorMethodName(_identifier, "get"); + try + { + sym = _symbolTable.getSymbol(_classType + "." + accessorMethodName); + } + catch(SPLException splex1) + { + accessorMethodName = getAccessorMethodName(_identifier, "is"); + try + { + sym = _symbolTable.getSymbol(_classType + "." + accessorMethodName); + } + catch(SPLException splex2) + { + throw new SPLException("Symbol does not exist " + + _classType + "." + _identifier + + "Or it can be a private variable without" + + "getter and setter methods"); + } + } + returnValue = AnchorMethodInvokeAction.invokeClassMethod( + _symbolTable, _classType, qualifier, + accessorMethodName, _paramList, instance); + } + } return returnValue; @@ -143,10 +163,31 @@ } catch(SPLException splex) { - String accessorMethodName = getAccessorMethodName(_identifier); - sym = _symbolTable.getSymbol(_classType + "." + accessorMethodName); - returnValue = AnchorMethodInvokeAction.invokeClassMethod(_symbolTable, - _classType, qualifier, accessorMethodName, _paramList,parentObject); + String accessorMethodName = getAccessorMethodName(_identifier, "get"); + try + { + sym = _symbolTable.getSymbol(_classType + "." + + accessorMethodName); + } + catch(SPLException splex1) + { + accessorMethodName = getAccessorMethodName(_identifier, "is"); + try + { + sym = _symbolTable.getSymbol(_classType + "." + + accessorMethodName); + } + catch(SPLException splex2) + { + throw new SPLException("Symbol does not exist " + + _classType + "." + _identifier + + "Or it can be a private variable without" + + "getter and setter methods"); + } + } + returnValue = AnchorMethodInvokeAction.invokeClassMethod( + _symbolTable, _classType, qualifier, + accessorMethodName, _paramList, parentObject); } } @@ -169,7 +210,29 @@ } catch(SPLException splex) { - sym = _symbolTable.getSymbol(classTypeOrVariableName + "." + getAccessorMethodName(_identifier)); + try + { + sym = _symbolTable.getSymbol(classTypeOrVariableName + "." + + getAccessorMethodName(_identifier, "get")); + } + catch(SPLException splex1) + { + try + { + sym = _symbolTable.getSymbol(classTypeOrVariableName + "." + + getAccessorMethodName(_identifier, "is")); + } + catch(SPLException splex2) + { + throw new SPLException( + "Symbol does not exist " + + classTypeOrVariableName + + "." + + _identifier + + "Or it can be a private variable without" + + "getter and setter methods"); + } + } } if(_isMethod) @@ -214,15 +277,15 @@ } - private String getAccessorMethodName(String identifier) - { - if(Character.isLetter(identifier.charAt(0))) - { - identifier = Character.toUpperCase(identifier.charAt(0)) + identifier.substring(1); - } - identifier = "get"+identifier; - return identifier; - } + private String getAccessorMethodName(String identifier, String setOrGetOrIs) + { + if(Character.isLetter(identifier.charAt(0))) + { + identifier = Character.toUpperCase(identifier.charAt(0)) + identifier.substring(1); + } + identifier = setOrGetOrIs+identifier; + return identifier; + } private TypeInfo _validateActualParameters(Symbol sym, String classType) throws SPLException