Version: 1.1.1

ca.ucalgary.services.util
Class SourceMap

java.lang.Object
  extended by javax.xml.transform.stream.StreamSource
      extended by ca.ucalgary.services.util.SourceMap
All Implemented Interfaces:
Map<String,String[]>, Source

public class SourceMap
extends StreamSource
implements Map<String,String[]>

Converts a Map of Strings into a Source for the Java SOAP libraries. The Map should be of the form (SOAP input param name -> XML Schema Instance data). This class assumes that all of the elements being put into the map are of the same namespace as the message name given in the constructor. Nesting of elements is achieved using a colon, e.g. given "a:b" and "a:c" keys, a two level map is created with one entry at the first level (a), and two at the second level (b, c). MEMBER_REF_PREFIX as the entry value denotes the nesting of maps.


Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Field Summary
 
Fields inherited from class javax.xml.transform.stream.StreamSource
FEATURE
 
Constructor Summary
SourceMap(QName msgName, String encoding)
           
 
Method Summary
 void clear()
          Effectively deletes the composite, leaving you with a blank base object
 boolean containsKey(Object fieldName)
          To check for the presence of a field with a given name
 boolean containsValue(Object value)
          To check for the presence of a value in one of the members (e.g Integer, Float, String, Calendar)
 Set<Map.Entry<String,String[]>> entrySet()
          Retrieves each field name/value pair for the members of the composite object
 boolean equals(Object o)
          Returns true if and only if both objects have the same fields with the same values, and the same object ID
 String[] get(Object fieldName)
          Retrieves a member of the composite with a given field name.
 InputStream getInputStream()
          Just before we give up the data, set the stream to be the contents of the Map set to date.
 int hashCode()
           
 boolean isEmpty()
          Is this a blank, uninstantiated object?
 Set<String> keySet()
          Retrieves a list of the field names in this object
 String[] put(String fieldName, String value)
           
 String[] put(String fieldName, String[] values)
          To be used if a sequence is expected for a member.
 void putAll(Map<? extends String,? extends String[]> map)
          Sets a number of object fields at once.
 String[] remove(Object fieldName)
          Removes the field with the given name, if present
 int size()
          Reports the number of data members in the composite object
 String toString()
           
 Collection<String[]> values()
           
 
Methods inherited from class javax.xml.transform.stream.StreamSource
getPublicId, getReader, getSystemId, setInputStream, setPublicId, setReader, setSystemId, setSystemId
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SourceMap

public SourceMap(QName msgName,
                 String encoding)
Parameters:
msgName - the name of the operation message (WSDL 1.1) or operation element (WSDL 2.0) that is being encapsulated
encoding - "literal" or "encoded", the WSDL data encoding style, or "raw", so the wrapping tag is already assumed to be present
Method Detail

getInputStream

public InputStream getInputStream()
Just before we give up the data, set the stream to be the contents of the Map set to date.

Overrides:
getInputStream in class StreamSource

toString

public String toString()
Overrides:
toString in class Object

clear

public void clear()
Effectively deletes the composite, leaving you with a blank base object

Specified by:
clear in interface Map<String,String[]>

values

public Collection<String[]> values()
Specified by:
values in interface Map<String,String[]>

containsKey

public boolean containsKey(Object fieldName)
To check for the presence of a field with a given name

Specified by:
containsKey in interface Map<String,String[]>

containsValue

public boolean containsValue(Object value)
To check for the presence of a value in one of the members (e.g Integer, Float, String, Calendar)

Specified by:
containsValue in interface Map<String,String[]>

entrySet

public Set<Map.Entry<String,String[]>> entrySet()
Retrieves each field name/value pair for the members of the composite object

Specified by:
entrySet in interface Map<String,String[]>

equals

public boolean equals(Object o)
Returns true if and only if both objects have the same fields with the same values, and the same object ID

Specified by:
equals in interface Map<String,String[]>
Overrides:
equals in class Object

get

public String[] get(Object fieldName)
Retrieves a member of the composite with a given field name.

Specified by:
get in interface Map<String,String[]>

hashCode

public int hashCode()
Specified by:
hashCode in interface Map<String,String[]>
Overrides:
hashCode in class Object

isEmpty

public boolean isEmpty()
Is this a blank, uninstantiated object?

Specified by:
isEmpty in interface Map<String,String[]>

keySet

public Set<String> keySet()
Retrieves a list of the field names in this object

Specified by:
keySet in interface Map<String,String[]>

put

public String[] put(String fieldName,
                    String[] values)
To be used if a sequence is expected for a member. fieldName can have the form a or a:b for nested tags to be represented.

Specified by:
put in interface Map<String,String[]>

put

public String[] put(String fieldName,
                    String value)

putAll

public void putAll(Map<? extends String,? extends String[]> map)
Sets a number of object fields at once.

Specified by:
putAll in interface Map<String,String[]>

remove

public String[] remove(Object fieldName)
Removes the field with the given name, if present

Specified by:
remove in interface Map<String,String[]>
Returns:
the data field removed

size

public int size()
Reports the number of data members in the composite object

Specified by:
size in interface Map<String,String[]>

Version: 1.1.1

Submit a bug or feature
Generated: Sat May 29 04:26:35 EDT 2010