BeanIO 1.2.3

org.beanio.parser
Class GroupNode

java.lang.Object
  extended by org.beanio.parser.Node
      extended by org.beanio.parser.GroupNode
Direct Known Subclasses:
XmlGroupNode

public class GroupNode
extends Node

A GroupNode holds child nodes including records and other groups. This class is the dynamic counterpart to the GroupDefinition and holds the current state of a group node during stream processing.

Since:
1.0
Author:
Kevin Seim

Field Summary
protected  Node last
           
 
Fields inherited from class org.beanio.parser.Node
groupCount
 
Constructor Summary
GroupNode(GroupDefinition definition)
          Constructs a new GroupNode.
 
Method Summary
 void addChild(Node node)
          Adds a child node to this group.
 Node close()
          Checks for any unsatisfied node before the stream is closed.
 List<Node> getChildren()
          Returns a list of child nodes.
protected  NodeDefinition getNodeDefinition()
          Returns this nodes's definition.
 Node matchAny(Record record)
          Finds the child node that matches a record, ignoring the current state of each node.
 Node matchNext(Record record)
          Finds the child node that matches a record, based on the current state of each node.
 void reset()
          Called by its parent to reset node statistics.
 void setChildren(List<Node> children)
          Sets this nodes's children.
 
Methods inherited from class org.beanio.parser.Node
getGroupCount, getMaxOccurs, getMinOccurs, getName, getOrder, isMaxOccursReached, isRecord, setGroupCount, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

last

protected Node last
Constructor Detail

GroupNode

public GroupNode(GroupDefinition definition)
Constructs a new GroupNode.

Parameters:
definition - the group definition
Method Detail

getNodeDefinition

protected NodeDefinition getNodeDefinition()
Description copied from class: Node
Returns this nodes's definition.

Specified by:
getNodeDefinition in class Node
Returns:
the node definition

getChildren

public List<Node> getChildren()
Description copied from class: Node
Returns a list of child nodes.

Specified by:
getChildren in class Node
Returns:
the list of child nodes

addChild

public void addChild(Node node)
Adds a child node to this group.

Parameters:
node - the node to add

setChildren

public void setChildren(List<Node> children)
Sets this nodes's children.

Parameters:
children - the new node children

reset

public void reset()
Description copied from class: Node
Called by its parent to reset node statistics.

Overrides:
reset in class Node

close

public Node close()
Checks for any unsatisfied node before the stream is closed.

Specified by:
close in class Node

matchAny

public Node matchAny(Record record)
Description copied from class: Node
Finds the child node that matches a record, ignoring the current state of each node.

Specified by:
matchAny in class Node
Parameters:
record - the record to match
Returns:
the matching leaf node, or null if the record could not be matched

matchNext

public Node matchNext(Record record)
Description copied from class: Node
Finds the child node that matches a record, based on the current state of each node.

Specified by:
matchNext in class Node
Parameters:
record - the record to match
Returns:
the matched node, or null if no match was found

BeanIO 1.2.3

Copyright © 2010-2012 Kevin Seim