Search in sources :

Example 26 with JavaField

use of io.atlasmap.java.v2.JavaField in project atlasmap by atlasmap.

the class JavaJavaFieldActionsTest method createField.

protected Field createField(String path) {
    JavaField f = new JavaField();
    f.setPath(path);
    f.setFieldType(FieldType.STRING);
    return f;
}
Also used : JavaField(io.atlasmap.java.v2.JavaField)

Example 27 with JavaField

use of io.atlasmap.java.v2.JavaField in project atlasmap by atlasmap.

the class JavaJsonFlatMappingTest method generateJavaField.

protected JavaField generateJavaField(String path) {
    JavaField javaField = AtlasJavaModelFactory.createJavaField();
    javaField.setPath(path);
    javaField.setModifiers(null);
    return javaField;
}
Also used : JavaField(io.atlasmap.java.v2.JavaField)

Example 28 with JavaField

use of io.atlasmap.java.v2.JavaField in project atlasmap by atlasmap.

the class JsonJavaFlatMappingTest method generateJavaField.

protected JavaField generateJavaField(String path) {
    JavaField javaField = AtlasJavaModelFactory.createJavaField();
    javaField.setPath(path);
    javaField.setModifiers(null);
    return javaField;
}
Also used : JavaField(io.atlasmap.java.v2.JavaField)

Example 29 with JavaField

use of io.atlasmap.java.v2.JavaField in project atlasmap by atlasmap.

the class XmlJavaFlatMappingTest method generateJavaField.

protected JavaField generateJavaField(String path) {
    JavaField javaField = AtlasJavaModelFactory.createJavaField();
    javaField.setPath(path);
    javaField.setModifiers(null);
    return javaField;
}
Also used : JavaField(io.atlasmap.java.v2.JavaField)

Example 30 with JavaField

use of io.atlasmap.java.v2.JavaField in project atlasmap by atlasmap.

the class JavaModule method merge.

private void merge(JavaClass inspectionClass, List<BaseMapping> mappings) {
    if (inspectionClass == null || inspectionClass.getJavaFields() == null || inspectionClass.getJavaFields().getJavaField() == null) {
        return;
    }
    if (mappings == null || mappings.size() == 0) {
        return;
    }
    for (BaseMapping fm : mappings) {
        if (fm instanceof Mapping && (((Mapping) fm).getOutputField() != null)) {
            Field f = ((Mapping) fm).getOutputField().get(0);
            if (f.getPath() != null) {
                Field inspectField = findFieldByPath(inspectionClass, f.getPath());
                if (inspectField != null && f instanceof JavaField && inspectField instanceof JavaField) {
                    String overrideClassName = ((JavaField) f).getClassName();
                    JavaField javaInspectField = (JavaField) inspectField;
                    // Support mapping overrides className
                    if (overrideClassName != null && !overrideClassName.equals(javaInspectField.getClassName())) {
                        javaInspectField.setClassName(overrideClassName);
                    }
                }
            }
        }
    }
}
Also used : Field(io.atlasmap.v2.Field) JavaEnumField(io.atlasmap.java.v2.JavaEnumField) JavaField(io.atlasmap.java.v2.JavaField) JavaField(io.atlasmap.java.v2.JavaField) BaseMapping(io.atlasmap.v2.BaseMapping) Mapping(io.atlasmap.v2.Mapping) BaseMapping(io.atlasmap.v2.BaseMapping)

Aggregations

JavaField (io.atlasmap.java.v2.JavaField)53 Test (org.junit.Test)19 JavaClass (io.atlasmap.java.v2.JavaClass)16 Mapping (io.atlasmap.v2.Mapping)16 AtlasMapping (io.atlasmap.v2.AtlasMapping)15 Validation (io.atlasmap.v2.Validation)8 FieldType (io.atlasmap.v2.FieldType)7 Method (java.lang.reflect.Method)7 JavaEnumField (io.atlasmap.java.v2.JavaEnumField)6 AtlasException (io.atlasmap.api.AtlasException)5 DataSource (io.atlasmap.v2.DataSource)5 Field (io.atlasmap.v2.Field)5 AtlasModuleDetail (io.atlasmap.spi.AtlasModuleDetail)4 ValidationScope (io.atlasmap.v2.ValidationScope)4 ValidationStatus (io.atlasmap.v2.ValidationStatus)4 List (java.util.List)4 Logger (org.slf4j.Logger)4 AtlasConstants (io.atlasmap.api.AtlasConstants)3 AtlasMappingUtil (io.atlasmap.core.AtlasMappingUtil)3 AtlasPath (io.atlasmap.core.AtlasPath)3