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 forProperty
implementations that hold other properties (e.g. a bean object or collection).A
PropertyComponent
may only holdProperty
children.- Since:
- 2.0
-
-
Field Summary
Fields Modifier and Type Field Description 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
Constructors Constructor Description PropertyComponent()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PropertyAccessor
getAccessor()
java.lang.Class<?>
getType()
boolean
isIdentifier()
Returns whether this property or any of its descendants are used to identify a bean object.boolean
isMatchNull()
Returns whether this bean can still identify a record if null.boolean
isRequired()
Returns whether this property should always be instantiated whenProperty.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
setMatchNull(boolean matchNull)
Sets whether this bean can still identify a record if null.void
setRequired(boolean required)
Sets whether this property should always be instantiated whenProperty.createValue(ParsingContext)
is invoked.void
setType(java.lang.Class<?> type)
protected void
toParamString(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:Property
Returns whether this property or any of its descendants are used to identify a bean object.- Specified by:
isIdentifier
in interfaceProperty
- Returns:
true
if this property identifies a bean
-
setIdentifier
public void setIdentifier(boolean identifier)
- Specified by:
setIdentifier
in interfaceProperty
-
getAccessor
public PropertyAccessor getAccessor()
- Specified by:
getAccessor
in interfaceProperty
-
setAccessor
public void setAccessor(PropertyAccessor accessor)
- Specified by:
setAccessor
in 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:TreeNode
Returns whether a node is a supported child of this node. Called byTreeNode.add(TreeNode)
.- Overrides:
isSupportedChild
in 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:TreeNode
Called byTreeNode.toString()
to append node parameters to the output.- Overrides:
toParamString
in classTreeNode<Component>
- Parameters:
s
- the output to append
-
-