|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.xml.sax.HandlerBase | +--org.apache.xmlrpc.XmlRpc
This abstract base class provides basic capabilities for XML-RPC, like parsing of parameters or encoding Java objects into XML-RPC format. Any XML parser with a SAX interface can be used.
XmlRpcServer and XmlRpcClient are the classes that actually implement an XML-RCP server and client.
XmlRpcServer
,
XmlRpcClient
Inner Class Summary | |
(package private) class |
XmlRpc.Value
This represents a XML-RPC value parsed from the request. |
(package private) class |
XmlRpc.XmlWriter
A quick and dirty XML writer. |
Field Summary | |
(package private) static int |
ARRAY
|
(package private) static int |
BASE64
|
(package private) static int |
BOOLEAN
|
(package private) java.lang.StringBuffer |
cdata
Used to collect character data ( CDATA ) of
parameter values. |
(package private) XmlRpc.Value |
currentValue
|
(package private) static int |
DATE
|
(package private) static Formatter |
dateformat
Thread-safe wrapper for the DateFormat object used
to format and parse date/time values. |
static boolean |
debug
Whether to log debugging output. |
private static java.lang.String |
DEFAULT_PARSER
The default parser to use (MinML). |
(package private) static int |
DOUBLE
|
(package private) static java.lang.String |
encoding
Java's name for the encoding we're using. |
(package private) static java.util.Properties |
encodings
Mapping between Java encoding names and "real" names used in XML prolog. |
(package private) int |
errorLevel
|
(package private) java.lang.String |
errorMsg
|
(package private) static int |
FATAL
|
(package private) static int |
INTEGER
|
(package private) static boolean |
keepalive
Wheter to use HTTP Keep-Alive headers. |
private static int |
maxThreads
The maximum number of threads which can be used concurrently. |
(package private) java.lang.String |
methodName
|
(package private) static int |
NONE
|
private static java.lang.Class |
parserClass
The class name of SAX parser to use. |
(package private) boolean |
readCdata
|
(package private) static int |
RECOVERABLE
|
private static java.util.Hashtable |
saxDrivers
|
(package private) static int |
STRING
|
(package private) static int |
STRUCT
|
(package private) static java.lang.String[] |
types
The list of valid XML elements used for RPC. |
(package private) java.util.Stack |
values
|
static java.lang.String |
version
The version string used in HTTP communication. |
Constructor Summary | |
XmlRpc()
|
Method Summary | |
(package private) static void |
|
(package private) static void |
|
void |
characters(char[] ch,
int start,
int length)
Method called by SAX driver. |
void |
endElement(java.lang.String name)
Method called by SAX driver. |
void |
error(org.xml.sax.SAXParseException e)
Receive notification of a recoverable parser error. |
void |
fatalError(org.xml.sax.SAXParseException e)
Report a fatal XML parsing error. |
java.lang.String |
getEncoding()
Return the encoding, transforming to the canonical name if possible. |
static boolean |
getKeepAlive()
get current HTTP keepalive mode. |
static int |
getMaxThreads()
Gets the maximum number of threads used at any given moment. |
(package private) abstract void |
objectParsed(java.lang.Object what)
This method is called when a root level object has been parsed. |
(package private) void |
parse(java.io.InputStream is)
Parse the input stream. |
static void |
setDebug(boolean val)
Switch debugging output on/off. |
static void |
setDriver(java.lang.Class driver)
Set the SAX Parser to be used by directly passing the Class object. |
static void |
setDriver(java.lang.String driver)
Set the SAX Parser to be used. |
static void |
setEncoding(java.lang.String enc)
Set the encoding of the XML. |
static void |
setKeepAlive(boolean val)
Switch HTTP keepalive on/off. |
static void |
setMaxThreads(int maxThreads)
Sets the maximum number of threads used at any given moment. |
void |
startElement(java.lang.String name,
org.xml.sax.AttributeList atts)
Method called by SAX driver. |
Methods inherited from class org.xml.sax.HandlerBase |
endDocument, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, startDocument, unparsedEntityDecl, warning |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String version
private static final java.lang.String DEFAULT_PARSER
private static int maxThreads
java.lang.String methodName
private static java.lang.Class parserClass
private static java.util.Hashtable saxDrivers
java.util.Stack values
XmlRpc.Value currentValue
static Formatter dateformat
DateFormat
object used
to format and parse date/time values.java.lang.StringBuffer cdata
CDATA
) of
parameter values.boolean readCdata
static final int STRING
static final int INTEGER
static final int BOOLEAN
static final int DOUBLE
static final int DATE
static final int BASE64
static final int STRUCT
static final int ARRAY
int errorLevel
java.lang.String errorMsg
static final int NONE
static final int RECOVERABLE
static final int FATAL
static boolean keepalive
public static boolean debug
static final java.lang.String[] types
static java.lang.String encoding
static java.util.Properties encodings
Constructor Detail |
public XmlRpc()
Method Detail |
static void()
static void()
public static void setDriver(java.lang.String driver) throws java.lang.ClassNotFoundException
public static void setDriver(java.lang.Class driver)
public static void setEncoding(java.lang.String enc)
public java.lang.String getEncoding()
public static int getMaxThreads()
public static void setMaxThreads(int maxThreads)
public static void setDebug(boolean val)
public static void setKeepAlive(boolean val)
public static boolean getKeepAlive()
void parse(java.io.InputStream is) throws java.lang.Exception
objectParsed
is called.abstract void objectParsed(java.lang.Object what)
public void characters(char[] ch, int start, int length) throws org.xml.sax.SAXException
characters
in class org.xml.sax.HandlerBase
org.xml.sax.HandlerBase
ch
- The characters.start
- The start position in the character array.length
- The number of characters to use from the
character array.org.xml.sax.SAXException
- Any SAX exception, possibly
wrapping another exception.DocumentHandler.characters(char[], int, int)
public void endElement(java.lang.String name) throws org.xml.sax.SAXException
endElement
in class org.xml.sax.HandlerBase
org.xml.sax.HandlerBase
name
- The element type name.attributes
- The specified or defaulted attributes.org.xml.sax.SAXException
- Any SAX exception, possibly
wrapping another exception.DocumentHandler.endElement(java.lang.String)
public void startElement(java.lang.String name, org.xml.sax.AttributeList atts) throws org.xml.sax.SAXException
startElement
in class org.xml.sax.HandlerBase
org.xml.sax.HandlerBase
name
- The element type name.attributes
- The specified or defaulted attributes.org.xml.sax.SAXException
- Any SAX exception, possibly
wrapping another exception.DocumentHandler.startElement(java.lang.String, org.xml.sax.AttributeList)
public void error(org.xml.sax.SAXParseException e) throws org.xml.sax.SAXException
org.xml.sax.HandlerBase
The default implementation does nothing. Application writers may override this method in a subclass to take specific actions for each error, such as inserting the message in a log file or printing it to the console.
error
in class org.xml.sax.HandlerBase
org.xml.sax.HandlerBase
e
- The warning information encoded as an exception.org.xml.sax.SAXException
- Any SAX exception, possibly
wrapping another exception.ErrorHandler.warning(org.xml.sax.SAXParseException)
,
SAXParseException
public void fatalError(org.xml.sax.SAXParseException e) throws org.xml.sax.SAXException
org.xml.sax.HandlerBase
The default implementation throws a SAXParseException. Application writers may override this method in a subclass if they need to take specific actions for each fatal error (such as collecting all of the errors into a single report): in any case, the application must stop all regular processing when this method is invoked, since the document is no longer reliable, and the parser may no longer report parsing events.
fatalError
in class org.xml.sax.HandlerBase
org.xml.sax.HandlerBase
e
- The error information encoded as an exception.org.xml.sax.SAXException
- Any SAX exception, possibly
wrapping another exception.ErrorHandler.fatalError(org.xml.sax.SAXParseException)
,
SAXParseException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |