BeanIO 2.0.4

org.beanio.internal.parser.format.fixedlength
Class FixedLengthFieldPadding

java.lang.Object
  extended by org.beanio.internal.parser.format.FieldPadding
      extended by org.beanio.internal.parser.format.fixedlength.FixedLengthFieldPadding

public class FixedLengthFieldPadding
extends FieldPadding

FieldPadding implementation for a fixed length field.

Fixed length padding differs from other field padding in that a completely blank optional field (i.e. all spaces) is formatted as the empty string regardless of the filler character, thus allowing for optional numeric fields.

Since:
2.0
Author:
Kevin Seim

Field Summary
 
Fields inherited from class org.beanio.internal.parser.format.FieldPadding
LEFT, RIGHT
 
Constructor Summary
FixedLengthFieldPadding()
          Constructs a new FixedLengthFieldPadding.
 
Method Summary
 void init()
          Initializes padding settings.
 String unpad(String fieldText)
          Removes padding from the field text.
 
Methods inherited from class org.beanio.internal.parser.format.FieldPadding
getFiller, getJustify, getLength, getPropertyType, isOptional, pad, setFiller, setJustify, setLength, setOptional, setPaddedNull, setPropertyType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FixedLengthFieldPadding

public FixedLengthFieldPadding()
Constructs a new FixedLengthFieldPadding.

Method Detail

init

public void init()
Description copied from class: FieldPadding
Initializes padding settings. This method must be invoked before FieldPadding.pad(String) or FieldPadding.unpad(String) is called.

Overrides:
init in class FieldPadding

unpad

public String unpad(String fieldText)
Description copied from class: FieldPadding
Removes padding from the field text.

Overrides:
unpad in class FieldPadding
Parameters:
fieldText - the field text to remove padding
Returns:
the unpadded field text

BeanIO 2.0.4

Copyright © 2010-2013 Kevin Seim