org.apache.commons.flatfile
Class InputFilteringDynamicField

java.lang.Object
  extended by org.apache.commons.flatfile.EntitySupport
      extended by org.apache.commons.flatfile.FieldSupport
          extended by org.apache.commons.flatfile.PadJustifyFieldSupport
              extended by org.apache.commons.flatfile.DynamicField
                  extended by org.apache.commons.flatfile.InputFilteringDynamicField
All Implemented Interfaces:
Serializable, Cloneable, Entity

public class InputFilteringDynamicField
extends DynamicField

Dynamic field with filtered input. This allows a user to set up a means by which an Entity containing a nested DynamicField can have a input read in without the DynamicField consuming everything. Instead its filterFactory helps to filter the incoming data for release at the proper point in the stream. TODO test

Version:
$Revision: 758023 $ $Date: 2009-03-24 16:09:19 -0500 (Tue, 24 Mar 2009) $
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.commons.flatfile.DynamicField
DynamicField.Bounds
 
Nested classes/interfaces inherited from class org.apache.commons.flatfile.PadJustifyFieldSupport
PadJustifyFieldSupport.Justify
 
Nested classes/interfaces inherited from class org.apache.commons.flatfile.FieldSupport
FieldSupport.Overflow, FieldSupport.Underflow
 
Constructor Summary
InputFilteringDynamicField()
          Create a new InputFilteringDynamicField.
InputFilteringDynamicField(DynamicField.Bounds bounds)
          Create a new InputFilteringDynamicField.
InputFilteringDynamicField(DynamicField.Bounds bounds, FilterFactory filterFactory)
          Create a new InputFilteringDynamicField.
InputFilteringDynamicField(FilterFactory filterFactory)
          Create a new InputFilteringDynamicField.
 
Method Summary
 FilterFactory getFilterFactory()
          Get the filterFactory.
 void readFrom(InputStream is)
          Read up to maximumLength bytes from the specified InputStream or stop at EOF.
 void setFilterFactory(FilterFactory filterFactory)
          Set the filterFactory.
 
Methods inherited from class org.apache.commons.flatfile.DynamicField
clone, equals, getBounds, getOverflow, getPadJustifyLength, getUnderflow, getValue, hashCode, iSetValue, length, setBounds, setOverflow, setUnderflow, setValue, writeTo
 
Methods inherited from class org.apache.commons.flatfile.PadJustifyFieldSupport
getJustify, getPad, setJustify, setPad
 
Methods inherited from class org.apache.commons.flatfile.FieldSupport
dieOnExceptionRead
 
Methods inherited from class org.apache.commons.flatfile.EntitySupport
fill, getValue, setValue
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InputFilteringDynamicField

public InputFilteringDynamicField()
Create a new InputFilteringDynamicField.


InputFilteringDynamicField

public InputFilteringDynamicField(FilterFactory filterFactory)
Create a new InputFilteringDynamicField.

Parameters:
filterFactory - to filter input

InputFilteringDynamicField

public InputFilteringDynamicField(DynamicField.Bounds bounds)
Create a new InputFilteringDynamicField.

Parameters:
bounds - field bounds

InputFilteringDynamicField

public InputFilteringDynamicField(DynamicField.Bounds bounds,
                                  FilterFactory filterFactory)
Create a new InputFilteringDynamicField.

Parameters:
bounds - field bounds
filterFactory - to filter input
Method Detail

readFrom

public void readFrom(InputStream is)
              throws IOException
Read up to maximumLength bytes from the specified InputStream or stop at EOF. This will rarely be what you want. Instead, consider using InputFilteringDynamicField. In the case that < minimumLength bytes are available from is the justify and pad options come into play.

Specified by:
readFrom in interface Entity
Overrides:
readFrom in class DynamicField
Parameters:
is - the InputStream from which to read data.
Throws:
IOException - on problems with I/O, duh...

getFilterFactory

public FilterFactory getFilterFactory()
Get the filterFactory.

Returns:
FilterFactory

setFilterFactory

public void setFilterFactory(FilterFactory filterFactory)
Set the filterFactory.

Parameters:
filterFactory - the FilterFactory filterFactory to set


Copyright © 2008-2009 The Apache Software Foundation. All Rights Reserved.