org.apache.stanbol.entityhub.servicesapi.mapping
Interface FieldMapper

All Superinterfaces:
Cloneable

public interface FieldMapper
extends Cloneable


Method Summary
 void addMapping(FieldMapping mapping)
          Adds a FieldMapping.
 Representation applyMappings(Representation source, Representation target, ValueFactory valueFactory)
          Uses the state of the source representation and the configured mappings to update the state of the target Representation.
 FieldMapper clone()
          Creates a clone of this FieldMapper instance with shallow copies of the FieldMapping instances
 Collection<FieldMapping> getMappings()
          Getter for the unmodifiable collection of all mappings
 void removeFieldMapping(FieldMapping mapping)
          Removes a FieldMapping.
 

Method Detail

addMapping

void addMapping(FieldMapping mapping)
Adds a FieldMapping.


removeFieldMapping

void removeFieldMapping(FieldMapping mapping)
Removes a FieldMapping.

Parameters:
mapping - the Mapping to remove

applyMappings

Representation applyMappings(Representation source,
                             Representation target,
                             ValueFactory valueFactory)
Uses the state of the source representation and the configured mappings to update the state of the target Representation. The state of the source Representation is not modified. Existing values in the target are not removed nor modified. If the same instance is parsed as source and target representation, fields created by the mapping process are NOT used as source fields for further mappings.

Parameters:
source - the source for the mapping process
target - the target for the processed mappings (can be the same as source)
valueFactory - The valueFactory used to create values while applying the mappings
Returns:
the Representation parsed as target. TODO: This Method should return a MappingReport, that can be stored with the EntityMapping. However the MappingActivity functionality is not yet designed/implemented!

getMappings

Collection<FieldMapping> getMappings()
Getter for the unmodifiable collection of all mappings

Returns:
the configured mappings

clone

FieldMapper clone()
Creates a clone of this FieldMapper instance with shallow copies of the FieldMapping instances

Returns:
the clone


Copyright © 2010-2013 The Apache Software Foundation. All Rights Reserved.