- All Implemented Interfaces:
Serializable,Cloneable,Map<String,String>
Holds aliases for entities.
Allows mapping of names used in relations or inheritance to map to entity names, for example, to simplify refactoring.
Allows mapping of names used in relations or inheritance to map to entity names, for example, to simplify refactoring.
Example:
<entityAliases>
Port = LogisticNode,
ManifestVoyage = Voyage
</entityAliases>
The alias goes to the left of the equal sign. It will be mapped to the right side.- Author:
- harald
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K, V> -
Constructor Summary
ConstructorsConstructorDescriptionCreates empty aliases map.EntityAliases(String str) Creates the aliases from a string. -
Method Summary
Methods inherited from class java.util.HashMap
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, newHashMap, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, valuesMethods inherited from class java.util.AbstractMap
equals, hashCode, toString
-
Constructor Details
-
EntityAliases
public EntityAliases()Creates empty aliases map. -
EntityAliases
Creates the aliases from a string.- Parameters:
str- the string- Throws:
ModelException- if parsing failed
-
-
Method Details
-
parse
Parses the aliases from a string.- Parameters:
str- the string- Throws:
ModelException- if parsing failed
-
translate
Maps the given name to an entity name.- Parameters:
name- the original name used in the model- Returns:
- the possibly mapped name if name was an alias
-