Class QuerySchemaBuilder


  • public class QuerySchemaBuilder
    extends Object
    QL parser for query wizard. Required for build query schema and resource from text query
    • Constructor Detail

      • QuerySchemaBuilder

        public QuerySchemaBuilder​(org.eclipse.core.resources.IProject project,
                                  boolean isDcsMode)
        Parameters:
        project - project context
    • Method Detail

      • checkCharacteristic

        public static String checkCharacteristic​(CharacteristicCompositionDataQuerySchema characteristic)
        Check characteristic
        Parameters:
        characteristic - - dcs characteristic
        Returns:
        null if no errors, or text with error description
      • buildQuerySchema

        public QuerySchema buildQuerySchema​(String query)
        Build query schema from text query
        Parameters:
        query - query text
        Returns:
        new query schema
      • getAvailableTables

        public List<AvailableTable> getAvailableTables()
        Returns:
        available tables
      • getQueryText

        public String getQueryText​(QueryWizardSource qwSource)
        Parameters:
        querySchema -
        Returns:
        query text from query schema
      • getQueryText

        public String getQueryText​(QuerySchema querySchema)
        Get text for query schema without validation
        Parameters:
        querySchema - query schema
        Returns:
        query text from query schema
      • getFormatedQueryText

        public String getFormatedQueryText​(QuerySchema querySchema)
        Get formated query text for query schema. Under query schema must be valid node model.
        Returns:
        formated query text
      • getQueryText

        public String getQueryText​(QueryWizardSource qwSource,
                                   boolean validateQuerySchema)
        Get text for query schema with validation
        Parameters:
        qwSource - query wizard source
        validateQuerySchema - if need make query schema correct (for example supplemented group field)
        Returns:
        query text from query schema
      • parse

        public org.eclipse.emf.ecore.resource.Resource parse​(String text)
        Gets result of parsing text
        Parameters:
        text - parsing text, cannot be null
        Returns:
        Resource with the result of the parsing