BeanIO 1.2.3

org.beanio.parser
Class GroupDefinition

java.lang.Object
  extended by org.beanio.parser.NodeDefinition
      extended by org.beanio.parser.GroupDefinition
Direct Known Subclasses:
XmlGroupDefinition

public class GroupDefinition
extends NodeDefinition

A GroupDefinition is the branch in the tree structure that makes up a stream definition. A group definition can hold record definitions and other group definitions.

Since:
1.0
Author:
Kevin Seim

Constructor Summary
GroupDefinition()
          Constructs a new GroupDefinition.
 
Method Summary
 void addChild(NodeDefinition node)
          Adds a child to this group definition.
 NodeDefinition findDefinitionFor(Object bean)
          Returns a record definition (i.e.
 Collection<NodeDefinition> getChildren()
          Returns a list of this node's children.
 Collection<RecordDefinition> getRecordDefinitionAncestors()
          Returns all record definition ancestors of this group node.
 boolean isRecordDefinition()
          Returns true if this node is a leaf node, or in this case a record definition.
 void setChildren(Collection<NodeDefinition> children)
          Sets this group's children.
 
Methods inherited from class org.beanio.parser.NodeDefinition
getMaxOccurs, getMinOccurs, getName, getOrder, setMaxOccurs, setMinOccurs, setName, setOrder
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GroupDefinition

public GroupDefinition()
Constructs a new GroupDefinition.

Method Detail

getChildren

public Collection<NodeDefinition> getChildren()
Description copied from class: NodeDefinition
Returns a list of this node's children.

Specified by:
getChildren in class NodeDefinition
Returns:
the list list of the node's children

isRecordDefinition

public final boolean isRecordDefinition()
Description copied from class: NodeDefinition
Returns true if this node is a leaf node, or in this case a record definition.

Specified by:
isRecordDefinition in class NodeDefinition
Returns:
true if this node is a leaf node / record definition

findDefinitionFor

public NodeDefinition findDefinitionFor(Object bean)
Description copied from class: NodeDefinition
Returns a record definition (i.e. leaf node) capable of formatting the given bean.

Specified by:
findDefinitionFor in class NodeDefinition
Parameters:
bean - the bean to format
Returns:
the node context capable of formatting the bean, or null if one could not be found

addChild

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

Parameters:
node - the node definition to add

setChildren

public void setChildren(Collection<NodeDefinition> children)
Sets this group's children.

Parameters:
children - the group children to set

getRecordDefinitionAncestors

public Collection<RecordDefinition> getRecordDefinitionAncestors()
Returns all record definition ancestors of this group node.

Returns:
the collection of record definitions

BeanIO 1.2.3

Copyright © 2010-2012 Kevin Seim