registerConverter(new BigDecimalConverter(), PRIORITY_NORMAL); registerConverter(new ArrayConverter(mapper), PRIORITY_NORMAL); registerConverter(new CharArrayConverter(), PRIORITY_NORMAL); registerConverter(new CollectionConverter(mapper), PRIORITY_NORMAL);
public Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context) { // read the items from xml into a list List items = new ArrayList(); while (reader.hasMoreChildren()) { final Object item = readCompleteItem(reader, context, null); // TODO: arg, what should replace null? items.add(item); } // now convertAnother the list into an array // (this has to be done as a separate list as the array size is not // known until all items have been read) Object array = Array.newInstance(context.getRequiredType().getComponentType(), items.size()); int i = 0; for (Iterator iterator = items.iterator(); iterator.hasNext();) { Array.set(array, i++, iterator.next()); } return array; } }
public void marshal(Object source, HierarchicalStreamWriter writer, MarshallingContext context) { int length = Array.getLength(source); for (int i = 0; i < length; i++) { final Object item = Array.get(source, i); writeCompleteItem(item, context, writer); } }
public void marshal(Object source, HierarchicalStreamWriter writer, MarshallingContext context) { int length = Array.getLength(source); for (int i = 0; i < length; i++) { Object item = Array.get(source, i); writeItem(item, context, writer); } }
public Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context) { // read the items from xml into a list List items = new ArrayList(); while (reader.hasMoreChildren()) { reader.moveDown(); Object item = readItem(reader, context, null); // TODO: arg, what should replace null? items.add(item); reader.moveUp(); } // now convertAnother the list into an array // (this has to be done as a separate list as the array size is not // known until all items have been read) Object array = Array.newInstance(context.getRequiredType().getComponentType(), items.size()); int i = 0; for (Iterator iterator = items.iterator(); iterator.hasNext();) { Array.set(array, i++, iterator.next()); } return array; } }
public void marshal(Object source, HierarchicalStreamWriter writer, MarshallingContext context) { int length = Array.getLength(source); for (int i = 0; i < length; i++) { Object item = Array.get(source, i); writeItem(item, context, writer); } }
public Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context) { // read the items from xml into a list List items = new ArrayList(); while (reader.hasMoreChildren()) { reader.moveDown(); Object item = readItem(reader, context, null); // TODO: arg, what should replace null? items.add(item); reader.moveUp(); } // now convertAnother the list into an array // (this has to be done as a separate list as the array size is not // known until all items have been read) Object array = Array.newInstance(context.getRequiredType().getComponentType(), items.size()); int i = 0; for (Iterator iterator = items.iterator(); iterator.hasNext();) { Array.set(array, i++, iterator.next()); } return array; } }
registerConverter(new BigDecimalConverter(), PRIORITY_NORMAL); registerConverter(new ArrayConverter(mapper), PRIORITY_NORMAL); registerConverter(new CharArrayConverter(), PRIORITY_NORMAL); registerConverter(new CollectionConverter(mapper), PRIORITY_NORMAL);
public void marshal(Object source, HierarchicalStreamWriter writer, MarshallingContext context) { int length = Array.getLength(source); for (int i = 0; i < length; i++) { Object item = Array.get(source, i); writeItem(item, context, writer); } }
public Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context) { // read the items from xml into a list List items = new ArrayList(); while (reader.hasMoreChildren()) { reader.moveDown(); Object item = readItem(reader, context, null); // TODO: arg, what should replace null? items.add(item); reader.moveUp(); } // now convertAnother the list into an array // (this has to be done as a separate list as the array size is not // known until all items have been read) Object array = Array.newInstance(context.getRequiredType().getComponentType(), items.size()); int i = 0; for (Iterator iterator = items.iterator(); iterator.hasNext();) { Array.set(array, i++, iterator.next()); } return array; } }
public void marshal(Object source, HierarchicalStreamWriter writer, MarshallingContext context) { int length = Array.getLength(source); for (int i = 0; i < length; i++) { final Object item = Array.get(source, i); writeCompleteItem(item, context, writer); } }
public Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context) { // read the items from xml into a list List items = new ArrayList(); while (reader.hasMoreChildren()) { final Object item = readCompleteItem(reader, context, null); // TODO: arg, what should replace null? items.add(item); } // now convertAnother the list into an array // (this has to be done as a separate list as the array size is not // known until all items have been read) Object array = Array.newInstance(context.getRequiredType().getComponentType(), items.size()); int i = 0; for (Iterator iterator = items.iterator(); iterator.hasNext();) { Array.set(array, i++, iterator.next()); } return array; } }
registerConverter(new BigDecimalConverter(), PRIORITY_NORMAL); registerConverter(new ArrayConverter(mapper), PRIORITY_NORMAL); registerConverter(new CharArrayConverter(), PRIORITY_NORMAL); registerConverter(new CollectionConverter(mapper), PRIORITY_NORMAL);
public void marshal(Object source, HierarchicalStreamWriter writer, MarshallingContext context) { int length = Array.getLength(source); for (int i = 0; i < length; i++) { Object item = Array.get(source, i); writeItem(item, context, writer); } }
public Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context) { // read the items from xml into a list List items = new ArrayList(); while (reader.hasMoreChildren()) { reader.moveDown(); Object item = readItem(reader, context, null); // TODO: arg, what should replace null? items.add(item); reader.moveUp(); } // now convertAnother the list into an array // (this has to be done as a separate list as the array size is not // known until all items have been read) Object array = Array.newInstance(context.getRequiredType().getComponentType(), items.size()); int i = 0; for (Iterator iterator = items.iterator(); iterator.hasNext();) { Array.set(array, i++, iterator.next()); } return array; } }
@Override public void marshal(final Object source, final HierarchicalStreamWriter writer, final MarshallingContext context) { final int length = Array.getLength(source); for (int i = 0; i < length; i++) { final Object item = Array.get(source, i); writeCompleteItem(item, context, writer); } }
@Override public Object unmarshal(final HierarchicalStreamReader reader, final UnmarshallingContext context) { // read the items from xml into a list (the array size is not known until all items have been read) final List<Object> items = new ArrayList<>(); while (reader.hasMoreChildren()) { final Object item = readCompleteItem(reader, context, null); // TODO: arg, what should replace null? items.add(item); } // now convertAnother the list into an array final Object array = Array.newInstance(context.getRequiredType().getComponentType(), items.size()); int i = 0; for (final Object item : items) { Array.set(array, i++, item); } return array; } }
registerConverter(new BigDecimalConverter(), PRIORITY_NORMAL); registerConverter(new ArrayConverter(mapper), PRIORITY_NORMAL); registerConverter(new CharArrayConverter(), PRIORITY_NORMAL); registerConverter(new CollectionConverter(mapper), PRIORITY_NORMAL);
public void marshal(Object source, HierarchicalStreamWriter writer, MarshallingContext context) { int length = Array.getLength(source); for (int i = 0; i < length; i++) { final Object item = Array.get(source, i); writeCompleteItem(item, context, writer); } }
public Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context) { // read the items from xml into a list List items = new ArrayList(); while (reader.hasMoreChildren()) { final Object item = readCompleteItem(reader, context, null); // TODO: arg, what should replace null? items.add(item); } // now convertAnother the list into an array // (this has to be done as a separate list as the array size is not // known until all items have been read) Object array = Array.newInstance(context.getRequiredType().getComponentType(), items.size()); int i = 0; for (Iterator iterator = items.iterator(); iterator.hasNext();) { Array.set(array, i++, iterator.next()); } return array; } }