Class Parsable

  • public final class Parsable
    extends java.lang.Object

    This class encapsulates all the parameters required to call Parser.parse(Parsable). Because all set- methods return a reference to self, you can write very compact calls to the parser:

     parser.parse(new Parsable()

    In case you are parsing the content of a Model, you can use the fromQueryModel(Model) factory for convenience.

    Simon Thoresen Hult
    • Constructor Detail

      • Parsable

        public Parsable()
    • Method Detail

      • getQuery

        public java.lang.String getQuery()
      • setQuery

        public Parsable setQuery​(java.lang.String query)
      • getFilter

        public java.lang.String getFilter()
      • setFilter

        public Parsable setFilter​(java.lang.String filter)
      • getDefaultIndexName

        public java.lang.String getDefaultIndexName()
      • setDefaultIndexName

        public Parsable setDefaultIndexName​(java.lang.String defaultIndexName)
      • getLanguage

        public getLanguage()
        Returns the language to use when parsing, or null to decide during parsing.
      • getOrDetectLanguage

        public getOrDetectLanguage​(java.lang.String languageDetectionText)
        Returns the language to use when parsing, with a text to use for detection if necessary. if not decided by the item under parsing. This is never null or UNKNOWN
      • setLanguage

        public Parsable setLanguage​( language)
      • getExplicitLanguage

        public java.util.Optional<> getExplicitLanguage()
        Returns the language explicitly set to be used when parsing, or empty if none is set.
      • setExplicitLanguage

        public Parsable setExplicitLanguage​(java.util.Optional<> language)
      • getSources

        public java.util.Set<java.lang.String> getSources()
      • addSource

        public Parsable addSource​(java.lang.String sourceName)
      • addSources

        public Parsable addSources​(java.util.Collection<java.lang.String> sourceNames)
      • getRestrict

        public java.util.Set<java.lang.String> getRestrict()
      • addRestrict

        public Parsable addRestrict​(java.lang.String restrictName)
      • addRestricts

        public Parsable addRestricts​(java.util.Collection<java.lang.String> restrictNames)
      • getSelect

        public Select getSelect()
      • fromQueryModel

        public static Parsable fromQueryModel​(Model model)