339 |
* @param objRoot the root to which the serialized document should be |
* @param objRoot the root to which the serialized document should be |
340 |
* presented. |
* presented. |
341 |
*/ |
*/ |
342 |
public static void serializeValue(String name, Object value, |
public static <T>void serializeValue(String name, T value, |
343 |
TypeMapper mapper, Document document, |
TypeMapper mapper, Document document, |
344 |
Element objRoot) |
Element objRoot) |
345 |
throws IllegalAccessException |
throws IllegalAccessException |
346 |
{ |
{ |
347 |
serializeValue(name, value, false, true, mapper, document, objRoot); |
serializeValue(name, value, false, true, mapper, document, objRoot); |
361 |
* @param objRoot the root to which the serialized document should be |
* @param objRoot the root to which the serialized document should be |
362 |
* presented. |
* presented. |
363 |
*/ |
*/ |
364 |
public static void serializeValue(String name, Object value, |
public static <T> void serializeValue(String name, T value, |
365 |
boolean includeFieldName, |
boolean includeFieldName, |
366 |
boolean includeTypeName, |
boolean includeTypeName, |
367 |
TypeMapper mapper, Document document, |
TypeMapper mapper, Document document, |
368 |
Element objRoot) |
Element objRoot) |
369 |
throws IllegalAccessException |
throws IllegalAccessException |
370 |
{ |
{ |
371 |
System.out.println("field: " + name); |
System.out.println("field: " + name); |
372 |
if (value == null) |
if (value == null) |
373 |
return; |
return; |
374 |
Class valueClazz = value.getClass(); |
Class<T> valueClazz = (Class<T>) value.getClass(); |
375 |
System.out.println("value: " + value + ", " + valueClazz); |
System.out.println("value: " + value + ", " + valueClazz); |
376 |
XsdType schemaType = mapper.map(valueClazz); |
XsdType<T> schemaType = mapper.map(valueClazz); |
377 |
if (schemaType != null) |
if (schemaType != null) |
378 |
{ |
{ |
379 |
Element element = createElement(document, name); |
Element element = createElement(document, name); |