public class ResultBuilder extends DefaultHandler
Modifier and Type | Class and Description |
---|---|
private static class |
ResultBuilder.ResultPart |
private static class |
ResultBuilder.Tag |
Modifier and Type | Field and Description |
---|---|
private String |
currentError |
private String |
currentErrorCode |
protected static boolean |
DEFAULT_DYNAMIC_VALIDATION
Default dynamic validation support (false).
|
protected static boolean |
DEFAULT_NAMESPACE_PREFIXES
Default namespace prefixes (false).
|
protected static boolean |
DEFAULT_NAMESPACES
Default namespaces support (false).
|
protected static String |
DEFAULT_PARSER_NAME
Default parser name.
|
protected static boolean |
DEFAULT_SCHEMA_VALIDATION
Default Schema validation support (false).
|
protected static boolean |
DEFAULT_VALIDATION
Default validation support (false).
|
protected static String |
DYNAMIC_VALIDATION_FEATURE_ID
Dynamic validation feature id
(http://apache.org/xml/features/validation/dynamic).
|
private static String |
ERROR |
private static String |
FIELD |
private StringBuilder |
fieldContent |
private int |
fieldLevel |
private String |
fieldName |
private boolean |
hasLiteralTags |
private Map<String,Object> |
hitFields |
private Deque<HitGroup> |
hitGroups |
private String |
hitRelevance |
private String |
hitSource |
private String |
hitType |
(package private) Deque<ResultBuilder.ResultPart> |
location |
private static Logger |
log |
protected static String |
NAMESPACE_PREFIXES_FEATURE_ID
Namespace prefixes feature id
(http://xml.org/sax/features/namespace-prefixes).
|
protected static String |
NAMESPACES_FEATURE_ID
Namespaces feature id (http://xml.org/sax/features/namespaces).
|
private int |
offset |
private XMLReader |
parser |
private Query |
query |
private Result |
result |
protected static String |
SCHEMA_VALIDATION_FEATURE_ID
Schema validation feature id
(http://apache.org/xml/features/validation/schema).
|
private List<ResultBuilder.Tag> |
tagStack |
protected static String |
VALIDATION_FEATURE_ID
Validation feature id (http://xml.org/sax/features/validation).
|
Constructor and Description |
---|
ResultBuilder()
Default constructor.
|
ResultBuilder(XMLReader parser) |
Modifier and Type | Method and Description |
---|---|
void |
characters(char[] ch,
int start,
int length) |
static XMLReader |
createParser() |
void |
endElement(String namespaceURI,
String localName,
String qName) |
private void |
endElementInField(String qName,
String enclosingTag) |
private void |
endElementInHitField(String qName) |
void |
error(SAXParseException ex) |
private Object |
extractDocumentID() |
void |
fatalError(SAXParseException ex) |
void |
ignorableWhitespace(char[] ch,
int start,
int length) |
Result |
parse(InputSource input,
Query query) |
Result |
parse(String identifier,
Query query) |
protected void |
printError(String type,
SAXParseException ex)
Prints the error message.
|
void |
processingInstruction(String target,
String data) |
private void |
reset() |
private static void |
setParserFeatures(XMLReader reader) |
private void |
setQuery(Query query) |
void |
startDocument() |
void |
startElement(String uri,
String local,
String raw,
Attributes attrs) |
private void |
startHit(Attributes attrs) |
private void |
startHitGroup(Attributes attrs) |
private void |
tagInField(String tag,
Attributes attrs,
String enclosingTag) |
void |
warning(SAXParseException ex) |
endDocument, endPrefixMapping, notationDecl, resolveEntity, setDocumentLocator, skippedEntity, startPrefixMapping, unparsedEntityDecl
private static final String ERROR
private static final String FIELD
private static Logger log
protected static final String NAMESPACES_FEATURE_ID
protected static final String NAMESPACE_PREFIXES_FEATURE_ID
protected static final String VALIDATION_FEATURE_ID
protected static final String SCHEMA_VALIDATION_FEATURE_ID
protected static final String DYNAMIC_VALIDATION_FEATURE_ID
protected static final String DEFAULT_PARSER_NAME
protected static final boolean DEFAULT_NAMESPACES
protected static final boolean DEFAULT_NAMESPACE_PREFIXES
protected static final boolean DEFAULT_VALIDATION
protected static final boolean DEFAULT_SCHEMA_VALIDATION
protected static final boolean DEFAULT_DYNAMIC_VALIDATION
private StringBuilder fieldContent
private String fieldName
private int fieldLevel
private boolean hasLiteralTags
private String hitType
private String hitRelevance
private String hitSource
private int offset
private List<ResultBuilder.Tag> tagStack
private final XMLReader parser
private Query query
private Result result
Deque<ResultBuilder.ResultPart> location
private String currentErrorCode
private String currentError
public ResultBuilder() throws RuntimeException
RuntimeException
public ResultBuilder(XMLReader parser)
public static XMLReader createParser()
private static void setParserFeatures(XMLReader reader)
public void startDocument() throws SAXException
startDocument
in interface ContentHandler
startDocument
in class DefaultHandler
SAXException
private void reset()
public void startElement(String uri, String local, String raw, Attributes attrs) throws SAXException
startElement
in interface ContentHandler
startElement
in class DefaultHandler
SAXException
private void startHitGroup(Attributes attrs)
private void startHit(Attributes attrs)
private void tagInField(String tag, Attributes attrs, String enclosingTag)
private void endElementInHitField(String qName)
public void characters(char[] ch, int start, int length) throws SAXException
characters
in interface ContentHandler
characters
in class DefaultHandler
SAXException
public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException
ignorableWhitespace
in interface ContentHandler
ignorableWhitespace
in class DefaultHandler
SAXException
public void processingInstruction(String target, String data) throws SAXException
processingInstruction
in interface ContentHandler
processingInstruction
in class DefaultHandler
SAXException
public void endElement(String namespaceURI, String localName, String qName) throws SAXException
endElement
in interface ContentHandler
endElement
in class DefaultHandler
SAXException
private Object extractDocumentID()
public void warning(SAXParseException ex) throws SAXException
warning
in interface ErrorHandler
warning
in class DefaultHandler
SAXException
public void error(SAXParseException ex) throws SAXException
error
in interface ErrorHandler
error
in class DefaultHandler
SAXException
public void fatalError(SAXParseException ex) throws SAXException
fatalError
in interface ErrorHandler
fatalError
in class DefaultHandler
SAXException
protected void printError(String type, SAXParseException ex)
public Result parse(InputSource input, Query query)
private void setQuery(Query query)
Copyright © 2017. All rights reserved.