Class ParserExtension
- java.lang.Object
-
- org.apache.lucene.queryparser.ext.ParserExtension
-
public abstract class ParserExtension extends java.lang.Object
This class represents an extension base class to the Lucene standardQueryParser
. TheQueryParser
is generated by the JavaCC parser generator. Changing or adding functionality or syntax in the standard query parser requires changes to the JavaCC source file. To enable extending the standard query parser without changing the JavaCC sources and re-generate the parser theParserExtension
can be customized and plugged into an instance ofExtendableQueryParser
, a direct subclass ofQueryParser
.- See Also:
Extensions
,ExtendableQueryParser
-
-
Constructor Summary
Constructors Constructor Description ParserExtension()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract Query
parse(ExtensionQuery query)
Processes the givenExtensionQuery
and returns a correspondingQuery
instance.
-
-
-
Method Detail
-
parse
public abstract Query parse(ExtensionQuery query) throws ParseException
Processes the givenExtensionQuery
and returns a correspondingQuery
instance. Subclasses must either return aQuery
instance or raise aParseException
. This method must not returnnull
.- Parameters:
query
- the extension query- Returns:
- a new query instance
- Throws:
ParseException
- if the query can not be parsed.
-
-