public class Strlen extends CellProcessorAdaptor implements StringCellProcessor
> 0
or an exception is thrown. Lookup time is O(1).next
Constructor and Description |
---|
Strlen(int... requiredLengths)
Constructs a new Strlen processor, which ensures that the input String has a length equal to any of the
supplied lengths.
|
Strlen(int[] requiredLengths,
CellProcessor next)
Constructs a new Strlen processor, which ensures that the input String has a length equal to any of the
supplied lengths, then calls the next processor in the chain.
|
Strlen(int requiredLength,
CellProcessor next)
Constructs a new Strlen processor, which ensures that the input String has a length equal to the
supplied length, then calls the next processor in the chain.
|
Modifier and Type | Method and Description |
---|---|
Object |
execute(Object value,
CsvContext context)
This method is invoked by the framework when the processor needs to process data or check constraints.
|
toString, validateInputNotNull
public Strlen(int... requiredLengths)
requiredLengths
- one or more required lengthsNullPointerException
- if requiredLengths is nullIllegalArgumentException
- if requiredLengths is empty or contains a negative lengthpublic Strlen(int requiredLength, CellProcessor next)
requiredLength
- the required lengthnext
- the next processor in the chainNullPointerException
- if next is nullIllegalArgumentException
- if requiredLength is negativepublic Strlen(int[] requiredLengths, CellProcessor next)
requiredLengths
- one or more required lengthsnext
- the next processor in the chainNullPointerException
- if requiredLengths or next is nullIllegalArgumentException
- if requiredLengths is empty or contains a negative lengthpublic Object execute(Object value, CsvContext context)
execute
in interface CellProcessor
value
- the value to be processedcontext
- the CSV contextSuperCsvCellProcessorException
- if value is nullSuperCsvConstraintViolationException
- if the length of value isn't one of the required lengthsCopyright © 2007–2015 Super CSV. All rights reserved.