Class AdvancedPatternParser


  • public class AdvancedPatternParser
    extends BasePatternParser
    An updateable, stateful pattern parser that allows the management of complex query libraries with interresource cross references.
    Since:
    2.1
    No Extend:
    This class is not intended to be subclassed by clients.
    • Constructor Detail

      • AdvancedPatternParser

        protected AdvancedPatternParser​(java.util.Set<IQuerySpecification<?>> librarySpecifications,
                                        java.util.Set<org.eclipse.emf.common.util.URI> libraryURIs,
                                        java.util.Optional<java.lang.ClassLoader> classloader)
        Since:
        2.4
    • Method Detail

      • createResourceSet

        public void createResourceSet​(com.google.inject.Provider<org.eclipse.xtext.resource.XtextResourceSet> resourceSetProvider)
        Overrides:
        createResourceSet in class BasePatternParser
      • addSpecifications

        protected AdvancedPatternParsingResults addSpecifications​(java.util.Map<org.eclipse.emf.common.util.URI,​java.lang.String> input,
                                                                  java.util.Map<?,​?> options,
                                                                  org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
      • updateSpecifications

        protected AdvancedPatternParsingResults updateSpecifications​(java.util.Map<org.eclipse.emf.common.util.URI,​java.lang.String> input,
                                                                     java.util.Map<?,​?> options,
                                                                     org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
      • removeSpecifications

        protected AdvancedPatternParsingResults removeSpecifications​(java.util.Map<org.eclipse.emf.common.util.URI,​java.lang.String> input,
                                                                     java.util.Map<?,​?> options,
                                                                     org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
      • addSpecifications

        protected AdvancedPatternParsingResults addSpecifications​(java.util.Map<org.eclipse.emf.common.util.URI,​java.lang.String> input,
                                                                  org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
      • updateSpecifications

        protected AdvancedPatternParsingResults updateSpecifications​(java.util.Map<org.eclipse.emf.common.util.URI,​java.lang.String> input,
                                                                     org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
      • removeSpecifications

        protected AdvancedPatternParsingResults removeSpecifications​(java.util.Map<org.eclipse.emf.common.util.URI,​java.lang.String> input,
                                                                     org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
      • addSpecifications

        public AdvancedPatternParsingResults addSpecifications​(java.util.Map<org.eclipse.emf.common.util.URI,​java.lang.String> input)
        Parses the input as if they were multiple .vql files, and caches the contained queries for further use. The produced query specifications can be later reused via referring their fully qualified names.
        Parameters:
        input - Map containing the input in textual form. Each synthetic .vql file must have a unique URI that can be used to identify its contents.
        Returns:
        AdvancedPatternParsingResults that contains the created IQuerySpecification objects.
        Throws:
        java.lang.IllegalStateException - if the input contains URI that has already been added.
      • addSpecifications

        public AdvancedPatternParsingResults addSpecifications​(org.eclipse.emf.common.util.URI uriToUse,
                                                               java.lang.String text)
      • updateSpecifications

        public AdvancedPatternParsingResults updateSpecifications​(java.util.Map<org.eclipse.emf.common.util.URI,​java.lang.String> input)
        Parses the input as if they were multiple .vql files, and updates the cache based on the results. Also updates any impacted, already existing IQuerySpecification objects. The produced query specifications can be later reused via referring their fully qualified names.
        Parameters:
        input - Map containing the input in textual form. Each synthetic .vql file must have a unique URI that can be used to identify its contents.
        Returns:
        AdvancedPatternParsingResults that contains the updated, and affected IQuerySpecification objects.
        Throws:
        java.lang.IllegalStateException - if the input contains URI that has not yet been added to the cache.
      • updateSpecifications

        public AdvancedPatternParsingResults updateSpecifications​(org.eclipse.emf.common.util.URI uriToUse,
                                                                  java.lang.String text)
      • removeSpecifications

        public AdvancedPatternParsingResults removeSpecifications​(java.util.Map<org.eclipse.emf.common.util.URI,​java.lang.String> input)
        Removes the patterns provided in the input from the cache. Also updates any impacted, already existing IQuerySpecification objects.
        Parameters:
        input - Map containing the input in textual form. Each synthetic .vql file must have a unique URI that can be used to identify its contents.
        Returns:
        AdvancedPatternParsingResults that contains removed, and affected IQuerySpecification objects.
        Throws:
        java.lang.IllegalStateException - if the input contains URI that has not yet been added to the cache.
      • removeSpecifications

        public AdvancedPatternParsingResults removeSpecifications​(org.eclipse.emf.common.util.URI uriToUse,
                                                                  java.lang.String text)
      • getRegisteredURIs

        public java.util.Collection<org.eclipse.emf.common.util.URI> getRegisteredURIs()
        Returns a collection of URIs that have been previously registered.
      • reset

        public void reset()
      • updatePatterns

        protected AdvancedPatternParser.AdvancedPatternParserSnapshot updatePatterns​(java.util.Map<org.eclipse.emf.common.util.URI,​java.lang.String> input,
                                                                                     java.util.Map<?,​?> options,
                                                                                     org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
      • addPatterns

        protected AdvancedPatternParser.AdvancedPatternParserSnapshot addPatterns​(java.util.Map<org.eclipse.emf.common.util.URI,​java.lang.String> input,
                                                                                  java.util.Map<?,​?> options,
                                                                                  org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
      • removePatterns

        protected AdvancedPatternParser.AdvancedPatternParserSnapshot removePatterns​(java.util.Map<org.eclipse.emf.common.util.URI,​java.lang.String> input,
                                                                                     java.util.Map<?,​?> options,
                                                                                     org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
      • calculateImpact

        @Deprecated
        protected java.util.Set<org.eclipse.emf.common.util.URI> calculateImpact​(java.util.Set<org.eclipse.emf.common.util.URI> input,
                                                                                 org.eclipse.emf.ecore.resource.ResourceSet rs)
        Deprecated.
        use calculateImpact(Set) instead, the resource set parameter is unnecessary
      • calculateImpact

        protected java.util.Set<org.eclipse.emf.common.util.URI> calculateImpact​(java.util.Set<org.eclipse.emf.common.util.URI> input)
        Since:
        2.2
      • parseBatch

        protected java.util.Map<org.eclipse.emf.common.util.URI,​PatternParsingResults> parseBatch​(java.util.Map<org.eclipse.emf.common.util.URI,​java.lang.String> input,
                                                                                                        java.util.Map<?,​?> options,
                                                                                                        org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
      • getErroneousPatternResources

        protected java.util.Set<org.eclipse.emf.common.util.URI> getErroneousPatternResources​(org.eclipse.emf.ecore.resource.ResourceSet resourceSet,
                                                                                              java.util.Set<org.eclipse.emf.common.util.URI> urisToIgnore)
        Since:
        2.2
      • getErrors

        public java.util.Set<org.eclipse.xtext.validation.Issue> getErrors​(org.eclipse.emf.common.util.URI uri)
        Since:
        2.2