org.apache.xmlrpc.parser

Class XmlRpcResponseParser

public class XmlRpcResponseParser extends RecursiveTypeParserImpl

A SAX parser for an {@link org.apache.xmlrpc.server.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 {@link 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 {@link #getResult()}. Otherwise, you may use the methods {@link #getErrorCode()} and {@link #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.