Package org.beanio.internal.config
Class ComponentConfig
- java.lang.Object
-
- org.beanio.internal.util.TreeNode<ComponentConfig>
-
- org.beanio.internal.config.ComponentConfig
-
- All Implemented Interfaces:
java.lang.Cloneable,java.lang.Iterable<ComponentConfig>,Replicateable
- Direct Known Subclasses:
PropertyConfig
public abstract class ComponentConfig extends TreeNode<ComponentConfig>
The base class for nodes that that make up a stream configuration- groups, records, segments, fields, constants and wrappers. Nodes are organized into a tree structure.The following attributes apply to XML formatted streams only:
- xmlName
- xmlNamespace
- xmlPrefix
The following attributes are set during compilation, and are meant for internal use only:
- xmlNamespaceAware
- Since:
- 2.0
-
-
Field Summary
Fields Modifier and Type Field Description static charCONSTANTConstant component typestatic charFIELDField component typestatic charGROUPGroup component typestatic charRECORDRecord component typestatic charSEGMENTSegment component typestatic charSTREAMStream component typestatic charWRAPPERWrapper component type
-
Constructor Summary
Constructors Constructor Description ComponentConfig()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract chargetComponentType()Returns the component type.java.lang.IntegergetOrdinal()Returns the relative position of this component within its parent components.java.lang.StringgetXmlName()Returns XML element or attribute name of this component.java.lang.StringgetXmlNamespace()Returns the XML namespace of this component.java.lang.StringgetXmlPrefix()Returns the XML prefix for the namespace assigned to this component.booleanisXmlNamespaceAware()Returns whetther this component is namespace aware.voidsetOrdinal(java.lang.Integer ordinal)Sets the relative position of this component within its parent components.voidsetXmlName(java.lang.String xmlName)Sets the XML element or attribute name of this component.voidsetXmlNamespace(java.lang.String xmlNamespace)Sets the XML namespace of this component.voidsetXmlNamespaceAware(boolean xmlNamespaceAware)Sets whether this component is namespace aware.voidsetXmlPrefix(java.lang.String xmlPrefix)Sets the XML prefix for the namespace assigned to this component.-
Methods inherited from class org.beanio.internal.util.TreeNode
add, clone, find, getChildren, getFirst, getName, isDescendant, isSupportedChild, iterator, print, print, setName, size, sort, toParamString, toString, updateReferences
-
-
-
-
Field Detail
-
GROUP
public static final char GROUP
Group component type- See Also:
- Constant Field Values
-
RECORD
public static final char RECORD
Record component type- See Also:
- Constant Field Values
-
SEGMENT
public static final char SEGMENT
Segment component type- See Also:
- Constant Field Values
-
FIELD
public static final char FIELD
Field component type- See Also:
- Constant Field Values
-
CONSTANT
public static final char CONSTANT
Constant component type- See Also:
- Constant Field Values
-
WRAPPER
public static final char WRAPPER
Wrapper component type- See Also:
- Constant Field Values
-
STREAM
public static final char STREAM
Stream component type- See Also:
- Constant Field Values
-
-
Method Detail
-
getComponentType
public abstract char getComponentType()
Returns the component type.
-
getOrdinal
public java.lang.Integer getOrdinal()
Returns the relative position of this component within its parent components.- Returns:
- the relative position
-
setOrdinal
public void setOrdinal(java.lang.Integer ordinal)
Sets the relative position of this component within its parent components.- Parameters:
ordinal- the relative position
-
getXmlName
public java.lang.String getXmlName()
Returns XML element or attribute name of this component.- Returns:
- the XML element or attribute name
-
setXmlName
public void setXmlName(java.lang.String xmlName)
Sets the XML element or attribute name of this component. If set tonull(default), the XML name defaults to the component name.- Parameters:
xmlName- the XML element or attribute name
-
getXmlNamespace
public java.lang.String getXmlNamespace()
Returns the XML namespace of this component.- Returns:
- the XML namespace
-
setXmlNamespace
public void setXmlNamespace(java.lang.String xmlNamespace)
Sets the XML namespace of this component. If set tonull(default), the namespace is inherited from its parent.- Parameters:
xmlNamespace- the XML namespace
-
getXmlPrefix
public java.lang.String getXmlPrefix()
Returns the XML prefix for the namespace assigned to this component.- Returns:
- the XML namespace prefix
-
setXmlPrefix
public void setXmlPrefix(java.lang.String xmlPrefix)
Sets the XML prefix for the namespace assigned to this component. If set tonulland a namespace is set, the namespace will replace the default namespace during marshaling. A prefix should not be set if a namespace is not set.- Parameters:
xmlPrefix- the XML namespace prefix
-
isXmlNamespaceAware
public boolean isXmlNamespaceAware()
Returns whetther this component is namespace aware.- Returns:
- true if this component is namespace aware, false otherwise
-
setXmlNamespaceAware
public void setXmlNamespaceAware(boolean xmlNamespaceAware)
Sets whether this component is namespace aware.- Parameters:
xmlNamespaceAware- true if this component is namespace aware
-
-