|
BeanIO 1.2.3 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.beanio.parser.PropertyDefinition org.beanio.parser.FieldDefinition org.beanio.parser.xml.XmlFieldDefinition
public class XmlFieldDefinition
Field definition implementation for XML formatted streams.
Field Summary |
---|
Fields inherited from class org.beanio.parser.FieldDefinition |
---|
LEFT, RIGHT |
Fields inherited from class org.beanio.parser.PropertyDefinition |
---|
INVALID, MISSING |
Constructor Summary | |
---|---|
XmlFieldDefinition()
Constructs a new XmlFieldDefinition. |
Method Summary | |
---|---|
protected String |
formatPaddedNull()
Overridden to return null when a padded optional field is null. |
protected String |
formatText(String text)
Formats field text. |
XmlDefinition |
getXmlDefinition()
Returns the XML attributes that define this node. |
protected boolean |
isNilSupported()
Returns whether FieldDefinition.formatValue(Object) may return TypeHandler.NIL . |
boolean |
matches(Record record)
Tests if the field text in the record matches this field definition. |
protected String |
parseField(Record record)
Parses the raw field text from a record prior to any validation and sets the text on the record. |
protected Object |
parsePropertyValue(Record record,
String fieldText)
Parses and validates a field property value from the given field text. |
Methods inherited from class org.beanio.parser.FieldDefinition |
---|
defines, formatValue, getDefaultTextFor, getDefaultValue, getJustification, getLiteral, getMaxLength, getMinLength, getPaddedLength, getPadding, getPosition, getRegex, getRegexPattern, getTypeHandler, isField, isMatch, isMatch, isPadded, isProperty, isRequired, isTrim, parsePropertyValue, setDefaultValue, setJustification, setLiteral, setMaxLength, setMinLength, setPadded, setPaddedLength, setPadding, setPosition, setProperty, setPropertyType, setRegex, setRequired, setTrim, setTypeHandler, unpad |
Methods inherited from class org.beanio.parser.PropertyDefinition |
---|
getCollectionType, getLength, getMaxOccurs, getMinOccurs, getName, getParent, getPropertyDescriptor, getPropertyType, isArray, isBean, isCollection, isConstant, isLazy, isRecordIdentifier, parseValue, setCollectionType, setLazy, setLength, setMaxOccurs, setMinOccurs, setName, setParent, setPropertyDescriptor, setRecordIdentifier |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public XmlFieldDefinition()
Method Detail |
---|
public boolean matches(Record record)
FieldDefinition
matches
in class FieldDefinition
record
- the record containing the field to test
protected String parseField(Record record)
FieldDefinition
parseField
in class FieldDefinition
record
- the record to parse
PropertyDefinition.INVALID
if the field is invalid,
or null if the field is not present in the recordprotected Object parsePropertyValue(Record record, String fieldText)
FieldDefinition
parsePropertyValue
in class FieldDefinition
record
- the record being parsedfieldText
- the field text to parse
PropertyDefinition.INVALID
if the field was invalid,
or PropertyDefinition.MISSING
if the field was not present in the recordprotected String formatText(String text)
FieldDefinition
formatText
in class FieldDefinition
text
- the field text to format
protected boolean isNilSupported()
FieldDefinition
FieldDefinition.formatValue(Object)
may return TypeHandler.NIL
. Returns
false by default, which will convert TypeHandler.NIL to null.
isNilSupported
in class FieldDefinition
FieldDefinition.formatValue(Object)
may return TypeHandler.NIL
.protected String formatPaddedNull()
formatPaddedNull
in class FieldDefinition
public XmlDefinition getXmlDefinition()
XmlNode
getXmlDefinition
in interface XmlNode
|
BeanIO 1.2.3 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |