|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.xml.sax.HandlerBase org.apache.xmlrpc.XmlRpc
public abstract class 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-RPC server and client.
XmlRpcServer
,
XmlRpcClient
Nested Class Summary | |
---|---|
(package private) class |
XmlRpc.Value
This represents a XML-RPC value parsed from the request. |
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
|
static boolean |
debug
Whether to log debugging output. |
(package private) static java.lang.String |
defaultInputEncoding
Java's name for the input encoding we're using. |
(package private) static int |
DOUBLE
|
(package private) static java.lang.String |
encoding
Java's name for the encoding we're using. |
(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. |
(package private) java.lang.String |
methodName
|
(package private) static int |
NONE
|
(package private) boolean |
readCdata
|
(package private) static int |
RECOVERABLE
|
(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.TimeZone |
tz
|
(package private) java.util.Stack |
values
|
static java.lang.String |
version
The version string used in HTTP communication. |
Constructor Summary | |
---|---|
protected |
XmlRpc()
Creates a new instance with the TypeFactory set to an instance of the class
named by the org.apache.xmlrpc.TypeFactory System
property. |
protected |
XmlRpc(java.lang.String typeFactoryName)
Creates a new instance with the specified TypeFactory . |
Method Summary | |
---|---|
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(SAXParseException e)
Receive notification of a recoverable parser error. |
void |
fatalError(SAXParseException e)
Report a fatal XML parsing error. |
static java.lang.String |
getDefaultInputEncoding()
Return the default input encoding. |
java.lang.String |
getEncoding()
Return the encoding, transforming to the canonical name if possible. |
java.lang.String |
getInputEncoding()
Get the input encoding for this XmlRpc instance. |
static boolean |
getKeepAlive()
get current HTTP keepalive mode. |
static int |
getMaxThreads()
Gets the maximum number of threads used at any given moment. |
(package private) java.util.TimeZone |
getServerTimeZone()
|
protected 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 |
setDefaultInputEncoding(java.lang.String enc)
Set the default input encoding of the XML. |
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. |
void |
setInputEncoding(java.lang.String enc)
Set the input encoding for this XmlRpc instance. |
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. |
(package private) void |
setServerTimeZone(java.util.TimeZone z)
|
void |
startElement(java.lang.String name,
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, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String version
java.lang.String methodName
java.util.Stack values
XmlRpc.Value currentValue
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
UTF8
(of which ISO8859_1
is a
subset).
static java.lang.String defaultInputEncoding
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.
java.util.TimeZone tz
Constructor Detail |
---|
protected XmlRpc()
TypeFactory
set to an instance of the class
named by the org.apache.xmlrpc.TypeFactory
System
property. If property not set or class is unavailable, uses
the default of TypeFactory
.
protected XmlRpc(java.lang.String typeFactoryName)
TypeFactory
.
typeFactoryName
- The fully qualified class name of the
TypeFactory
implementation to use.Method Detail |
---|
void setServerTimeZone(java.util.TimeZone z)
java.util.TimeZone getServerTimeZone()
public static void setDriver(java.lang.String driver) throws java.lang.ClassNotFoundException
java.lang.ClassNotFoundException
public static void setDriver(java.lang.Class driver)
public static void setEncoding(java.lang.String enc)
enc
- The Java name of the encoding.public java.lang.String getEncoding()
XmlWriter.canonicalizeEncoding(String)
public static void setDefaultInputEncoding(java.lang.String enc)
enc
- The Java name of the encoding.setInputEncoding(String)
public static java.lang.String getDefaultInputEncoding()
getInputEncoding()
public void setInputEncoding(java.lang.String enc)
enc
- The Java name of the encoding.public java.lang.String getInputEncoding()
null
if not set.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.
java.lang.Exception
protected abstract void objectParsed(java.lang.Object what)
public void characters(char[] ch, int start, int length) throws SAXException
characters
in interface DocumentHandler
characters
in class HandlerBase
ch
- The characters.start
- The start position in the character array.length
- The number of characters to use from the
character array.
SAXException
- Any SAX exception, possibly
wrapping another exception.DocumentHandler.characters(char[], int, int)
public void endElement(java.lang.String name) throws SAXException
endElement
in interface DocumentHandler
endElement
in class HandlerBase
name
- The element type name.
SAXException
- Any SAX exception, possibly
wrapping another exception.DocumentHandler.endElement(java.lang.String)
public void startElement(java.lang.String name, AttributeList atts) throws SAXException
startElement
in interface DocumentHandler
startElement
in class HandlerBase
name
- The element type name.atts
- The specified or defaulted attributes.
SAXException
- Any SAX exception, possibly
wrapping another exception.DocumentHandler.startElement(java.lang.String, org.xml.sax.AttributeList)
public void error(SAXParseException e) throws SAXException
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 interface ErrorHandler
error
in class HandlerBase
e
-
SAXException
ErrorHandler.warning(org.xml.sax.SAXParseException)
,
SAXParseException
public void fatalError(SAXParseException e) throws SAXException
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 interface ErrorHandler
fatalError
in class HandlerBase
e
-
SAXException
ErrorHandler.fatalError(org.xml.sax.SAXParseException)
,
SAXParseException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |