Package org.beanio.internal.parser
Class PropertyComponent
- java.lang.Object
-
- org.beanio.internal.util.TreeNode<Component>
-
- org.beanio.internal.parser.Component
-
- org.beanio.internal.parser.PropertyComponent
-
- All Implemented Interfaces:
java.lang.Cloneable,java.lang.Iterable<Component>,Property,Replicateable
- Direct Known Subclasses:
Bean,CollectionBean
public abstract class PropertyComponent extends Component implements Property
Base class forPropertyimplementations that hold other properties (e.g. a bean object or collection).A
PropertyComponentmay only holdPropertychildren.- Since:
- 2.0
-
-
Field Summary
Fields Modifier and Type Field Description protected static booleancreateMissingBeans-
Fields inherited from interface org.beanio.internal.parser.Property
AGGREGATION_ARRAY, AGGREGATION_COLLECTION, AGGREGATION_MAP, COLLECTION, COMPLEX, MAP, SIMPLE
-
-
Constructor Summary
Constructors Constructor Description PropertyComponent()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PropertyAccessorgetAccessor()java.lang.Class<?>getType()booleanisIdentifier()Returns whether this property or any of its descendants are used to identify a bean object.booleanisMatchNull()Returns whether this bean can still identify a record if null.booleanisRequired()Returns whether this property should always be instantiated whenProperty.createValue(ParsingContext)is invoked.protected booleanisSupportedChild(Component child)Returns whether a node is a supported child of this node.voidsetAccessor(PropertyAccessor accessor)voidsetIdentifier(boolean identifier)voidsetMatchNull(boolean matchNull)Sets whether this bean can still identify a record if null.voidsetRequired(boolean required)Sets whether this property should always be instantiated whenProperty.createValue(ParsingContext)is invoked.voidsetType(java.lang.Class<?> type)protected voidtoParamString(java.lang.StringBuilder s)Called byTreeNode.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, isDescendant, iterator, print, 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
-
-
-
-
Method Detail
-
isIdentifier
public boolean isIdentifier()
Description copied from interface:PropertyReturns whether this property or any of its descendants are used to identify a bean object.- Specified by:
isIdentifierin interfaceProperty- Returns:
trueif this property identifies a bean
-
setIdentifier
public void setIdentifier(boolean identifier)
- Specified by:
setIdentifierin interfaceProperty
-
getAccessor
public PropertyAccessor getAccessor()
- Specified by:
getAccessorin interfaceProperty
-
setAccessor
public void setAccessor(PropertyAccessor accessor)
- Specified by:
setAccessorin interfaceProperty
-
isRequired
public boolean isRequired()
Returns whether this property should always be instantiated whenProperty.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 whenProperty.createValue(ParsingContext)is invoked.- Parameters:
required- true to always instantiate this property, false otherwise
-
isMatchNull
public boolean isMatchNull()
Returns whether this bean can still identify a record if null.- Returns:
- true if null allowed for record identification, false otherwise
-
setMatchNull
public void setMatchNull(boolean matchNull)
Sets whether this bean can still identify a record if null.- Parameters:
matchNull- true if null allowed for record identification, false otherwise
-
isSupportedChild
protected boolean isSupportedChild(Component child)
Description copied from class:TreeNodeReturns whether a node is a supported child of this node. Called byTreeNode.add(TreeNode).- Overrides:
isSupportedChildin classTreeNode<Component>- Parameters:
child- the node to test- Returns:
- true if the child is allowed
-
toParamString
protected void toParamString(java.lang.StringBuilder s)
Description copied from class:TreeNodeCalled byTreeNode.toString()to append node parameters to the output.- Overrides:
toParamStringin classTreeNode<Component>- Parameters:
s- the output to append
-
-