Class ScopedQueryAdapter

java.lang.Object
com.e1c.langtool.internal.history.scope.ScopedQueryAdapter
All Implemented Interfaces:
IScopedQueryAdapter

public class ScopedQueryAdapter extends Object implements IScopedQueryAdapter
  • Constructor Details

    • ScopedQueryAdapter

      public ScopedQueryAdapter()
  • Method Details

    • isAdaptable

      public boolean isAdaptable(IProjectTranslatingQuery query, IQueryScope scope)
      Description copied from interface: IScopedQueryAdapter
      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
       }
       

      Specified by:
      isAdaptable in interface IScopedQueryAdapter
      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

      public IExpression adapt(IProjectTranslatingQuery query, IQueryScope scope)
      Description copied from interface: IScopedQueryAdapter
      Returns an expression as result of applying the given scope.
      Specified by:
      adapt in interface IScopedQueryAdapter
      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.