public class

TypeMapper

extends Object
java.lang.Object
   ↳ com.sforce.ws.bind.TypeMapper

Class Overview

This class is used at runtime to bind xml document to java object and java objects back to xml.

Summary

Nested Classes
class TypeMapper.PartialArrayException  
Fields
private CalendarCodec calendarCodec
private ConnectorConfig config
private DateCodec dateCodec
private static HashMap<String, QName> javaXmlMapping
private static final HashSet<String> keywords
private static HashMap<QName, String> nillableJavaMapping
private String packagePrefix
private static HashMap<String, Class<?>> primitiveClassCache
private HashMap<QName, Class<?>> typeCache
public boolean writeFieldXsiType
private static HashMap<QName, String> xmlJavaMapping
Public Constructors
TypeMapper()
Public Methods
void consumeEndTag(XmlInputStream in)
void consumeStartTag(XmlInputStream in)
Object deserialize(String value, QName type)
String getJavaClassName(QName xmltype, Types types, boolean nillable)
returns java class name for the specified xml complex type
String getPackagePrefix()
static String getPrefix(String xsiType)
static String getType(String xsiType)
QName getXmlType(String javaType)
QName getXsiType(XmlInputStream in)
boolean isElement(XmlInputStream in, TypeInfo info)
boolean isKeyWord(String token)
boolean isWellKnownType(String namespace, String name)
is this a well know type.
double parseDouble(String strValue)
boolean readBoolean(XmlInputStream in, TypeInfo info, Class<?> type)
double readDouble(XmlInputStream in, TypeInfo info, Class<?> type)
float readFloat(XmlInputStream in, TypeInfo info, Class<?> type)
int readInt(XmlInputStream in, TypeInfo info, Class<?> type)
long readLong(XmlInputStream in, TypeInfo info, Class<?> type)
Object readObject(XmlInputStream in, TypeInfo info, Class<?> type)
Object readPartialArray(XmlInputStream in, TypeInfo result__typeInfo, Class<?> type)
String readString(XmlInputStream in, TypeInfo info, Class<?> type)
void setConfig(ConnectorConfig config)
void setPackagePrefix(String packagePrefix)
boolean verifyElement(XmlInputStream in, TypeInfo info)
void verifyTag(String namespace1, String name1, String namespace2, String name2)
void writeBoolean(XmlOutputStream out, TypeInfo info, boolean value, boolean isSet)
void writeDouble(XmlOutputStream out, TypeInfo info, double value, boolean isSet)
String writeDouble(double value)
void writeFieldXsiType(boolean flag)
void writeFloat(XmlOutputStream out, TypeInfo info, float value, boolean isSet)
void writeInt(XmlOutputStream out, TypeInfo info, int value, boolean isSet)
void writeLong(XmlOutputStream out, TypeInfo info, long value, boolean isSet)
void writeObject(XmlOutputStream out, TypeInfo info, Object value, boolean isSet)
void writeString(XmlOutputStream out, TypeInfo info, String value, boolean isSet)
void writeXsiType(XmlOutputStream out, String typeNS, String type)
write xsi type.
[Expand]
Inherited Methods
From class java.lang.Object

Fields

private CalendarCodec calendarCodec

private ConnectorConfig config

private DateCodec dateCodec

private static HashMap<String, QName> javaXmlMapping

private static final HashSet<String> keywords

private static HashMap<QName, String> nillableJavaMapping

private String packagePrefix

private static HashMap<String, Class<?>> primitiveClassCache

private HashMap<QName, Class<?>> typeCache

public boolean writeFieldXsiType

private static HashMap<QName, String> xmlJavaMapping

Public Constructors

public TypeMapper ()

Public Methods

public void consumeEndTag (XmlInputStream in)

Parameters
in
Throws
ConnectionException
IOException

public void consumeStartTag (XmlInputStream in)

Parameters
in
Throws
ConnectionException
IOException

public Object deserialize (String value, QName type)

Parameters
value
type

public String getJavaClassName (QName xmltype, Types types, boolean nillable)

returns java class name for the specified xml complex type

Parameters
xmltype Xml complex type
types Types
nillable Nillable
Returns
  • java class name

public String getPackagePrefix ()

public static String getPrefix (String xsiType)

Parameters
xsiType

public static String getType (String xsiType)

Parameters
xsiType

public QName getXmlType (String javaType)

Parameters
javaType

public QName getXsiType (XmlInputStream in)

Parameters
in

public boolean isElement (XmlInputStream in, TypeInfo info)

Parameters
in
info

public boolean isKeyWord (String token)

Parameters
token

public boolean isWellKnownType (String namespace, String name)

is this a well know type. If it is a well known type, then there is no need to generate a class for the type.

Parameters
namespace Namespace of the type
name Name of the type
Returns
  • true if this is a well known type

public double parseDouble (String strValue)

Parameters
strValue

public boolean readBoolean (XmlInputStream in, TypeInfo info, Class<?> type)

Parameters
in
info
type
Throws
ConnectionException
IOException

public double readDouble (XmlInputStream in, TypeInfo info, Class<?> type)

Parameters
in
info
type
Throws
ConnectionException
IOException

public float readFloat (XmlInputStream in, TypeInfo info, Class<?> type)

Parameters
in
info
type
Throws
ConnectionException
IOException

public int readInt (XmlInputStream in, TypeInfo info, Class<?> type)

Parameters
in
info
type
Throws
ConnectionException
IOException

public long readLong (XmlInputStream in, TypeInfo info, Class<?> type)

Parameters
in
info
type
Throws
ConnectionException
IOException

public Object readObject (XmlInputStream in, TypeInfo info, Class<?> type)

Parameters
in
info
type
Throws
ConnectionException
IOException

public Object readPartialArray (XmlInputStream in, TypeInfo result__typeInfo, Class<?> type)

Parameters
in
result__typeInfo
type
Throws
ConnectionException
IOException

public String readString (XmlInputStream in, TypeInfo info, Class<?> type)

Parameters
in
info
type
Throws
ConnectionException
IOException

public void setConfig (ConnectorConfig config)

Parameters
config

public void setPackagePrefix (String packagePrefix)

Parameters
packagePrefix

public boolean verifyElement (XmlInputStream in, TypeInfo info)

Parameters
in
info

public void verifyTag (String namespace1, String name1, String namespace2, String name2)

Parameters
namespace1
name1
namespace2
name2

public void writeBoolean (XmlOutputStream out, TypeInfo info, boolean value, boolean isSet)

Parameters
out
info
value
isSet
Throws
IOException

public void writeDouble (XmlOutputStream out, TypeInfo info, double value, boolean isSet)

Parameters
out
info
value
isSet
Throws
IOException

public String writeDouble (double value)

Parameters
value

public void writeFieldXsiType (boolean flag)

Parameters
flag

public void writeFloat (XmlOutputStream out, TypeInfo info, float value, boolean isSet)

Parameters
out
info
value
isSet
Throws
IOException

public void writeInt (XmlOutputStream out, TypeInfo info, int value, boolean isSet)

Parameters
out
info
value
isSet
Throws
IOException

public void writeLong (XmlOutputStream out, TypeInfo info, long value, boolean isSet)

Parameters
out
info
value
isSet
Throws
IOException

public void writeObject (XmlOutputStream out, TypeInfo info, Object value, boolean isSet)

Parameters
out
info
value
isSet
Throws
IOException

public void writeString (XmlOutputStream out, TypeInfo info, String value, boolean isSet)

Parameters
out
info
value
isSet
Throws
IOException

public void writeXsiType (XmlOutputStream out, String typeNS, String type)

write xsi type. Called if a type has a base class.

Parameters
out Xml out put stream
typeNS Namespace of the type
type Name of the type
Throws
IOException failed to write