Package org.eclipse.viatra.query.patternlanguage.emf.util

## Class PatternParserBuilder

- java.lang.Object
- - org.eclipse.viatra.query.patternlanguage.emf.util.PatternParserBuilder

- Direct Known Subclasses:
    `PatternParser.Builder`

      public class PatternParserBuilder
      extends java.lang.Object

  Since:
    2.1

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static java.lang.String` | `PPERROR` |

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `PatternParserBuilder()` |

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `PatternParser` | `build()` | Initializes the pattern parser instance
    `AdvancedPatternParser` | `buildAdvanced()` |
    `static PatternParserBuilder` | `instance()` |
    `PatternParsingResults` | `parse​(java.lang.String text)` | Creates a single-use pattern parser instance and collects the parsing results for the selected text, then the forgets the used parser instance.
    `PatternParserBuilder` | `withClassLoader​(java.lang.ClassLoader classLoader)` | Sets a custom classloader for resolving the types in check and eval expressions.
    `PatternParserBuilder` | `withInjector​(com.google.inject.Injector injector)` | Provide a specific injector instance to use with this parser
    `PatternParserBuilder` | `withLibrary​(org.eclipse.emf.common.util.URI libraryURI)` | Provide an URI to a VQL file that can be used as a library.
    `PatternParserBuilder` | `withLibrary​(org.eclipse.emf.common.util.URI libraryURI, java.util.Collection<IQuerySpecification<?>> specifications)` | Provide an URI to a VQL file that can be used as a library, together with a set of query specifications already created from this library.
    `PatternParserBuilder` | `withUnusedURIComputer​(java.util.function.BiFunction<org.eclipse.emf.ecore.resource.ResourceSet,​java.lang.String,​org.eclipse.emf.common.util.URI> unusedURIComputer)` |

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### PPERROR

          public static final java.lang.String PPERROR

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### PatternParserBuilder

          public PatternParserBuilder()

  - ### Method Detail

    - #### instance

          public static PatternParserBuilder instance()

    - #### withInjector

          public PatternParserBuilder withInjector​(com.google.inject.Injector injector)

      Provide a specific injector instance to use with this parser

    - #### withLibrary

          public PatternParserBuilder withLibrary​(org.eclipse.emf.common.util.URI libraryURI)

      Provide an URI to a VQL file that can be used as a library.

    - #### withLibrary

          public PatternParserBuilder withLibrary​(org.eclipse.emf.common.util.URI libraryURI,
                                                  java.util.Collection<IQuerySpecification<?>> specifications)

      Provide an URI to a VQL file that can be used as a library, together with a set of query specifications already created from this library. This can be used to include the generated query specifications for the given library.

    - #### withUnusedURIComputer

          public PatternParserBuilder withUnusedURIComputer​(java.util.function.BiFunction<org.eclipse.emf.ecore.resource.ResourceSet,​java.lang.String,​org.eclipse.emf.common.util.URI> unusedURIComputer)

      Since:
        2.1

    - #### withClassLoader

          public PatternParserBuilder withClassLoader​(java.lang.ClassLoader classLoader)

      Sets a custom classloader for resolving the types in check and eval expressions. If no custom classloader is set, the one use to load the type `PatternParserBuilder` is used.
      Since:
        2.4

    - #### build

          public PatternParser build()

      Initializes the pattern parser instance

    - #### buildAdvanced

          public AdvancedPatternParser buildAdvanced()

    - #### parse

          public PatternParsingResults parse​(java.lang.String text)

      Creates a single-use pattern parser instance and collects the parsing results for the selected text, then the forgets the used parser instance.