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

## Class PatternParser

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

-     public class PatternParser
      extends BasePatternParser

  Since:
    2.0
  No Extend:
    This class is not intended to be subclassed by clients.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `PatternParser.Builder` Deprecated. use `PatternParserBuilder`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.util.function.BiFunction<org.eclipse.emf.ecore.resource.ResourceSet,java.lang.String,org.eclipse.emf.common.util.URI>` | `UNUSED_ABSOLUTE_FILE_URI_PROVIDER` This function encodes the a file URI scheme that is relative to folder described by the user.dir system property.
    `static java.util.function.BiFunction<org.eclipse.emf.ecore.resource.ResourceSet,java.lang.String,org.eclipse.emf.common.util.URI>` | `UNUSED_RELATIVE_URI_PROVIDER` This function encodes the default URI scheme generation used in VIATRA 2.0.0; it is not recommended to use as it can cause surprising behavior with regards to the Xtext index; only provided for backward compatibility.

    - ### Fields inherited from class org.eclipse.viatra.query.patternlanguage.emf.util.BasePatternParser

      `builder, extensionProvider, fileExtension, librarySpecifications, libraryURIs, manager, resourceFactory, resourceSet, SYNTHETIC_URI_PREFIX, validator`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `PatternParser(java.util.Set<IQuerySpecification<?>> librarySpecifications, java.util.Set<org.eclipse.emf.common.util.URI> libraryURIs, java.util.function.BiFunction<org.eclipse.emf.ecore.resource.ResourceSet,java.lang.String,org.eclipse.emf.common.util.URI> unusedURIComputer, java.util.Optional<java.lang.ClassLoader> classloader)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected PatternParsingResults` | `parse(java.io.InputStream in, org.eclipse.emf.common.util.URI uriToUse, java.util.Map<?,?> options, org.eclipse.emf.ecore.resource.ResourceSet resourceSet)`
    `PatternParsingResults` | `parse(java.lang.String text)` Parses a string as the contents of a VQL file and puts the results in a Resource with a previously unused URI
    `protected PatternParsingResults` | `parse(java.lang.String text, org.eclipse.emf.ecore.resource.ResourceSet resourceSetToUse)`
    `PatternParsingResults` | `parse(java.lang.String text, org.eclipse.emf.common.util.URI uri)` Parses a string as the contents of a VQL file and puts the results in a Resource with the specified URI
    `protected PatternParsingResults` | `parse(java.lang.String text, org.eclipse.emf.common.util.URI uriToUse, org.eclipse.emf.ecore.resource.ResourceSet resourceSetToUse)`
    `static PatternParser.Builder` | `parser()` Deprecated. use `PatternParserBuilder`

    - ### Methods inherited from class org.eclipse.viatra.query.patternlanguage.emf.util.BasePatternParser

      `createResourceSet, enableReuseSpecificationBuilder, getAsStream, getOrCreateSpecificationBuilder, resource`

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

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

- - ### Field Detail

    - #### UNUSED_RELATIVE_URI_PROVIDER

          public static final java.util.function.BiFunction<org.eclipse.emf.ecore.resource.ResourceSet,java.lang.String,org.eclipse.emf.common.util.URI> UNUSED_RELATIVE_URI_PROVIDER

      This function encodes the default URI scheme generation used in VIATRA 2.0.0; it is not recommended to use as it can cause surprising behavior with regards to the Xtext index; only provided for backward compatibility. For most users the `UNUSED_ABSOLUTE_FILE_URI_PROVIDER` provides an appropriate default implementations; other users can provide custom implementations with `PatternParserBuilder#unusedURIComputer(BiFunction)`.
      Since:
        2.1

    - #### UNUSED_ABSOLUTE_FILE_URI_PROVIDER

          public static final java.util.function.BiFunction<org.eclipse.emf.ecore.resource.ResourceSet,java.lang.String,org.eclipse.emf.common.util.URI> UNUSED_ABSOLUTE_FILE_URI_PROVIDER

      This function encodes the a file URI scheme that is relative to folder described by the user.dir system property.
      Since:
        2.1

  - ### Constructor Detail

    - #### PatternParser

          protected PatternParser(java.util.Set<IQuerySpecification<?>> librarySpecifications,
                                  java.util.Set<org.eclipse.emf.common.util.URI> libraryURIs,
                                  java.util.function.BiFunction<org.eclipse.emf.ecore.resource.ResourceSet,java.lang.String,org.eclipse.emf.common.util.URI> unusedURIComputer,
                                  java.util.Optional<java.lang.ClassLoader> classloader)

      Since:
        2.4

  - ### Method Detail

    - #### parse

          public PatternParsingResults parse(java.lang.String text)

      Parses a string as the contents of a VQL file and puts the results in a Resource with a previously unused URI

    - #### parse

          public PatternParsingResults parse(java.lang.String text,
                                             org.eclipse.emf.common.util.URI uri)

      Parses a string as the contents of a VQL file and puts the results in a Resource with the specified URI
      Since:
        2.1

    - #### parse

          protected PatternParsingResults parse(java.io.InputStream in,
                                                org.eclipse.emf.common.util.URI uriToUse,
                                                java.util.Map<?,?> options,
                                                org.eclipse.emf.ecore.resource.ResourceSet resourceSet)

    - #### parse

          protected PatternParsingResults parse(java.lang.String text,
                                                org.eclipse.emf.ecore.resource.ResourceSet resourceSetToUse)

    - #### parse

          protected PatternParsingResults parse(java.lang.String text,
                                                org.eclipse.emf.common.util.URI uriToUse,
                                                org.eclipse.emf.ecore.resource.ResourceSet resourceSetToUse)

    - #### parser

          @Deprecated
          public static PatternParser.Builder parser()

      Deprecated. use `PatternParserBuilder`