com.flat502.rox.marshal.xmlrpc
Class SaxMethodCallUnmarshaller

java.lang.Object
  extended by com.flat502.rox.marshal.xmlrpc.SaxMethodCallUnmarshaller
All Implemented Interfaces:
ExtendedMethodCallUnmarshaller, MethodCallUnmarshaller, MethodUnmarshaller

public class SaxMethodCallUnmarshaller
extends java.lang.Object
implements ExtendedMethodCallUnmarshaller

Parse XML RPC method call using SAX


Constructor Summary
SaxMethodCallUnmarshaller()
           
SaxMethodCallUnmarshaller(SaxParserPool pool)
           
 
Method Summary
protected  RpcCall buildXmlRpcMethodCall(SaxUnmarshaller unmarshaller)
           
 FieldNameCodec getDefaultFieldNameCodec()
          This method is invoked when no specific FieldNameCodec exists.
protected  RpcCall unmarshal(org.xml.sax.InputSource in, MethodCallUnmarshallerAid aid)
           
 RpcCall unmarshal(java.io.InputStream in)
          Unmarshal an RpcCall instance from an InputStream.
 RpcCall unmarshal(java.io.InputStream in, java.lang.Class[] structClasses)
          Unmarshal an RpcCall instance from an InputStream.
 RpcCall unmarshal(java.io.InputStream in, MethodCallUnmarshallerAid aid)
          Unmarshal an RpcCall instance from an InputStream.
 RpcCall unmarshal(java.io.Reader in)
          Unmarshal an RpcCall instance from a Reader.
 RpcCall unmarshal(java.io.Reader in, java.lang.Class[] structClasses)
          Unmarshal an RpcCall instance from a Reader.
 RpcCall unmarshal(java.io.Reader in, MethodCallUnmarshallerAid aid)
          Unmarshal an RpcCall instance from a Reader.
 RpcCall unmarshal(java.lang.String xml)
          Unmarshal an RpcCall instance from an XML string.
 RpcCall unmarshal(java.lang.String xml, java.lang.Class[] structClasses)
          Unmarshal an RpcCall instance from an XML string.
 RpcCall unmarshal(java.lang.String xml, MethodCallUnmarshallerAid aid)
          Unmarshal an RpcCall instance from an XML string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SaxMethodCallUnmarshaller

public SaxMethodCallUnmarshaller(SaxParserPool pool)

SaxMethodCallUnmarshaller

public SaxMethodCallUnmarshaller()
Method Detail

buildXmlRpcMethodCall

protected RpcCall buildXmlRpcMethodCall(SaxUnmarshaller unmarshaller)

unmarshal

public RpcCall unmarshal(java.io.InputStream in,
                         MethodCallUnmarshallerAid aid)
                  throws java.lang.Exception
Description copied from interface: MethodCallUnmarshaller
Unmarshal an RpcCall instance from an InputStream.

Implementations are responsible for determining the stream's character encoding (where applicable).

Specified by:
unmarshal in interface MethodCallUnmarshaller
Parameters:
in - The InputStream from which to unmarshal a new RpcCall instance.
aid - A MethodCallUnmarshallerAid providing the mapping between method parameters when unmarshalling structs. May be null, in which case Map instances will be used in all cases. May also override the default FieldNameCodec.
Returns:
A new instance of this class representing the XML structure in the given document.
Throws:
java.lang.Exception - Implementations are free to throw exceptions.

unmarshal

protected RpcCall unmarshal(org.xml.sax.InputSource in,
                            MethodCallUnmarshallerAid aid)
                     throws java.lang.Exception
Throws:
java.lang.Exception

unmarshal

public RpcCall unmarshal(java.io.Reader in,
                         MethodCallUnmarshallerAid aid)
                  throws java.lang.Exception
Description copied from interface: MethodCallUnmarshaller
Unmarshal an RpcCall instance from a Reader.

Specified by:
unmarshal in interface MethodCallUnmarshaller
Parameters:
in - The Reader from which to unmarshal a new RpcCall instance.
aid - A MethodCallUnmarshallerAid providing the mapping between method parameters when unmarshalling structs. May be null, in which case Map instances will be used in all cases. May also override the default FieldNameCodec.
Returns:
A new instance of this class representing the XML structure in the given document.
Throws:
java.lang.Exception - Implementations are free to throw exceptions.

unmarshal

public RpcCall unmarshal(java.lang.String xml,
                         MethodCallUnmarshallerAid aid)
                  throws java.lang.Exception
Description copied from interface: MethodCallUnmarshaller
Unmarshal an RpcCall instance from an XML string.

Specified by:
unmarshal in interface MethodCallUnmarshaller
Parameters:
xml - The XML string from which to unmarshal a new RpcCall instance.
aid - A MethodCallUnmarshallerAid providing the mapping between method parameters when unmarshalling structs. May be null, in which case Map instances will be used in all cases. May also override the default FieldNameCodec.
Returns:
A new instance of this class representing the XML structure in the given document.
Throws:
java.lang.Exception - Implementations are free to throw exceptions.

unmarshal

public RpcCall unmarshal(java.io.InputStream in)
                  throws java.lang.Exception
Description copied from interface: ExtendedMethodCallUnmarshaller
Unmarshal an RpcCall instance from an InputStream.

Implementations are responsible for determining the stream's character encoding (where applicable).

Specified by:
unmarshal in interface ExtendedMethodCallUnmarshaller
Parameters:
in - The InputStream from which to unmarshal a new RpcCall instance.
Returns:
A new instance of this class representing the XML structure in the given document.
Throws:
java.lang.Exception - Implementations are free to throw exceptions.

unmarshal

public RpcCall unmarshal(java.io.InputStream in,
                         java.lang.Class[] structClasses)
                  throws java.lang.Exception
Description copied from interface: ExtendedMethodCallUnmarshaller
Unmarshal an RpcCall instance from an InputStream.

Implementations are responsible for determining the stream's character encoding (where applicable).

Specified by:
unmarshal in interface ExtendedMethodCallUnmarshaller
Parameters:
in - The InputStream from which to unmarshal a new RpcCall instance.
structClasses - A list of classes to unmarshal parameters into if said parameters are structs. May be null, in which case Map instances will be used in all cases. Parameters are indexed into this array based on their position. If this index exceeds the length of this array, or if the indexed element is null a Map instance will be used.
Returns:
A new instance of this class representing the XML structure in the given document.
Throws:
java.lang.Exception - Implementations are free to throw exceptions.

unmarshal

public RpcCall unmarshal(java.io.Reader in)
                  throws java.lang.Exception
Description copied from interface: ExtendedMethodCallUnmarshaller
Unmarshal an RpcCall instance from a Reader.

Specified by:
unmarshal in interface ExtendedMethodCallUnmarshaller
Parameters:
in - The Reader from which to unmarshal a new RpcCall instance.
Returns:
A new instance of this class representing the XML structure in the given document.
Throws:
java.lang.Exception - Implementations are free to throw exceptions.

unmarshal

public RpcCall unmarshal(java.io.Reader in,
                         java.lang.Class[] structClasses)
                  throws java.lang.Exception
Description copied from interface: ExtendedMethodCallUnmarshaller
Unmarshal an RpcCall instance from a Reader.

Specified by:
unmarshal in interface ExtendedMethodCallUnmarshaller
Parameters:
in - The Reader from which to unmarshal a new RpcCall instance.
structClasses - A list of classes to unmarshal parameters into if said parameters are structs. May be null, in which case Map instances will be used in all cases. Parameters are indexed into this array based on their position. If this index exceeds the length of this array, or if the indexed element is null a Map instance will be used.
Returns:
A new instance of this class representing the XML structure in the given document.
Throws:
java.lang.Exception - Implementations are free to throw exceptions.

unmarshal

public RpcCall unmarshal(java.lang.String xml)
                  throws java.lang.Exception
Description copied from interface: ExtendedMethodCallUnmarshaller
Unmarshal an RpcCall instance from an XML string.

Specified by:
unmarshal in interface ExtendedMethodCallUnmarshaller
Parameters:
xml - The XML string from which to unmarshal a new RpcCall instance.
Returns:
A new instance of this class representing the XML structure in the given document.
Throws:
java.lang.Exception - Implementations are free to throw exceptions.

unmarshal

public RpcCall unmarshal(java.lang.String xml,
                         java.lang.Class[] structClasses)
                  throws java.lang.Exception
Description copied from interface: ExtendedMethodCallUnmarshaller
Unmarshal an RpcCall instance from an XML string.

Specified by:
unmarshal in interface ExtendedMethodCallUnmarshaller
Parameters:
xml - The XML string from which to unmarshal a new RpcCall instance.
structClasses - A list of classes to unmarshal parameters into if said parameters are structs. May be null, in which case Map instances will be used in all cases. Parameters are indexed into this array based on their position. If this index exceeds the length of this array, or if the indexed element is null a Map instance will be used.
Returns:
A new instance of this class representing the XML structure in the given document.
Throws:
java.lang.Exception - Implementations are free to throw exceptions.

getDefaultFieldNameCodec

public FieldNameCodec getDefaultFieldNameCodec()
Description copied from interface: MethodUnmarshaller
This method is invoked when no specific FieldNameCodec exists.

For client implementations this typically means no codec has been set on the client.

For server implementations this typically means UnmarshallerAid.getFieldNameCodec(String) has returned null.

Specified by:
getDefaultFieldNameCodec in interface MethodUnmarshaller
Returns:
the default codec associated with this unmarshaller.