/** * @param mapping * @param target * @return The supplied mapping if it remains incomplete, else a new mapping mapped via the * delegate */ public MappingOperation<?, ?> setTarget( final MappingOperation<?, ?> mapping, final Model target) { if (mapping.getType() == null) { ((MappingPlaceholder) mapping).setTarget(target); } return update(mapping, mapping.getSource(), target, MAPPING_TARGET); }
/** * @param mapping * @param source * @return The supplied mapping if it remains incomplete, else a new mapping mapped via the * delegate */ public MappingOperation<?, ?> setSource( final MappingOperation<?, ?> mapping, final Object source) { if (mapping.getType() == null) { ((MappingPlaceholder) mapping).setSource(source); } return update(mapping, source, (Model) mapping.getTarget(), MAPPING_SOURCE); }
/** * @param mapping * @param language * @param expression * @return The supplied mapping if it remains incomplete, else a new mapping mapped via the * delegate */ public MappingOperation<?, ?> setSourceExpression( final MappingOperation<?, ?> mapping, final String language, final String expression) { if (mapping.getType() == null) { ((MappingPlaceholder) mapping).setSource(new ExpressionPlaceholder(language, expression)); } else { delegate.removeMapping(mapping); } return update(mapping, language, expression, (Model) mapping.getTarget(), MAPPING_SOURCE); }