Class XmlRpcResponseParser
java.lang.Object
org.apache.xmlrpc.parser.TypeParserImpl
org.apache.xmlrpc.parser.RecursiveTypeParserImpl
org.apache.xmlrpc.parser.XmlRpcResponseParser
- All Implemented Interfaces:
TypeParser, ContentHandler
A SAX parser for an
XmlRpcServer's
response.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Throwableprivate intprivate Stringprivate booleanprivate intFields inherited from class RecursiveTypeParserImpl
cfg -
Constructor Summary
ConstructorsConstructorDescriptionXmlRpcResponseParser(XmlRpcStreamRequestConfig pConfig, TypeFactory pTypeFactory) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidvoidendElement(String pURI, String pLocalName, String pQName) If the response contained a fault, returns the (optional) exception.intIf the response contained a fault, returns the error code.If the response contained a fault, returns the error message.booleanReturns whether the response returned success.voidvoidstartElement(String pURI, String pLocalName, String pQName, Attributes pAttrs) Methods inherited from class RecursiveTypeParserImpl
characters, endPrefixMapping, endValueTag, ignorableWhitespace, processingInstruction, skippedEntity, startPrefixMapping, startValueTagMethods inherited from class TypeParserImpl
endDocument, getDocumentLocator, getResult, isEmpty, setDocumentLocator, setResult
-
Field Details
-
level
private int level -
isSuccess
private boolean isSuccess -
errorCode
private int errorCode -
errorMessage
-
errorCause
-
-
Constructor Details
-
XmlRpcResponseParser
Creates a new instance.- Parameters:
pConfig- The response configuration.pTypeFactory- The type factory for creating instances ofTypeParser.
-
-
Method Details
-
addResult
- Specified by:
addResultin classRecursiveTypeParserImpl- Throws:
SAXException
-
startDocument
- Specified by:
startDocumentin interfaceContentHandler- Overrides:
startDocumentin classRecursiveTypeParserImpl- Throws:
SAXException
-
startElement
public void startElement(String pURI, String pLocalName, String pQName, Attributes pAttrs) throws SAXException - Specified by:
startElementin interfaceContentHandler- Overrides:
startElementin classRecursiveTypeParserImpl- Throws:
SAXException
-
endElement
- Specified by:
endElementin interfaceContentHandler- Overrides:
endElementin classRecursiveTypeParserImpl- Throws:
SAXException
-
isSuccess
public boolean isSuccess()Returns whether the response returned success. If so, the result object may be fetched usingTypeParserImpl.getResult(). Otherwise, you may use the methodsgetErrorCode()andgetErrorMessage()to check for error reasons.- Returns:
- True, if the response indicated success, false otherwise.
-
getErrorCode
public int getErrorCode()If the response contained a fault, returns the error code.- Returns:
- The numeric error code.
-
getErrorMessage
If the response contained a fault, returns the error message.- Returns:
- The error message.
-
getErrorCause
If the response contained a fault, returns the (optional) exception.
-