protected boolean checkList(String currentVal,String tokenValue){
  if (currentVal == null || tokenValue == null) {
    throw new NullPointerException("Received null argument");
  }
  if (!currentVal.startsWith("INLIST") && !currentVal.startsWith("!INLIST")) {
    throw new IllegalArgumentException("currentVal does not start with INLIST or !INLIST");
  }
  boolean negation=currentVal.startsWith("!");
  String listName=currentVal.substring(currentVal.indexOf(":") + 1);
  Object listObj=listMap.get(listName);
  if (listObj == null)   return false;
  boolean contains;
  if (listObj instanceof Set) {
    Set<String> set=(Set)listObj;
    contains=set.contains(tokenValue);
  }
 else {
    throw new IllegalArgumentException("Unknown list representation: " + listObj);
  }
  return !(contains && negation || !contains && !negation);
}

protected boolean checkList ( String currentVal , String tokenValue ) { if ( currentVal == null || tokenValue == null ) { throw new NullPointerException ( "Received null argument" ) ; } if ( ! currentVal . startsWith ( "INLIST" ) && ! currentVal . startsWith ( "!INLIST" ) ) { throw new IllegalArgumentException ( "currentVal does not start with INLIST or !INLIST" ) ; } boolean negation = currentVal . startsWith ( "!" ) ; String listName = currentVal . substring ( currentVal . indexOf ( ":" ) + 1 ) ; Object listObj = listMap . get ( listName ) ; if ( listObj == null ) return false ; boolean contains ; if ( listObj instanceof Set ) { Set < String > set = ( Set ) listObj ; contains = set . contains ( tokenValue ) ; } else { throw new IllegalArgumentException ( "Unknown list representation: " + listObj ) ; } return ! ( contains && negation || ! contains && ! negation ) ; }
checks if tokenvalue is contained in list . this base implementation is able to deal with list types represented as sets ; subclasses may override this method to be able to deal with different list representations .
