public class DataMapping extends DataMappingPart implements JavaCodeGenerator, DataMappingProblemsSupplier
internalId, internalName, log, TIMESTAMP_FORMAT
SERIALIZED_CLASS_NAME, TYPE
XML_SERIALIZED_CLASS_NAME
Constructor and Description |
---|
DataMapping() |
Modifier and Type | Method and Description |
---|---|
DataMapping |
addCondition(Collection<LogicalExpression> conditions) |
DataMapping |
addCondition(LogicalExpression condition) |
DataException |
addExceptionProperties(DataException exception)
Adds this object's current state to a
DataException . |
DataMapping |
addExcludedFields(Collection<String> excludedFields)
Adds fields to be removed from the target.
|
DataMapping |
addExcludedFields(String... excludedFields)
Adds fields to be removed from the target.
|
DataMapping |
addFieldMapping(Collection<IFieldMapping> fieldMappings) |
DataMapping |
addFieldMapping(IFieldMapping fieldMapping) |
DataMapping |
addFieldMapping(String targetFieldName,
String sourceExpression) |
DataMapping |
fromJson(InputStream inputStream) |
DataMapping |
fromJson(String jsonString) |
DataMapping |
fromRecord(Record source)
Loads this instance's state from a record and returns
this (for fluid API call chaining). |
DataMapping |
fromXml(InputStream inputStream) |
DataMapping |
fromXml(String xml) |
DataMapping |
fromXmlElement(Element dataMappingElement) |
void |
generateJavaCode(JavaCodeBuilder code) |
List<LogicalExpression> |
getConditions() |
List<String> |
getConditionsSource() |
DataMapping |
getDataMapping() |
DataMappingPart |
getDataMappingPartContainer() |
String |
getDataMappingPartName() |
DataMappingPartType |
getDataMappingPartType() |
void |
getDataMappingProblems(List<DataMappingProblem> problems,
boolean includeChildren) |
String |
getDescription() |
Set<String> |
getExcludedFields()
The set of fields to be removed from the target.
|
List<IFieldMapping> |
getFieldMappings() |
String |
getName() |
DefaultExpressionContext |
getRootExpressionContext() |
long |
getRownum() |
EntityDef |
getSourceEntity()
The schema entity used to convert and validate incoming data before this mapping is performed (default
null ). |
EntityDef |
getTargetEntity()
The schema entity used to convert and validate outgoing data after this mapping is performed (default
null ). |
EntityDef |
getTargetValidationEntity()
Deprecated.
|
boolean |
isAutoMapping()
Indicates if incoming source fields should be mapped automatically without the need for explicit
FieldMapping s (default false ). |
DataMappingResult |
map(ExpressionContext expressionContext) |
DataMapping |
setAutoMapping(boolean autoMapping)
Indicates if incoming source fields should be mapped automatically without the need for explicit
FieldMapping s (default false ). |
DataMapping |
setDescription(String description) |
DataMapping |
setName(String name) |
DataMapping |
setSourceEntity(EntityDef sourceEntity)
The schema entity used to convert and validate incoming data before this mapping is performed (default
null ). |
DataMapping |
setTargetEntity(EntityDef targetEntity)
The schema entity used to convert and validate outgoing data after this mapping is performed (default
null ). |
DataMapping |
setTargetValidationEntity(EntityDef targetValidationEntity)
Deprecated.
|
DataMapping |
setValue(String name,
Object value)
Add a constant for this mapping to use when evaluating expressions like the
FieldMapping.getSourceExpression() , AbstractFieldMapping.getCondition() , and getConditions() . |
DataMapping |
setValue(String name,
Object value,
Class<?> type)
Add a constant for this mapping to use when evaluating expressions like the
FieldMapping.getSourceExpression() , AbstractFieldMapping.getCondition() , and getConditions() . |
String |
toJson() |
DataMapping |
toJson(Writer writer) |
DataMapping |
toJson(Writer writer,
boolean closeWriter) |
Record |
toRecord() |
DataMapping |
toXml(Writer writer) |
Element |
toXmlElement(Document document) |
getDataMappingName, getDataMappingPartContainerName, getDataMappingPartContainerType
assertValid, assertValid, clone, exception, exception, exception, getInternalId, getInternalName, resetInternalId
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getDataMappingProblems, getDataMappingProblems
fromArrayValue, fromArrayValue, fromArrayValue, newInstanceFromRecord, newInstanceFromRecord, toArrayValue, toRecord
newInstanceFromJson
forEachGrandChildElement, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getChildElement, getChildElements, newInstanceFromXml, newInstanceFromXml, setAttribute, toXml, toXml, toXml, toXml, writeXml, writeXml
addExceptionProperties, contributeExceptionProperties, contributeExceptionProperties
public void getDataMappingProblems(List<DataMappingProblem> problems, boolean includeChildren)
getDataMappingProblems
in interface DataMappingProblemsSupplier
public String getName()
public DataMapping setName(String name)
public String getDescription()
public DataMapping setDescription(String description)
public boolean isAutoMapping()
FieldMapping
s (default false
).public DataMapping setAutoMapping(boolean autoMapping)
FieldMapping
s (default false
).public DefaultExpressionContext getRootExpressionContext()
public DataMapping setValue(String name, Object value)
FieldMapping.getSourceExpression()
, AbstractFieldMapping.getCondition()
, and getConditions()
.public DataMapping setValue(String name, Object value, Class<?> type)
FieldMapping.getSourceExpression()
, AbstractFieldMapping.getCondition()
, and getConditions()
.public EntityDef getSourceEntity()
null
). No type conversions and validations are performed when null
.public DataMapping setSourceEntity(EntityDef sourceEntity)
null
). No type conversions and validations are performed when null
.public EntityDef getTargetEntity()
null
). No type conversions and validations are performed when null
.public DataMapping setTargetEntity(EntityDef targetEntity)
null
). No type conversions and validations are performed when null
.@Deprecated public EntityDef getTargetValidationEntity()
getTargetEntity()
instead.@Deprecated public DataMapping setTargetValidationEntity(EntityDef targetValidationEntity)
setTargetEntity(EntityDef)
instead.public List<LogicalExpression> getConditions()
public DataMapping addCondition(LogicalExpression condition)
public DataMapping addCondition(Collection<LogicalExpression> conditions)
public List<IFieldMapping> getFieldMappings()
public DataMapping addFieldMapping(IFieldMapping fieldMapping)
public DataMapping addFieldMapping(Collection<IFieldMapping> fieldMappings)
public DataMapping addFieldMapping(String targetFieldName, String sourceExpression)
public Set<String> getExcludedFields()
EntityDef
and returned.public DataMapping addExcludedFields(String... excludedFields)
EntityDef
and returned.public DataMapping addExcludedFields(Collection<String> excludedFields)
EntityDef
and returned.public long getRownum()
public DataMappingResult map(ExpressionContext expressionContext)
public void generateJavaCode(JavaCodeBuilder code)
generateJavaCode
in interface JavaCodeGenerator
public DataException addExceptionProperties(DataException exception)
FoundationObject
DataException
. Since this method is called whenever an
exception is thrown, subclasses should override it to add their specific information.addExceptionProperties
in interface DataExceptionContributor
addExceptionProperties
in class FoundationObject
public DataMapping getDataMapping()
getDataMapping
in class DataMappingPart
public DataMappingPart getDataMappingPartContainer()
getDataMappingPartContainer
in class DataMappingPart
public DataMappingPartType getDataMappingPartType()
getDataMappingPartType
in class DataMappingPart
public String getDataMappingPartName()
getDataMappingPartName
in class DataMappingPart
public Record toRecord()
toRecord
in interface RecordSerializable
toRecord
in class Bean
public DataMapping fromRecord(Record source)
RecordSerializable
this
(for fluid API call chaining).
For fluid API call chaining, the overridden method should change the declared return type to its class.fromRecord
in interface RecordSerializable
fromRecord
in class Bean
public String toJson()
toJson
in interface JsonSerializable
toJson
in interface RecordSerializable
public DataMapping toJson(Writer writer)
toJson
in interface JsonSerializable
toJson
in interface RecordSerializable
public DataMapping toJson(Writer writer, boolean closeWriter)
toJson
in interface JsonSerializable
toJson
in interface RecordSerializable
public DataMapping toXml(Writer writer)
toXml
in interface XmlSerializable
public DataMapping fromJson(String jsonString)
fromJson
in interface JsonSerializable
fromJson
in interface RecordSerializable
public DataMapping fromJson(InputStream inputStream)
fromJson
in interface JsonSerializable
fromJson
in interface RecordSerializable
public DataMapping fromXml(InputStream inputStream)
fromXml
in interface XmlSerializable
public DataMapping fromXml(String xml)
fromXml
in interface XmlSerializable
public Element toXmlElement(Document document)
toXmlElement
in interface XmlSerializable
public DataMapping fromXmlElement(Element dataMappingElement)
fromXmlElement
in interface XmlSerializable
Copyright (c) 2006-2024 North Concepts Inc. All Rights Reserved.