Package com.sforce.ws.bind
Class TypeMapper
- java.lang.Object
-
- com.sforce.ws.bind.TypeMapper
-
public class TypeMapper extends java.lang.ObjectThis class is used at runtime to bind xml document to java object and java objects back to xml.- Since:
- 1.0 Nov 29, 2005
- Version:
- 1.0
- Author:
- http://cheenath.com
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTypeMapper.PartialArrayException
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringHTMLbooleanwriteFieldXsiType
-
Constructor Summary
Constructors Constructor Description TypeMapper()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconsumeEndTag(XmlInputStream in)voidconsumeStartTag(XmlInputStream in)java.lang.Objectdeserialize(java.lang.String value, javax.xml.namespace.QName type)booleangenerateInterfaces()booleangetGenerateExtendedErrorCodes()java.lang.StringgetInterfacePackagePrefix()java.lang.StringgetJavaClassName(javax.xml.namespace.QName xmltype, Types types, boolean nillable)returns java class name for the specified xml complex typejava.lang.StringgetPackagePrefix()static java.lang.StringgetPrefix(java.lang.String xsiType)static java.lang.StringgetType(java.lang.String xsiType)javax.xml.namespace.QNamegetXmlType(java.lang.String javaType)javax.xml.namespace.QNamegetXsiType(XmlInputStream in)booleanisElement(XmlInputStream in, TypeInfo info)booleanisKeyWord(java.lang.String token)booleanisSObject(java.lang.String namespace, java.lang.String name)booleanisWellKnownType(java.lang.String namespace, java.lang.String name)is this a well know type.doubleparseDouble(java.lang.String strValue)booleanreadBoolean(XmlInputStream in, TypeInfo info, java.lang.Class<?> type)java.math.BigDecimalreadDecimal(XmlInputStream in, TypeInfo info, java.lang.Class<?> type)doublereadDouble(XmlInputStream in, TypeInfo info, java.lang.Class<?> type)floatreadFloat(XmlInputStream in, TypeInfo info, java.lang.Class<?> type)intreadInt(XmlInputStream in, TypeInfo info, java.lang.Class<?> type)longreadLong(XmlInputStream in, TypeInfo info, java.lang.Class<?> type)java.lang.ObjectreadObject(XmlInputStream in, TypeInfo info, java.lang.Class<?> type)java.lang.ObjectreadPartialArray(XmlInputStream in, TypeInfo result__typeInfo, java.lang.Class<?> type)java.lang.StringreadString(XmlInputStream in, TypeInfo info, java.lang.Class<?> type)voidsetConfig(ConnectorConfig config)voidsetGenerateExtendedErrorCodes(boolean generateExtendedErrorCodes)voidsetGenerateInterfaces(boolean generateInterfaces)voidsetInterfacePackagePrefix(java.lang.String interfacePackagePrefix)voidsetPackagePrefix(java.lang.String packagePrefix)booleanverifyElement(XmlInputStream in, TypeInfo info)voidverifyTag(java.lang.String namespace1, java.lang.String name1, java.lang.String namespace2, java.lang.String name2)voidwriteBoolean(XmlOutputStream out, TypeInfo info, boolean value, boolean isSet)java.lang.StringwriteDouble(double value)voidwriteDouble(XmlOutputStream out, TypeInfo info, double value, boolean isSet)voidwriteFieldXsiType(boolean flag)voidwriteFloat(XmlOutputStream out, TypeInfo info, float value, boolean isSet)voidwriteInt(XmlOutputStream out, TypeInfo info, int value, boolean isSet)voidwriteLong(XmlOutputStream out, TypeInfo info, long value, boolean isSet)voidwriteObject(XmlOutputStream out, TypeInfo info, java.lang.Object value, boolean isSet)voidwriteString(XmlOutputStream out, TypeInfo info, java.lang.String value, boolean isSet)voidwriteXsiType(XmlOutputStream out, java.lang.String typeNS, java.lang.String type)write xsi type.
-
-
-
Field Detail
-
HTML
public static final java.lang.String HTML
- See Also:
- Constant Field Values
-
writeFieldXsiType
public boolean writeFieldXsiType
-
-
Method Detail
-
writeFieldXsiType
public void writeFieldXsiType(boolean flag)
-
setPackagePrefix
public void setPackagePrefix(java.lang.String packagePrefix)
-
getPackagePrefix
public java.lang.String getPackagePrefix()
-
getInterfacePackagePrefix
public java.lang.String getInterfacePackagePrefix()
-
setInterfacePackagePrefix
public void setInterfacePackagePrefix(java.lang.String interfacePackagePrefix)
-
isKeyWord
public boolean isKeyWord(java.lang.String token)
-
setConfig
public void setConfig(ConnectorConfig config)
-
isWellKnownType
public boolean isWellKnownType(java.lang.String namespace, java.lang.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 typename- name of the type- Returns:
- true if this is a well known type
-
isSObject
public boolean isSObject(java.lang.String namespace, java.lang.String name)
-
getJavaClassName
public java.lang.String getJavaClassName(javax.xml.namespace.QName xmltype, Types types, boolean nillable)returns java class name for the specified xml complex type- Parameters:
xmltype- xml complex typetypes- typesnillable- nillable- Returns:
- java class name
-
getXmlType
public javax.xml.namespace.QName getXmlType(java.lang.String javaType)
-
writeXsiType
public void writeXsiType(XmlOutputStream out, java.lang.String typeNS, java.lang.String type) throws java.io.IOException
write xsi type. Called if a type has a base class.- Parameters:
out- xml out put streamtypeNS- namespace of the typetype- name of the type- Throws:
java.io.IOException- failed to write
-
writeString
public void writeString(XmlOutputStream out, TypeInfo info, java.lang.String value, boolean isSet) throws java.io.IOException
- Throws:
java.io.IOException
-
writeBoolean
public void writeBoolean(XmlOutputStream out, TypeInfo info, boolean value, boolean isSet) throws java.io.IOException
- Throws:
java.io.IOException
-
writeInt
public void writeInt(XmlOutputStream out, TypeInfo info, int value, boolean isSet) throws java.io.IOException
- Throws:
java.io.IOException
-
writeLong
public void writeLong(XmlOutputStream out, TypeInfo info, long value, boolean isSet) throws java.io.IOException
- Throws:
java.io.IOException
-
writeFloat
public void writeFloat(XmlOutputStream out, TypeInfo info, float value, boolean isSet) throws java.io.IOException
- Throws:
java.io.IOException
-
writeDouble
public void writeDouble(XmlOutputStream out, TypeInfo info, double value, boolean isSet) throws java.io.IOException
- Throws:
java.io.IOException
-
writeDouble
public java.lang.String writeDouble(double value)
-
writeObject
public void writeObject(XmlOutputStream out, TypeInfo info, java.lang.Object value, boolean isSet) throws java.io.IOException
- Throws:
java.io.IOException
-
verifyTag
public void verifyTag(java.lang.String namespace1, java.lang.String name1, java.lang.String namespace2, java.lang.String name2) throws ConnectionException- Throws:
ConnectionException
-
consumeStartTag
public void consumeStartTag(XmlInputStream in) throws java.io.IOException, ConnectionException
- Throws:
java.io.IOExceptionConnectionException
-
consumeEndTag
public void consumeEndTag(XmlInputStream in) throws java.io.IOException, ConnectionException
- Throws:
java.io.IOExceptionConnectionException
-
verifyElement
public boolean verifyElement(XmlInputStream in, TypeInfo info) throws ConnectionException
- Throws:
ConnectionException
-
isElement
public boolean isElement(XmlInputStream in, TypeInfo info) throws ConnectionException
- Throws:
ConnectionException
-
readString
public java.lang.String readString(XmlInputStream in, TypeInfo info, java.lang.Class<?> type) throws java.io.IOException, ConnectionException
- Throws:
java.io.IOExceptionConnectionException
-
readInt
public int readInt(XmlInputStream in, TypeInfo info, java.lang.Class<?> type) throws java.io.IOException, ConnectionException
- Throws:
java.io.IOExceptionConnectionException
-
readLong
public long readLong(XmlInputStream in, TypeInfo info, java.lang.Class<?> type) throws java.io.IOException, ConnectionException
- Throws:
java.io.IOExceptionConnectionException
-
readFloat
public float readFloat(XmlInputStream in, TypeInfo info, java.lang.Class<?> type) throws java.io.IOException, ConnectionException
- Throws:
java.io.IOExceptionConnectionException
-
readBoolean
public boolean readBoolean(XmlInputStream in, TypeInfo info, java.lang.Class<?> type) throws java.io.IOException, ConnectionException
- Throws:
java.io.IOExceptionConnectionException
-
readDouble
public double readDouble(XmlInputStream in, TypeInfo info, java.lang.Class<?> type) throws java.io.IOException, ConnectionException
- Throws:
java.io.IOExceptionConnectionException
-
readDecimal
public java.math.BigDecimal readDecimal(XmlInputStream in, TypeInfo info, java.lang.Class<?> type) throws java.io.IOException, ConnectionException
- Throws:
java.io.IOExceptionConnectionException
-
parseDouble
public double parseDouble(java.lang.String strValue)
-
deserialize
public java.lang.Object deserialize(java.lang.String value, javax.xml.namespace.QName type)
-
readObject
public java.lang.Object readObject(XmlInputStream in, TypeInfo info, java.lang.Class<?> type) throws ConnectionException, java.io.IOException
- Throws:
ConnectionExceptionjava.io.IOException
-
readPartialArray
public java.lang.Object readPartialArray(XmlInputStream in, TypeInfo result__typeInfo, java.lang.Class<?> type) throws ConnectionException, java.io.IOException
- Throws:
ConnectionExceptionjava.io.IOException
-
getXsiType
public javax.xml.namespace.QName getXsiType(XmlInputStream in)
-
getType
public static java.lang.String getType(java.lang.String xsiType)
-
getPrefix
public static java.lang.String getPrefix(java.lang.String xsiType)
-
setGenerateInterfaces
public void setGenerateInterfaces(boolean generateInterfaces)
-
generateInterfaces
public boolean generateInterfaces()
-
setGenerateExtendedErrorCodes
public void setGenerateExtendedErrorCodes(boolean generateExtendedErrorCodes)
-
getGenerateExtendedErrorCodes
public boolean getGenerateExtendedErrorCodes()
-
-