Class EntityAliases

  • All Implemented Interfaces:
    Serializable, Cloneable, Map<String,​String>

    public class EntityAliases
    extends HashMap<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.

    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:
    Serialized Form
    • Constructor Detail

      • EntityAliases

        public EntityAliases()
        Creates empty aliases map.
      • EntityAliases

        public EntityAliases​(String str)
                      throws ModelException
        Creates the aliases from a string.
        Parameters:
        str - the string
        Throws:
        ModelException - if parsing failed
    • Method Detail

      • parse

        public void parse​(String str)
                   throws ModelException
        Parses the aliases from a string.
        Parameters:
        str - the string
        Throws:
        ModelException - if parsing failed
      • translate

        public String translate​(String name)
        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