*/
public T deserialize(String objStr) {
T ret = null;
try {
ret = classRef.newInstance();
Message aux = new Message(objStr);
for (int i = 0; i < aux.getMessageSize(); i++) {
String fieldName = aux.getMessageItem(i);
Field field = classRef.getDeclaredField(fieldName);
if (!field.getType().isArray()) {
if (field.getType().isPrimitive()) {
if (field.getType().getName().equals("int")) {
field.set(ret, new Integer(aux.getMessageItem(++i)));
}
}
else if (field.getType().equals(String.class)) {
field.set(ret, aux.getMessageItem(++i));
}
else {
i++;
}
}
else {
if (field.getType().getComponentType().isPrimitive()) {
if (field.getType().getComponentType().getName().equals("int")) {
int[] array = null;
do {
array = ArrayOperations.addElement(new Integer(aux.getMessageItem(++i)), array);
}
while (aux.getMessageItem(++i).equals(fieldName));
i--;
field.set(ret, array);
}
}
else if (field.getType().getComponentType().equals(String.class)) {
String[] array = null;
do {
array = ArrayOperations.addElement(aux.getMessageItem(++i), array);
}
while (aux.getMessageItem(++i).equals(fieldName));
i--;
field.set(ret, array);
}
else {
i++;