BeanIO 2.0.4

org.beanio.internal.parser
Class PropertyComponent

java.lang.Object
  extended by org.beanio.internal.util.TreeNode<Component>
      extended by org.beanio.internal.parser.Component
          extended by org.beanio.internal.parser.PropertyComponent
All Implemented Interfaces:
Cloneable, Iterable<Component>, Property, Replicateable
Direct Known Subclasses:
Bean, CollectionBean

public abstract class PropertyComponent
extends Component
implements Property

Base class for Property implementations that hold other properties (e.g. a bean object or collection).

A PropertyComponent may only hold Property children.

Since:
2.0
Author:
Kevin Seim

Field Summary
protected static boolean createMissingBeans
           
 
Fields inherited from interface org.beanio.internal.parser.Property
AGGREGATION_ARRAY, AGGREGATION_COLLECTION, AGGREGATION_MAP, COLLECTION, COMPLEX, MAP, SIMPLE
 
Constructor Summary
PropertyComponent()
          Constructs a new PropertyComponent.
 
Method Summary
 PropertyAccessor getAccessor()
           
 Class<?> getType()
           
 boolean isIdentifier()
          Returns whether this property or any of its descendants are used to identify a bean object.
 boolean isRequired()
          Returns whether this property should always be instantiated when Property.createValue(ParsingContext) is invoked.
protected  boolean isSupportedChild(Component child)
          Returns whether a node is a supported child of this node.
 void setAccessor(PropertyAccessor accessor)
           
 void setIdentifier(boolean identifier)
           
 void setRequired(boolean required)
          Sets whether this property should always be instantiated when Property.createValue(ParsingContext) is invoked.
 void setType(Class<?> type)
           
protected  void toParamString(StringBuilder s)
          Called by TreeNode.toString() to append node parameters to the output.
 
Methods inherited from class org.beanio.internal.parser.Component
registerLocals
 
Methods inherited from class org.beanio.internal.util.TreeNode
add, clone, find, getChildren, getFirst, getName, iterator, print, setName, size, sort, toString, updateReferences
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.beanio.internal.parser.Property
clearValue, createValue, defines, getName, getValue, setValue, type
 

Field Detail

createMissingBeans

protected static boolean createMissingBeans
Constructor Detail

PropertyComponent

public PropertyComponent()
Constructs a new PropertyComponent.

Method Detail

isIdentifier

public boolean isIdentifier()
Description copied from interface: Property
Returns whether this property or any of its descendants are used to identify a bean object.

Specified by:
isIdentifier in interface Property
Returns:
true if this property identifies a bean

setIdentifier

public void setIdentifier(boolean identifier)
Specified by:
setIdentifier in interface Property

getAccessor

public PropertyAccessor getAccessor()
Specified by:
getAccessor in interface Property

setAccessor

public void setAccessor(PropertyAccessor accessor)
Specified by:
setAccessor in interface Property

getType

public Class<?> getType()
Specified by:
getType in interface Property

setType

public void setType(Class<?> type)
Specified by:
setType in interface Property

isRequired

public boolean isRequired()
Returns whether this property should always be instantiated when Property.createValue(ParsingContext) is invoked.

Returns:
true to always instantiate this property, false otherwise

setRequired

public void setRequired(boolean required)
Sets whether this property should always be instantiated when Property.createValue(ParsingContext) is invoked.

Parameters:
required - true to always instantiate this property, false otherwise

isSupportedChild

protected boolean isSupportedChild(Component child)
Description copied from class: TreeNode
Returns whether a node is a supported child of this node. Called by TreeNode.add(TreeNode).

Overrides:
isSupportedChild in class TreeNode<Component>
Parameters:
child - the node to test
Returns:
true if the child is allowed

toParamString

protected void toParamString(StringBuilder s)
Description copied from class: TreeNode
Called by TreeNode.toString() to append node parameters to the output.

Overrides:
toParamString in class TreeNode<Component>
Parameters:
s - the output to append

BeanIO 2.0.4

Copyright © 2010-2013 Kevin Seim