BeanIO 1.2.3

org.beanio.parser.xml
Class GroupMarshaller

java.lang.Object
  extended by org.beanio.parser.xml.Marshaller
      extended by org.beanio.parser.xml.GroupMarshaller

public class GroupMarshaller
extends Marshaller

A Marshaller implementation for marshaling group XML nodes.

Since:
1.1
Author:
Kevin Seim

Field Summary
 
Fields inherited from class org.beanio.parser.xml.Marshaller
count
 
Constructor Summary
GroupMarshaller(Marshaller parent, XmlGroupDefinition group)
          Constructs a new GroupMarshaller
 
Method Summary
 Node createHierarchy(Document document)
          Recursively creates the XML hierarchy of group nodes.
 void reset()
          Resets the occurrences of this node and/or its children.
 void restoreState(String namespace, Map<String,Object> state)
          Restores a Map of previously stored state information.
 void updateState(String namespace, Map<String,Object> state)
          Updates a Map with the current state of the Marshaller.
 boolean write(RecordWriter out, String recordName, Object bean)
          Marshals this node to a RecordWriter.
 
Methods inherited from class org.beanio.parser.xml.Marshaller
addChild, getCount, getFirstChild, getKey, getNextSibling, getNodeDefinition, getParent, isMaxOccursReached, removeAllChildren
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GroupMarshaller

public GroupMarshaller(Marshaller parent,
                       XmlGroupDefinition group)
Constructs a new GroupMarshaller

Parameters:
parent - the parent Marshaller
group - the group node definition
Method Detail

reset

public void reset()
Description copied from class: Marshaller
Resets the occurrences of this node and/or its children.

Specified by:
reset in class Marshaller

createHierarchy

public Node createHierarchy(Document document)
Description copied from class: Marshaller
Recursively creates the XML hierarchy of group nodes.

Specified by:
createHierarchy in class Marshaller
Parameters:
document - the document object model to append
Returns:
the parent document node

write

public boolean write(RecordWriter out,
                     String recordName,
                     Object bean)
              throws IOException
Description copied from class: Marshaller
Marshals this node to a RecordWriter.

Specified by:
write in class Marshaller
Parameters:
out - the RecordWriter to write to
recordName - the name of the record to marshal (may be null if unknown)
bean - the record bean to marshal
Returns:
true if the bean was marshal by this node or one of its children, false otherwise
Throws:
IOException - if an I/O error is thrown by the RecordWriter

updateState

public void updateState(String namespace,
                        Map<String,Object> state)
Description copied from class: Marshaller
Updates a Map with the current state of the Marshaller. Used for creating restartable Writers for Spring Batch.

Overrides:
updateState in class Marshaller
Parameters:
namespace - a String to prefix all state keys with
state - the Map to update with the latest state

restoreState

public void restoreState(String namespace,
                         Map<String,Object> state)
Description copied from class: Marshaller
Restores a Map of previously stored state information. Used for restarting XML writers from Spring Batch.

Overrides:
restoreState in class Marshaller
Parameters:
namespace - a String to prefix all state keys with
state - the Map containing the state to restore

BeanIO 1.2.3

Copyright © 2010-2012 Kevin Seim