org.apache.xmlrpc.parser

Class XmlRpcResponseParser

Implemented Interfaces:
ContentHandler, TypeParser

public class XmlRpcResponseParser
extends RecursiveTypeParserImpl

A SAX parser for an XmlRpcServer's response.

Field Summary

Fields inherited from class org.apache.xmlrpc.parser.RecursiveTypeParserImpl

cfg

Constructor Summary

XmlRpcResponseParser(XmlRpcStreamRequestConfig pConfig, TypeFactory pTypeFactory)
Creates a new instance.

Method Summary

protected void
addResult(Object pResult)
void
endElement(String pURI, String pLocalName, String pQName)
Throwable
getErrorCause()
If the response contained a fault, returns the (optional) exception.
int
getErrorCode()
If the response contained a fault, returns the error code.
String
getErrorMessage()
If the response contained a fault, returns the error message.
boolean
isSuccess()
Returns whether the response returned success.
void
startDocument()
void
startElement(String pURI, String pLocalName, String pQName, Attributes pAttrs)

Methods inherited from class org.apache.xmlrpc.parser.RecursiveTypeParserImpl

addResult, characters, endElement, endPrefixMapping, endValueTag, ignorableWhitespace, processingInstruction, skippedEntity, startDocument, startElement, startPrefixMapping, startValueTag

Methods inherited from class org.apache.xmlrpc.parser.TypeParserImpl

characters, endDocument, endPrefixMapping, getDocumentLocator, getResult, ignorableWhitespace, isEmpty, processingInstruction, setDocumentLocator, setResult, skippedEntity, startDocument, startPrefixMapping

Constructor Details

XmlRpcResponseParser

public XmlRpcResponseParser(XmlRpcStreamRequestConfig pConfig,
                            TypeFactory pTypeFactory)
Creates a new instance.
Parameters:
pConfig - The response configuration.
pTypeFactory - The type factory for creating instances of TypeParser.

Method Details

addResult

protected void addResult(Object pResult)
            throws SAXException
Overrides:
addResult in interface RecursiveTypeParserImpl

endElement

public void endElement(String pURI,
                       String pLocalName,
                       String pQName)
            throws SAXException
Overrides:
endElement in interface RecursiveTypeParserImpl

getErrorCause

public Throwable getErrorCause()
If the response contained a fault, returns the (optional) exception.

getErrorCode

public int getErrorCode()
If the response contained a fault, returns the error code.
Returns:
The numeric error code.

getErrorMessage

public String getErrorMessage()
If the response contained a fault, returns the error message.
Returns:
The error message.

isSuccess

public boolean isSuccess()
Returns:
True, if the response indicated success, false otherwise.

startDocument

public void startDocument()
            throws SAXException
Overrides:
startDocument in interface RecursiveTypeParserImpl

startElement

public void startElement(String pURI,
                         String pLocalName,
                         String pQName,
                         Attributes pAttrs)
            throws SAXException
Overrides:
startElement in interface RecursiveTypeParserImpl

Copyright © 2001-2007 Apache Software Foundation. All Rights Reserved.