public class DataMapping extends DataMappingPart implements JavaCodeGenerator, DataMappingProblemsSupplier
internalId, internalName, log, TIMESTAMP_FORMATSERIALIZED_CLASS_NAME, TYPEXML_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
FieldMappings (default false). |
DataMappingResult |
map(ExpressionContext expressionContext) |
DataMapping |
setAutoMapping(boolean autoMapping)
Indicates if incoming source fields should be mapped automatically without the need for explicit
FieldMappings (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, getDataMappingPartContainerTypeassertValid, assertValid, clone, exception, exception, exception, getInternalId, getInternalName, resetInternalIdequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetDataMappingProblems, getDataMappingProblemsfromArrayValue, fromArrayValue, fromArrayValue, newInstanceFromRecord, newInstanceFromRecord, toArrayValue, toRecordnewInstanceFromJsonforEachGrandChildElement, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getChildElement, getChildElements, newInstanceFromXml, newInstanceFromXml, setAttribute, toXml, toXml, toXml, toXml, writeXml, writeXmladdExceptionProperties, contributeExceptionProperties, contributeExceptionPropertiespublic void getDataMappingProblems(List<DataMappingProblem> problems, boolean includeChildren)
getDataMappingProblems in interface DataMappingProblemsSupplierpublic String getName()
public DataMapping setName(String name)
public String getDescription()
public DataMapping setDescription(String description)
public boolean isAutoMapping()
FieldMappings (default false).public DataMapping setAutoMapping(boolean autoMapping)
FieldMappings (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 JavaCodeGeneratorpublic DataException addExceptionProperties(DataException exception)
FoundationObjectDataException. Since this method is called whenever an
exception is thrown, subclasses should override it to add their specific information.addExceptionProperties in interface DataExceptionContributoraddExceptionProperties in class FoundationObjectpublic DataMapping getDataMapping()
getDataMapping in class DataMappingPartpublic DataMappingPart getDataMappingPartContainer()
getDataMappingPartContainer in class DataMappingPartpublic DataMappingPartType getDataMappingPartType()
getDataMappingPartType in class DataMappingPartpublic String getDataMappingPartName()
getDataMappingPartName in class DataMappingPartpublic Record toRecord()
toRecord in interface RecordSerializabletoRecord in class Beanpublic DataMapping fromRecord(Record source)
RecordSerializablethis (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 RecordSerializablefromRecord in class Beanpublic String toJson()
toJson in interface JsonSerializabletoJson in interface RecordSerializablepublic DataMapping toJson(Writer writer)
toJson in interface JsonSerializabletoJson in interface RecordSerializablepublic DataMapping toJson(Writer writer, boolean closeWriter)
toJson in interface JsonSerializabletoJson in interface RecordSerializablepublic DataMapping toXml(Writer writer)
toXml in interface XmlSerializablepublic DataMapping fromJson(String jsonString)
fromJson in interface JsonSerializablefromJson in interface RecordSerializablepublic DataMapping fromJson(InputStream inputStream)
fromJson in interface JsonSerializablefromJson in interface RecordSerializablepublic DataMapping fromXml(InputStream inputStream)
fromXml in interface XmlSerializablepublic DataMapping fromXml(String xml)
fromXml in interface XmlSerializablepublic Element toXmlElement(Document document)
toXmlElement in interface XmlSerializablepublic DataMapping fromXmlElement(Element dataMappingElement)
fromXmlElement in interface XmlSerializableCopyright (c) 2006-2025 North Concepts Inc. All Rights Reserved.