BeanIO 1.2.3

org.beanio.parser
Class NodeDefinition

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

public abstract class NodeDefinition
extends Object

The NodeDefinition is the base class for classes used to make up a stream definition's internal tree structure.

All classes and subclasses used to define a stream may be shared across multiple threads and must be thread-safe.

Since:
1.0
Author:
Kevin Seim

Constructor Summary
NodeDefinition()
           
 
Method Summary
abstract  NodeDefinition findDefinitionFor(Object bean)
          Returns a record definition (i.e.
abstract  Collection<NodeDefinition> getChildren()
          Returns a list of this node's children.
 int getMaxOccurs()
          Returns the maximum number of time this node must appear within the context of its parent, or -1 for unbounded.
 int getMinOccurs()
          Returns the minimum number of times this node must appear within the context of its parent.
 String getName()
          Returns the name of the node.
 int getOrder()
          Returns the order in which this node must appear within the context of its parent.
abstract  boolean isRecordDefinition()
          Returns true if this node is a leaf node, or in this case a record definition.
 void setMaxOccurs(int maxOccurs)
          Sets the maximum number of times this node must appear within the context of its parent.
 void setMinOccurs(int minOccurs)
          Sets the minimum number of times this node must appear within the context of its parent.
 void setName(String name)
          Sets the name of this node.
 void setOrder(int order)
          Sets the order in which this node must appear within the context of its parent.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NodeDefinition

public NodeDefinition()
Method Detail

getChildren

public abstract Collection<NodeDefinition> getChildren()
Returns a list of this node's children.

Returns:
the list list of the node's children

isRecordDefinition

public abstract boolean isRecordDefinition()
Returns true if this node is a leaf node, or in this case a record definition.

Returns:
true if this node is a leaf node / record definition

findDefinitionFor

public abstract NodeDefinition findDefinitionFor(Object bean)
Returns a record definition (i.e. leaf node) capable of formatting the given bean.

Parameters:
bean - the bean to format
Returns:
the node context capable of formatting the bean, or null if one could not be found

getName

public String getName()
Returns the name of the node.

Returns:
the name of the node

setName

public void setName(String name)
Sets the name of this node.

Parameters:
name - the new name of this node

getMinOccurs

public int getMinOccurs()
Returns the minimum number of times this node must appear within the context of its parent.

Returns:
the minimum number of occurrences

setMinOccurs

public void setMinOccurs(int minOccurs)
Sets the minimum number of times this node must appear within the context of its parent.

Parameters:
minOccurs - the new minimum number of occurrences

getMaxOccurs

public int getMaxOccurs()
Returns the maximum number of time this node must appear within the context of its parent, or -1 for unbounded.

Returns:
the maximum number of occurrences

setMaxOccurs

public void setMaxOccurs(int maxOccurs)
Sets the maximum number of times this node must appear within the context of its parent. The value -1 is used to denote no boundary.

Parameters:
maxOccurs - the maximum number of occurrences

getOrder

public int getOrder()
Returns the order in which this node must appear within the context of its parent. Multiple nodes may have the same order if they can appear in any order.

Returns:
the node order

setOrder

public void setOrder(int order)
Sets the order in which this node must appear within the context of its parent. Multiple nodes may have the same order if they can appear in any order.

Parameters:
order -

BeanIO 1.2.3

Copyright © 2010-2012 Kevin Seim