Interface IScopedQueryAdapter

All Known Implementing Classes:
ScopedQueryAdapter

public interface IScopedQueryAdapter
An adapter to convert a IProjectTranslatingQuery to necessary IExpression with more weak search rules by a given query scope.
See Also:
  • Method Details

    • isAdaptable

      boolean isAdaptable(IProjectTranslatingQuery query, IQueryScope scope)
      Returns true if the query can be adaptable by the given query scope.

      For example the query can be unadaptable by the scope in case when it has some undefined fields, but the same fields are demand in the scope.

       IProjectTranslatingQuery query = ... // some query
       IQueryScope scope = ... // some scope
       IScopedQueryAdapter adapter = ... // some adapter
       
       if (query.getResourceId() == null && scope.getRules().getStorageId() == CompareRule.EQUAL) {
          System.out.println(adapter.isAdaptable(query, scope));  // it should print false
       }
       

      Parameters:
      query - the query to adapt
      scope - the scope which using for adapting the query
      Returns:
      true if the query can be adaptable by the given query scope
      See Also:
    • adapt

      Returns an expression as result of applying the given scope.
      Parameters:
      query - the query to adapt
      scope - the scope which using for adapting the query
      Returns:
      an expression as result of applying the given scope.
      Throws:
      IllegalArgumentException - if the query is not adaptable by the given scope