Search in sources :

Example 1 with Camelize

use of io.atlasmap.v2.Camelize in project atlasmap by atlasmap.

the class DefaultAtlasFieldActionService method detectFieldActionParameters.

protected Properties detectFieldActionParameters(String actionClassName) throws ClassNotFoundException {
    Class<?> actionClazz = Class.forName(actionClassName);
    Properties props = null;
    for (Method method : actionClazz.getMethods()) {
        // Find setters to avoid the get / is confusion
        if (method.getParameterCount() == 1 && method.getName().startsWith("set")) {
            // We have a parameter
            if (props == null) {
                props = new Properties();
            }
            Property prop = null;
            for (Parameter param : method.getParameters()) {
                prop = new Property();
                prop.setName(camelize(method.getName().substring("set".length())));
                prop.setFieldType(getConversionService().fieldTypeFromClass(param.getType()));
                props.getProperty().add(prop);
            }
        }
    }
    return props;
}
Also used : Parameter(java.lang.reflect.Parameter) Method(java.lang.reflect.Method) Properties(io.atlasmap.v2.Properties) Property(io.atlasmap.v2.Property)

Example 2 with Camelize

use of io.atlasmap.v2.Camelize in project atlasmap by atlasmap.

the class BaseMarshallerTest method generateActions.

private Actions generateActions() {
    Actions actions = new Actions();
    actions.getActions().add(new Camelize());
    actions.getActions().add(new Capitalize());
    actions.getActions().add(new Length());
    actions.getActions().add(new Lowercase());
    actions.getActions().add(new SeparateByDash());
    actions.getActions().add(new SeparateByUnderscore());
    actions.getActions().add(new Trim());
    actions.getActions().add(new TrimLeft());
    actions.getActions().add(new TrimRight());
    actions.getActions().add(new Uppercase());
    return actions;
}
Also used : Camelize(io.atlasmap.v2.Camelize) TrimLeft(io.atlasmap.v2.TrimLeft) SeparateByUnderscore(io.atlasmap.v2.SeparateByUnderscore) Actions(io.atlasmap.v2.Actions) Length(io.atlasmap.v2.Length) Trim(io.atlasmap.v2.Trim) Lowercase(io.atlasmap.v2.Lowercase) Uppercase(io.atlasmap.v2.Uppercase) TrimRight(io.atlasmap.v2.TrimRight) Capitalize(io.atlasmap.v2.Capitalize) SeparateByDash(io.atlasmap.v2.SeparateByDash)

Example 3 with Camelize

use of io.atlasmap.v2.Camelize in project atlasmap by atlasmap.

the class BaseMarshallerTest method generateActions.

private Actions generateActions() {
    Actions actions = new Actions();
    actions.getActions().add(new Camelize());
    actions.getActions().add(new Capitalize());
    actions.getActions().add(new Length());
    actions.getActions().add(new Lowercase());
    actions.getActions().add(new SeparateByDash());
    actions.getActions().add(new SeparateByUnderscore());
    actions.getActions().add(new Trim());
    actions.getActions().add(new TrimLeft());
    actions.getActions().add(new TrimRight());
    actions.getActions().add(new Uppercase());
    return actions;
}
Also used : Camelize(io.atlasmap.v2.Camelize) TrimLeft(io.atlasmap.v2.TrimLeft) SeparateByUnderscore(io.atlasmap.v2.SeparateByUnderscore) Actions(io.atlasmap.v2.Actions) Length(io.atlasmap.v2.Length) Trim(io.atlasmap.v2.Trim) Lowercase(io.atlasmap.v2.Lowercase) Uppercase(io.atlasmap.v2.Uppercase) TrimRight(io.atlasmap.v2.TrimRight) Capitalize(io.atlasmap.v2.Capitalize) SeparateByDash(io.atlasmap.v2.SeparateByDash)

Example 4 with Camelize

use of io.atlasmap.v2.Camelize in project atlasmap by atlasmap.

the class BaseMarshallerTest method generateActions.

private void generateActions(JsonField inputField) {
    Actions actions = new Actions();
    actions.getActions().add(new Camelize());
    actions.getActions().add(new Capitalize());
    actions.getActions().add(new Length());
    actions.getActions().add(new Lowercase());
    actions.getActions().add(new SeparateByDash());
    actions.getActions().add(new SeparateByUnderscore());
    actions.getActions().add(new Trim());
    actions.getActions().add(new TrimLeft());
    actions.getActions().add(new TrimRight());
    actions.getActions().add(new Uppercase());
    inputField.setActions(actions);
}
Also used : Camelize(io.atlasmap.v2.Camelize) TrimLeft(io.atlasmap.v2.TrimLeft) SeparateByUnderscore(io.atlasmap.v2.SeparateByUnderscore) Actions(io.atlasmap.v2.Actions) Length(io.atlasmap.v2.Length) Trim(io.atlasmap.v2.Trim) Lowercase(io.atlasmap.v2.Lowercase) Uppercase(io.atlasmap.v2.Uppercase) TrimRight(io.atlasmap.v2.TrimRight) Capitalize(io.atlasmap.v2.Capitalize) SeparateByDash(io.atlasmap.v2.SeparateByDash)

Aggregations

Actions (io.atlasmap.v2.Actions)3 Camelize (io.atlasmap.v2.Camelize)3 Capitalize (io.atlasmap.v2.Capitalize)3 Length (io.atlasmap.v2.Length)3 Lowercase (io.atlasmap.v2.Lowercase)3 SeparateByDash (io.atlasmap.v2.SeparateByDash)3 SeparateByUnderscore (io.atlasmap.v2.SeparateByUnderscore)3 Trim (io.atlasmap.v2.Trim)3 TrimLeft (io.atlasmap.v2.TrimLeft)3 TrimRight (io.atlasmap.v2.TrimRight)3 Uppercase (io.atlasmap.v2.Uppercase)3 Properties (io.atlasmap.v2.Properties)1 Property (io.atlasmap.v2.Property)1 Method (java.lang.reflect.Method)1 Parameter (java.lang.reflect.Parameter)1