org.apache.xmlrpc.parser

Class XmlRpcResponseParser

public class XmlRpcResponseParser extends RecursiveTypeParserImpl

A SAX parser for an XmlRpcServer's response.
Constructor Summary
XmlRpcResponseParser(XmlRpcStreamRequestConfig pConfig, TypeFactory pTypeFactory)
Creates a new instance.
Method Summary
protected voidaddResult(Object pResult)
voidendElement(String pURI, String pLocalName, String pQName)
intgetErrorCode()
If the response contained a fault, returns the error code.
StringgetErrorMessage()
If the response contained a fault, returns the error message.
booleanisSuccess()
Returns whether the response returned success.
voidstartDocument()
voidstartElement(String pURI, String pLocalName, String pQName, Attributes pAttrs)

Constructor Detail

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 Detail

addResult

protected void addResult(Object pResult)

endElement

public void endElement(String pURI, String pLocalName, String pQName)

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 whether the response returned success. If so, the result object may be fetched using XmlRpcResponseParser. Otherwise, you may use the methods getErrorCode and getErrorMessage to check for error reasons.

Returns: True, if the response indicated success, false otherwise.

startDocument

public void startDocument()

startElement

public void startElement(String pURI, String pLocalName, String pQName, Attributes pAttrs)
Copyright © 2001-2007 Apache Software Foundation. All Rights Reserved.