org.supercsv.cellprocessor.constraint
Class IsElementOf
- java.lang.Object
-
- org.supercsv.cellprocessor.CellProcessorAdaptor
-
- org.supercsv.cellprocessor.constraint.IsElementOf
-
- All Implemented Interfaces:
- BoolCellProcessor, CellProcessor, DateCellProcessor, DoubleCellProcessor, LongCellProcessor, StringCellProcessor
public class IsElementOf extends CellProcessorAdaptor implements BoolCellProcessor, DateCellProcessor, DoubleCellProcessor, LongCellProcessor, StringCellProcessor
This processor ensures that the input value is an element of a Collection. It differs fromIsIncludedInas the Collection is modifiable, so it can be used with other processors such asCollectorto enforce referential integrity.- Since:
- 2.1.0
-
-
Constructor Summary
Constructors Constructor and Description IsElementOf(java.util.Collection<java.lang.Object> collection)Constructs a new IsElementOf, which ensures that the input value is an element of a Collection.IsElementOf(java.util.Collection<java.lang.Object> collection, CellProcessor next)Constructs a new IsElementOf, which ensures that the input value is an element of a Collection, then calls the next processor in the chain.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description java.lang.Objectexecute(java.lang.Object value, CsvContext context)This method is invoked by the framework when the processor needs to process data or check constraints.-
Methods inherited from class org.supercsv.cellprocessor.CellProcessorAdaptor
toString
-
-
-
-
Constructor Detail
-
IsElementOf
public IsElementOf(java.util.Collection<java.lang.Object> collection)
Constructs a new IsElementOf, which ensures that the input value is an element of a Collection.- Parameters:
collection- the collection to check- Throws:
java.lang.NullPointerException- if collection is null
-
IsElementOf
public IsElementOf(java.util.Collection<java.lang.Object> collection, CellProcessor next)Constructs a new IsElementOf, which ensures that the input value is an element of a Collection, then calls the next processor in the chain.- Parameters:
collection- the collection to checknext- the next processor in the chain- Throws:
java.lang.NullPointerException- if collection or next is null
-
-
Method Detail
-
execute
public java.lang.Object execute(java.lang.Object value, CsvContext context)This method is invoked by the framework when the processor needs to process data or check constraints.- Specified by:
executein interfaceCellProcessor- Throws:
SuperCsvConstraintViolationException- if value isn't in the Collection
-
-
DMelt 3.0 © DataMelt by jWork.ORG