Search in sources :

Example 1 with AtlasPropertyStrategy

use of io.atlasmap.spi.AtlasPropertyStrategy in project atlasmap by atlasmap.

the class PropertyModule method writeTargetValue.

@Override
public void writeTargetValue(AtlasInternalSession session) throws AtlasException {
    AtlasPropertyStrategy strategy = session.getAtlasPropertyStrategy() != null ? session.getAtlasPropertyStrategy() : this.defaultStrategy;
    Field targetField = session.head().getTargetField();
    if (targetField instanceof PropertyField) {
        PropertyField targetPropertyField = (PropertyField) targetField;
        strategy.writeProperty(session, targetPropertyField);
        if (LOG.isDebugEnabled()) {
            LOG.debug("Processed target PropertyField: Name={} Value={} Strategy={}", targetPropertyField.getName(), targetPropertyField.getValue(), strategy.getClass().getName());
        }
    }
}
Also used : PropertyField(io.atlasmap.v2.PropertyField) Field(io.atlasmap.v2.Field) AtlasPropertyStrategy(io.atlasmap.spi.AtlasPropertyStrategy) PropertyField(io.atlasmap.v2.PropertyField)

Example 2 with AtlasPropertyStrategy

use of io.atlasmap.spi.AtlasPropertyStrategy in project atlasmap by atlasmap.

the class PropertyModule method readSourceValue.

@Override
public void readSourceValue(AtlasInternalSession session) throws AtlasException {
    AtlasPropertyStrategy strategy = session.getAtlasPropertyStrategy() != null ? session.getAtlasPropertyStrategy() : this.defaultStrategy;
    Field sourceField = session.head().getSourceField();
    if (sourceField instanceof PropertyField) {
        PropertyField sourcePropertyField = (PropertyField) sourceField;
        strategy.readProperty(session, sourcePropertyField);
        if (LOG.isDebugEnabled()) {
            LOG.debug("Processed source PropertyField: Name={} Scope={} Value={} Strategy={}", sourcePropertyField.getName(), sourcePropertyField.getScope(), sourceField.getValue(), strategy.getClass().getName());
        }
    }
}
Also used : PropertyField(io.atlasmap.v2.PropertyField) Field(io.atlasmap.v2.Field) AtlasPropertyStrategy(io.atlasmap.spi.AtlasPropertyStrategy) PropertyField(io.atlasmap.v2.PropertyField)

Aggregations

AtlasPropertyStrategy (io.atlasmap.spi.AtlasPropertyStrategy)2 Field (io.atlasmap.v2.Field)2 PropertyField (io.atlasmap.v2.PropertyField)2