com.univocity.api.engine
Interface NameMatcher


public interface NameMatcher

A NameMatcher provides a custom implementation for automatic detection of mappings based on entity names. By default, DataStoreMapping.autodetectMappings() and EntityMapping.autodetectMappings() will automatically create associations between entities and their fields based on their names. Entities with similar names will be automatically associated. Underscores and spaces are ignored, for example: entity1 will be associated with ENTITY 1 or ENTITY_1

To override this behavior and provide a custom auto detection mechanism, DataStoreMapping.autodetectMappings(NameMatcher, NameMatcher) and EntityMapping.autodetectMappings(NameMatcher) accept an implementation of NameMatcher.

Author:
uniVocity Software Pty Ltd - dev@univocity.com
See Also:
DataStoreMapping, EntityMapping

Method Summary
 boolean matches(String nameInSource, String nameInDestination)
          Identifies whether two entity or field names match and should be associated with each other automatically.
 

Method Detail

matches

boolean matches(String nameInSource,
                String nameInDestination)
Identifies whether two entity or field names match and should be associated with each other automatically.

Parameters:
nameInSource - the name in the source
nameInDestination - the name in the destination
Returns:
true if the entity of field name in source must be mapped to the entity or field name in the destination, otherwise false.


Copyright © 2015 uniVocity Software Pty Ltd. All rights reserved.