/** * This <code>write</code> method will write the specified object * to the given XML element as as list entries. Each entry within * the given collection must be assignable from the annotated * type specified within the <code>ElementList</code> annotation. * Each entry is serialized as a root element, that is, its * <code>Root</code> annotation is used to extract the name. * * @param source this is the source collection to be serialized * @param node this is the XML element container to be populated */ public void write(OutputNode node, Object source) throws Exception { Collection list = (Collection) source; OutputNode parent = node.getParent(); if(!node.isCommitted()) { node.remove(); } write(parent, list); }
/** * The <code>write</code> method uses the name of the XML element to * select a converter to be used to write the instance. Selection of * the converter is done by looking up the associated label from * the union group using the instance type. Once the converter has * been selected it is used to write the instance. * * @param node this is the XML element used to write the instance * @param source this is the value that is to be written */ public void write(OutputNode node, Object source) throws Exception { Map map = (Map) source; if(group.isInline()) { if(!map.isEmpty()) { write(node, map); } else if(!node.isCommitted()){ node.remove(); } } else { write(node, map); } }
/** * This <code>write</code> method will write the specified object * to the given XML element as as list entries. Each entry within * the given collection must be assignable from the annotated * type specified within the <code>ElementList</code> annotation. * Each entry is serialized as a root element, that is, its * <code>Root</code> annotation is used to extract the name. * * @param source this is the source collection to be serialized * @param node this is the XML element container to be populated */ public void write(OutputNode node, Object source) throws Exception { Collection list = (Collection) source; OutputNode parent = node.getParent(); if(!node.isCommitted()) { node.remove(); } write(parent, list); }
/** * The <code>write</code> method uses the name of the XML element to * select a converter to be used to write the instance. Selection of * the converter is done by looking up the associated label from * the union group using the instance type. Once the converter has * been selected it is used to write the instance. * * @param node this is the XML element used to write the instance * @param source this is the value that is to be written */ public void write(OutputNode node, Object source) throws Exception { Map map = (Map) source; if(group.isInline()) { if(!map.isEmpty()) { write(node, map); } else if(!node.isCommitted()){ node.remove(); } } else { write(node, map); } }
/** * This <code>write</code> method will write the specified object * to the given XML element as as list entries. Each entry within * the given collection must be assignable from the annotated * type specified within the <code>ElementList</code> annotation. * Each entry is serialized as a root element, that is, its * <code>Root</code> annotation is used to extract the name. * * @param source this is the source collection to be serialized * @param node this is the XML element container to be populated */ public void write(OutputNode node, Object source) throws Exception { Collection list = (Collection) source; OutputNode parent = node.getParent(); if(!node.isCommitted()) { node.remove(); } write(parent, list); }
/** * The <code>write</code> method uses the name of the XML element to * select a converter to be used to write the instance. Selection of * the converter is done by looking up the associated label from * the union group using the instance type. Once the converter has * been selected it is used to write the instance. * * @param source this is the source collection to be serialized * @param node this is the XML element container to be populated */ public void write(OutputNode node, Object source) throws Exception { Collection list = (Collection) source; if(group.isInline()) { if(!list.isEmpty()) { write(node, list); } else if(!node.isCommitted()){ node.remove(); } } else { write(node, list); } }
/** * The <code>write</code> method uses the name of the XML element to * select a converter to be used to write the instance. Selection of * the converter is done by looking up the associated label from * the union group using the instance type. Once the converter has * been selected it is used to write the instance. * * @param source this is the source collection to be serialized * @param node this is the XML element container to be populated */ public void write(OutputNode node, Object source) throws Exception { Collection list = (Collection) source; if(group.isInline()) { if(!list.isEmpty()) { write(node, list); } else if(!node.isCommitted()){ node.remove(); } } else { write(node, list); } }
/** * The <code>write</code> method uses the name of the XML element to * select a converter to be used to write the instance. Selection of * the converter is done by looking up the associated label from * the union group using the instance type. Once the converter has * been selected it is used to write the instance. * * @param source this is the source collection to be serialized * @param node this is the XML element container to be populated */ public void write(OutputNode node, Object source) throws Exception { Collection list = (Collection) source; if(group.isInline()) { if(!list.isEmpty()) { write(node, list); } else if(!node.isCommitted()){ node.remove(); } } else { write(node, list); } }
/** * The <code>write</code> method uses the name of the XML element to * select a converter to be used to write the instance. Selection of * the converter is done by looking up the associated label from * the union group using the instance type. Once the converter has * been selected it is used to write the instance. * * @param node this is the XML element used to write the instance * @param source this is the value that is to be written */ public void write(OutputNode node, Object source) throws Exception { Map map = (Map) source; if(group.isInline()) { if(!map.isEmpty()) { write(node, map); } else if(!node.isCommitted()){ node.remove(); } } else { write(node, map); } }
/** * This <code>write</code> method will write the specified object * to the given XML element as as list entries. Each entry within * the given list must be assignable to the given primitive type. * This will deserialize each entry type as a primitive value. In * order to do this the parent string provided forms the element. * * @param source this is the source collection to be serialized * @param node this is the XML element container to be populated */ public void write(OutputNode node, Object source) throws Exception { OutputNode parent = node.getParent(); Mode mode = node.getMode(); if(!node.isCommitted()) { node.remove(); } write(parent, source, mode); }
/** * This <code>write</code> method will write the specified object * to the given XML element as as list entries. Each entry within * the given list must be assignable to the given primitive type. * This will deserialize each entry type as a primitive value. In * order to do this the parent string provided forms the element. * * @param source this is the source collection to be serialized * @param node this is the XML element container to be populated */ public void write(OutputNode node, Object source) throws Exception { OutputNode parent = node.getParent(); Mode mode = node.getMode(); if(!node.isCommitted()) { node.remove(); } write(parent, source, mode); }
/** * This <code>write</code> method will write the specified object * to the given XML element as as list entries. Each entry within * the given list must be assignable to the given primitive type. * This will deserialize each entry type as a primitive value. In * order to do this the parent string provided forms the element. * * @param source this is the source collection to be serialized * @param node this is the XML element container to be populated */ public void write(OutputNode node, Object source) throws Exception { OutputNode parent = node.getParent(); Mode mode = node.getMode(); if(!node.isCommitted()) { node.remove(); } write(parent, source, mode); }
/** * This <code>write</code> method will write the key value pairs * within the provided map to the specified XML node. This will * write each entry type must contain a key and value so that * the entry can be deserialized in to the map as a pair. If the * key or value object is composite it is read as a root object * so its <code>Root</code> annotation must be present. * * @param node this is the node the map is to be written to * @param source this is the source map that is to be written */ public void write(OutputNode node, Object source) throws Exception { OutputNode parent = node.getParent(); Mode mode = node.getMode(); Map map = (Map) source; if(!node.isCommitted()) { node.remove(); } write(parent, map, mode); }
/** * This <code>write</code> method will write the key value pairs * within the provided map to the specified XML node. This will * write each entry type must contain a key and value so that * the entry can be deserialized in to the map as a pair. If the * key or value object is composite it is read as a root object * so its <code>Root</code> annotation must be present. * * @param node this is the node the map is to be written to * @param source this is the source map that is to be written */ public void write(OutputNode node, Object source) throws Exception { OutputNode parent = node.getParent(); Mode mode = node.getMode(); Map map = (Map) source; if(!node.isCommitted()) { node.remove(); } write(parent, map, mode); }
/** * This <code>write</code> method will write the key value pairs * within the provided map to the specified XML node. This will * write each entry type must contain a key and value so that * the entry can be deserialized in to the map as a pair. If the * key or value object is composite it is read as a root object * so its <code>Root</code> annotation must be present. * * @param node this is the node the map is to be written to * @param source this is the source map that is to be written */ public void write(OutputNode node, Object source) throws Exception { OutputNode parent = node.getParent(); Mode mode = node.getMode(); Map map = (Map) source; if(!node.isCommitted()) { node.remove(); } write(parent, map, mode); }
/** * The <code>write</code> method uses the name of the XML element to * select a converter to be used to write the instance. Selection of * the converter is done by looking up the associated label from * the union group using the instance type. Once the converter has * been selected it is used to write the instance. * * @param node this is the XML element used to write the instance * @param key this is the key associated with the item to write * @param item this is the value associated with the item to write * @param label this is the label to used to acquire the converter */ private void write(OutputNode node, Object key, Object item, Label label) throws Exception { Converter converter = label.getConverter(context); Map map = Collections.singletonMap(key, item); if(!label.isInline()) { String name = label.getName(); String root = style.getElement(name); if(!node.isCommitted()) { node.setName(root); } } converter.write(node, map); } }
/** * The <code>write</code> method uses the name of the XML element to * select a converter to be used to write the instance. Selection of * the converter is done by looking up the associated label from * the union group using the instance type. Once the converter has * been selected it is used to write the instance. * * @param node this is the XML element used to write the instance * @param item this is the individual list entry to be serialized * @param label this is the label to used to acquire the converter */ private void write(OutputNode node, Object item, Label label) throws Exception { Converter converter = label.getConverter(context); Collection list = Collections.singleton(item); if(!label.isInline()) { String name = label.getName(); String root = style.getElement(name); if(!node.isCommitted()) { node.setName(root); } } converter.write(node, list); } }
/** * The <code>write</code> method uses the name of the XML element to * select a converter to be used to write the instance. Selection of * the converter is done by looking up the associated label from * the union group using the instance type. Once the converter has * been selected it is used to write the instance. * * @param node this is the XML element used to write the instance * @param item this is the individual list entry to be serialized * @param label this is the label to used to acquire the converter */ private void write(OutputNode node, Object item, Label label) throws Exception { Converter converter = label.getConverter(context); Collection list = Collections.singleton(item); if(!label.isInline()) { String name = label.getName(); String root = style.getElement(name); if(!node.isCommitted()) { node.setName(root); } } converter.write(node, list); } }
/** * The <code>write</code> method uses the name of the XML element to * select a converter to be used to write the instance. Selection of * the converter is done by looking up the associated label from * the union group using the instance type. Once the converter has * been selected it is used to write the instance. * * @param node this is the XML element used to write the instance * @param key this is the key associated with the item to write * @param item this is the value associated with the item to write * @param label this is the label to used to acquire the converter */ private void write(OutputNode node, Object key, Object item, Label label) throws Exception { Converter converter = label.getConverter(context); Map map = Collections.singletonMap(key, item); if(!label.isInline()) { String name = label.getName(); String root = style.getElement(name); if(!node.isCommitted()) { node.setName(root); } } converter.write(node, map); } }
/** * The <code>write</code> method uses the name of the XML element to * select a converter to be used to write the instance. Selection of * the converter is done by looking up the associated label from * the union group using the instance type. Once the converter has * been selected it is used to write the instance. * * @param node this is the XML element used to write the instance * @param key this is the key associated with the item to write * @param item this is the value associated with the item to write * @param label this is the label to used to acquire the converter */ private void write(OutputNode node, Object key, Object item, Label label) throws Exception { Converter converter = label.getConverter(context); Map map = Collections.singletonMap(key, item); if(!label.isInline()) { String name = label.getName(); String root = style.getElement(name); if(!node.isCommitted()) { node.setName(root); } } converter.write(node, map); } }