public Set<MemberLookupResult> performMemberLookup(String variable) {
    // if there is more than one "." we need to do some magic and resolve the definition fragmented
    if (variable.contains(".")) {
      return performNestedLookup(variable);
    }

    Set<MemberLookupResult> ret = new LinkedHashSet<>();
    // check, if the current variable resolves to a data-sly-use command
    ParsedStatement statement = getParsedStatement(variable);
    if (statement == null) {
      return ret;
    }
    if (StringUtils.equals(statement.getCommand(), DataSlyCommands.DATA_SLY_USE.getCommand())) {
      // this ends the search and we can perform the actual lookup
      ret.addAll(getResultsForClass(statement.getValue(), variable));
    }
    else {
      Set<MemberLookupResult> subResults = performMemberLookup(StringUtils.substringBefore(statement.getValue(), "."));
      for (MemberLookupResult result : subResults) {
        if (result.matches(StringUtils.substringAfter(statement.getValue(), "."))) {
          ret.addAll(getResultsForClass(result.getReturnType(), variable));
        }
      }
    }
    return ret;
  }
public Set < MemberLookupResult > performMemberLookup ( String variable ) { if ( variable . contains ( "." ) ) { return performNestedLookup ( variable ) ; } Set < MemberLookupResult > ret = new LinkedHashSet < > ( ) ; ParsedStatement statement = getParsedStatement ( variable ) ; if ( statement == null ) { return ret ; } if ( StringUtils . equals ( statement . getCommand ( ) , DataSlyCommands . DATA_SLY_USE . getCommand ( ) ) ) { ret . addAll ( getResultsForClass ( statement . getValue ( ) , variable ) ) ; } else { Set < MemberLookupResult > subResults = performMemberLookup ( StringUtils . substringBefore ( statement . getValue ( ) , "." ) ) ; for ( MemberLookupResult result : subResults ) { if ( result . matches ( StringUtils . substringAfter ( statement . getValue ( ) , "." ) ) ) { ret . addAll ( getResultsForClass ( result . getReturnType ( ) , variable ) ) ; } } } return ret ; }
The actual lookup

@return set of all elements which match the lookup