|
xmlBlaster 2.2.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.xmlBlaster.util.protocol.ProtoConverter
public class ProtoConverter
This is a utility class used to convert general xmlBlaster data to data is protocol-specific. This is necessary in cases where the protocol does not support a particular data type. This class is used extensively in the xml-rpc protocol where user-defined classes are not supported.
Field Summary | |
---|---|
private static java.util.logging.Logger |
log
|
private static java.lang.String |
ME
|
Constructor Summary | |
---|---|
ProtoConverter()
|
Method Summary | |
---|---|
static void |
main(java.lang.String[] args)
For testing ... |
static java.util.Vector<java.lang.Object> |
messageUnit2Vector(boolean contentAsString,
MsgUnitRaw msg)
Converts a single MsgUnitRaw to a Vector. |
static java.util.Vector<java.lang.Object> |
messageUnitArray2Vector(boolean contentAsString,
MsgUnitRaw[] msgs)
Converts a MsgUnitRaw[] object into a Vector. |
static MsgUnitRaw |
objArray2MsgUnitRaw(java.lang.Object[] inObj)
Converts an Object[3] to a MsgUnitRaw. |
static MsgUnitRaw[] |
objMatrix2MsgUnitRawArray(java.lang.Object[] in)
Converts an Object[][] to a MsgUnitRaw[]. |
static java.lang.String[] |
objToStringArray(java.lang.Object obj)
|
static java.util.Vector<java.lang.String> |
stringArray2Vector(java.lang.String[] strings)
Converts a String[] into a Vector object. |
static MsgUnitRaw |
vector2MsgUnitRaw(java.util.Vector<java.lang.Object> vec)
Converts a Vector to a MsgUnitRaw. |
static MsgUnitRaw[] |
vector2MsgUnitRawArray(java.util.Vector vec)
Converts a Vector to a MsgUnitRaw[]. |
static java.lang.String |
vector2String(java.util.Vector<java.lang.String> vec)
Converts one element of a Vector to a String object. |
static java.lang.String[] |
vector2StringArray(java.util.Vector<java.lang.String> vec)
Converts a Vector to a String[] object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static java.util.logging.Logger log
private static final java.lang.String ME
Constructor Detail |
---|
public ProtoConverter()
Method Detail |
---|
public static MsgUnitRaw vector2MsgUnitRaw(java.util.Vector<java.lang.Object> vec) throws XmlBlasterException
vec
- the vector to convert
XmlBlasterException
- if the size of vec is different from 3, or
if the type of the vector elements does not
correspond to the MsgUnitRaw equivalent.public static MsgUnitRaw objArray2MsgUnitRaw(java.lang.Object[] inObj) throws XmlBlasterException
inObj
- the Object[3] to convert
XmlBlasterException
- if the size of vec is different from 3, or
if the type of the vector elements does not
correspond to the MsgUnitRaw equivalent.public static java.util.Vector<java.lang.Object> messageUnit2Vector(boolean contentAsString, MsgUnitRaw msg)
msg
- the MsgUnitRaw to convert to a Vector.
public static MsgUnitRaw[] vector2MsgUnitRawArray(java.util.Vector vec) throws XmlBlasterException
vec
- the input Vector (of Vector).
XmlBlasterException
- if the types in the input vector are not
consistent with the required types.public static MsgUnitRaw[] objMatrix2MsgUnitRawArray(java.lang.Object[] in) throws XmlBlasterException
vec
- the input Object[][].
XmlBlasterException
- if the types in the input vector are not
consistent with the required types.public static java.util.Vector<java.lang.Object> messageUnitArray2Vector(boolean contentAsString, MsgUnitRaw[] msgs)
msgs
- The array of MsgUnitRaw objects to convert to a Vector object.
public static java.lang.String[] objToStringArray(java.lang.Object obj) throws XmlBlasterException
XmlBlasterException
public static java.lang.String[] vector2StringArray(java.util.Vector<java.lang.String> vec) throws XmlBlasterException
vec
- vector containing the Strings to be converted.
XmlBlasterException
- if the elements in the Vector where not valid
String objects.public static java.lang.String vector2String(java.util.Vector<java.lang.String> vec) throws XmlBlasterException
vec
- vector containing the String to be converted.
XmlBlasterException
- if the element in the Vector is not a valid
String object.public static java.util.Vector<java.lang.String> stringArray2Vector(java.lang.String[] strings)
strings
- array of String objects to convert to a Vector.
public static void main(java.lang.String[] args)
|
xmlBlaster 2.2.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |