public abstract class FieldTransformer extends Transformer
FieldPath for supported field name expressions.| Constructor and Description |
|---|
FieldTransformer(Collection<String> names) |
FieldTransformer(String... names) |
FieldTransformer(String name) |
| Modifier and Type | Method and Description |
|---|---|
DataException |
addExceptionProperties(DataException exception) |
Field |
getCurrentField() |
Record |
getCurrentRecord() |
String |
getName()
Returns the name of the field this transformer applies to if only one field was specified, otherwise
null if multiple fields. |
FieldPath[] |
getNames() |
String[] |
getNamesAsStrings() |
Object |
getValueOnException() |
boolean |
hasValueOnException() |
boolean |
isThrowExceptionOnMissingField()
Indicates if an exception should be thrown if the source field is missing (default to true).
|
FieldTransformer |
setThrowExceptionOnMissingField(boolean throwExceptionOnMissingField)
Indicates if an exception should be thrown if the source field is missing (default to true).
|
FieldTransformer |
setValueOnException(Object valueOnException) |
String |
toString() |
boolean |
transform(Record record)
Applies this transformer to a record on its way through a
TransformingReader or TransformingWriter. |
protected abstract void |
transformField(Field field) |
close, geEndpoint, getEndpoint, getReader, getWriter, of, open, setWriterpublic FieldTransformer(String... names)
public FieldTransformer(String name)
public FieldTransformer(Collection<String> names)
public String getName()
null if multiple fields.getNames(),
getNamesAsStrings()public FieldPath[] getNames()
public String[] getNamesAsStrings()
public boolean isThrowExceptionOnMissingField()
public FieldTransformer setThrowExceptionOnMissingField(boolean throwExceptionOnMissingField)
public Record getCurrentRecord()
public Field getCurrentField()
public FieldTransformer setValueOnException(Object valueOnException)
public Object getValueOnException()
public boolean hasValueOnException()
public boolean transform(Record record) throws Throwable
TransformerTransformingReader or TransformingWriter.
Contract for subclasses (see also docs/authoring/Transformer.md):
record in place as needed.true to keep the record in the pipeline.false to drop the record (the host routes it to a discard
writer if one is configured, otherwise it disappears).incrementRecordCount() on the host endpoint; the host handles it.transform in class TransformerThrowableprotected abstract void transformField(Field field) throws Throwable
Throwablepublic DataException addExceptionProperties(DataException exception)
addExceptionProperties in class TransformerCopyright (c) 2006-2026 North Concepts Inc. All Rights Reserved.