Class XMLResponseParser
- java.lang.Object
- 
- org.apache.solr.client.solrj.ResponseParser
- 
- org.apache.solr.client.solrj.impl.XMLResponseParser
 
 
- 
 public class XMLResponseParser extends ResponseParser - Since:
- solr 1.3
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description protected static classXMLResponseParser.KnownType
 - 
Field SummaryFields Modifier and Type Field Description static StringXML_CONTENT_TYPE
 - 
Constructor SummaryConstructors Constructor Description XMLResponseParser()
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected StringconsumeRawContent(XMLStreamReader parser)This is a stub method for handling/validating "raw" xml field values in the context of tests.protected static StringconvertRawContent(String raw, Function<XMLStreamReader,String> consumeRawContent)Convenience method that converts raw String input (should be valid xml when wrapped in a root element) and converts it to a format compatible with howXMLResponseParserparses from raw xml fields.StringgetContentType()A well behaved ResponseParser will return its content-type.StringgetWriterType()NamedList<Object>processResponse(InputStream in, String encoding)NamedList<Object>processResponse(Reader in)protected List<Object>readArray(XMLStreamReader parser)protected SolrDocumentreadDocument(XMLStreamReader parser)protected SolrDocumentListreadDocuments(XMLStreamReader parser)protected NamedList<Object>readNamedList(XMLStreamReader parser)- 
Methods inherited from class org.apache.solr.client.solrj.ResponseParsergetContentTypes, getVersion
 
- 
 
- 
- 
- 
Field Detail- 
XML_CONTENT_TYPEpublic static final String XML_CONTENT_TYPE - See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
getWriterTypepublic String getWriterType() - Specified by:
- getWriterTypein class- ResponseParser
 
 - 
getContentTypepublic String getContentType() Description copied from class:ResponseParserA well behaved ResponseParser will return its content-type.- Overrides:
- getContentTypein class- ResponseParser
- Returns:
- the content-type this parser expects to parse
 
 - 
processResponsepublic NamedList<Object> processResponse(Reader in) - Specified by:
- processResponsein class- ResponseParser
 
 - 
processResponsepublic NamedList<Object> processResponse(InputStream in, String encoding) - Specified by:
- processResponsein class- ResponseParser
 
 - 
readNamedListprotected NamedList<Object> readNamedList(XMLStreamReader parser) throws XMLStreamException - Throws:
- XMLStreamException
 
 - 
readArrayprotected List<Object> readArray(XMLStreamReader parser) throws XMLStreamException - Throws:
- XMLStreamException
 
 - 
readDocumentsprotected SolrDocumentList readDocuments(XMLStreamReader parser) throws XMLStreamException - Throws:
- XMLStreamException
 
 - 
readDocumentprotected SolrDocument readDocument(XMLStreamReader parser) throws XMLStreamException - Throws:
- XMLStreamException
 
 - 
consumeRawContentprotected String consumeRawContent(XMLStreamReader parser) throws XMLStreamException This is a stub method for handling/validating "raw" xml field values in the context of tests. Before this stub method was present, "raw" content would have still thrown an exception, albeit a different, more inscrutable exception.- Throws:
- XMLStreamException
 
 - 
convertRawContentprotected static String convertRawContent(String raw, Function<XMLStreamReader,String> consumeRawContent) throws XMLStreamException Convenience method that converts raw String input (should be valid xml when wrapped in a root element) and converts it to a format compatible with howXMLResponseParserparses from raw xml fields. This method is intended for test validation.The main reason this method exists is to provide a consistent way of configuring and creating and invoking the sub-parser - Throws:
- XMLStreamException
 
 
- 
 
-