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-RPC server and client.
ARRAY
(package private) static final int ARRAY
BASE64
(package private) static final int BASE64
BOOLEAN
(package private) static final int BOOLEAN
DATE
(package private) static final int DATE
DEFAULT_PARSER
private static final String DEFAULT_PARSER
The default parser to use (MinML).
DOUBLE
(package private) static final int DOUBLE
FATAL
(package private) static final int FATAL
INTEGER
(package private) static final int INTEGER
NONE
(package private) static final int NONE
RECOVERABLE
(package private) static final int RECOVERABLE
STRING
(package private) static final int STRING
STRUCT
(package private) static final int STRUCT
cdata
(package private) StringBuffer cdata
Used to collect character data (CDATA
) of
parameter values.
debug
public static boolean debug
Whether to log debugging output.
defaultInputEncoding
(package private) static String defaultInputEncoding
Java's name for the input encoding we're using. Defaults to
null
, signifying the platform default. This may
need to be overridden on platforms where the default encoding
is not compatible with ASCII (eg. EBCDIC) but the network is
still ASCII-like.
encoding
(package private) static String encoding
Java's name for the encoding we're using. Defaults to
UTF8
(of which ISO8859_1
is a
subset).
errorLevel
(package private) int errorLevel
errorMsg
(package private) String errorMsg
inputEncoding
private String inputEncoding
keepalive
(package private) static boolean keepalive
Wheter to use HTTP Keep-Alive headers.
maxThreads
private static int maxThreads
The maximum number of threads which can be used concurrently.
methodName
(package private) String methodName
parserClass
private static Class parserClass
The class name of SAX parser to use.
readCdata
(package private) boolean readCdata
saxDrivers
private static Hashtable saxDrivers
types
(package private) static final String[] types
The list of valid XML elements used for RPC.
tz
(package private) TimeZone tz
values
(package private) Stack values
version
public static final String version
The version string used in HTTP communication.
characters
public void characters(ch[] ,
int start,
int length)
throws org.xml.sax.SAXException
Method called by SAX driver.
createTypeFactory
private TypeFactory createTypeFactory(String className)
className
- The fully qualified class name of the
implementation to use.
endElement
public void endElement(String name)
throws org.xml.sax.SAXException
Method called by SAX driver.
error
public void error(org.xml.sax.SAXParseException e)
throws org.xml.sax.SAXException
org.xml.sax.SAXException
-
fatalError
public void fatalError(org.xml.sax.SAXParseException e)
throws org.xml.sax.SAXException
org.xml.sax.SAXException
-
getDefaultInputEncoding
public static String getDefaultInputEncoding()
Return the default input encoding. This may be null.
This is always a Java encoding name, it is not transformed.
- the Java encoding name to use, if set, otherwise null.
getEncoding
public String getEncoding()
Return the encoding, transforming to the canonical name if
possible.
getInputEncoding
public String getInputEncoding()
Get the input encoding for this XmlRpc instance. This is a Java
encoding name.
- The Java encoding name to use.
null
if not set.
getKeepAlive
public static boolean getKeepAlive()
get current HTTP keepalive mode.
getMaxThreads
public static int getMaxThreads()
Gets the maximum number of threads used at any given moment.
getServerTimeZone
(package private) TimeZone getServerTimeZone()
objectParsed
protected abstract void objectParsed(Object what)
This method is called when a root level object has been parsed.
Sub-classes implement this callback to receive the fully parsed
object.
parse
(package private) void parse(InputStream is)
throws Exception
Parse the input stream. For each root level object, method
objectParsed
is called.
setDebug
public static void setDebug(boolean val)
Switch debugging output on/off.
setDefaultInputEncoding
public static void setDefaultInputEncoding(String enc)
Set the default input encoding of the XML.
This is used only if set.
enc
- The Java name of the encoding.
setDriver
public static void setDriver(Class driver)
Set the SAX Parser to be used by directly passing the Class object.
setDriver
public static void setDriver(String driver)
throws ClassNotFoundException
Set the SAX Parser to be used. The argument can either be the
full class name or a user friendly shortcut if the parser is
known to this class. The parsers that can currently be set by
shortcut are listed in the main documentation page. If you are
using another parser please send me the name of the SAX driver
and I'll include it in a future release. If setDriver() is
never called then the System property "sax.driver" is
consulted. If that is not defined the driver defaults to
OpenXML.
setEncoding
public static void setEncoding(String enc)
Set the encoding of the XML.
enc
- The Java name of the encoding.
setInputEncoding
public void setInputEncoding(String enc)
Set the input encoding for this XmlRpc instance. This can be
used when the XMLRPC response does not contain the proper
encoding information in the XML declaration.
enc
- The Java name of the encoding.
setKeepAlive
public static void setKeepAlive(boolean val)
Switch HTTP keepalive on/off.
setMaxThreads
public static void setMaxThreads(int maxThreads)
Sets the maximum number of threads used at any given moment.
setServerTimeZone
(package private) void setServerTimeZone(TimeZone z)
startElement
public void startElement(String name,
org.xml.sax.AttributeList atts)
throws org.xml.sax.SAXException
Method called by SAX driver.