Class XAttributeNameMapImpl

  • All Implemented Interfaces:
    XAttributeNameMap

    public class XAttributeNameMapImpl
    extends java.lang.Object
    implements XAttributeNameMap
    Implements an attribute name mapping.
    Author:
    Christian W. Guenther (christian@deckfour.org)
    • Constructor Summary

      Constructors 
      Constructor Description
      XAttributeNameMapImpl​(java.lang.String name)
      Creates a new attribute name mapping instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getMappingName()
      Returns the name of this mapping.
      java.lang.String map​(java.lang.String attributeKey)
      Returns the name mapped onto the provided attribute key by this mapping.
      java.lang.String map​(XAttribute attribute)
      Returns the name mapped onto the provided attribute by this mapping.
      void registerMapping​(java.lang.String attributeKey, java.lang.String alias)
      Registers a mapping for a given attribute key.
      void registerMapping​(XAttribute attribute, java.lang.String alias)
      Registers a mapping for a given attribute.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • XAttributeNameMapImpl

        public XAttributeNameMapImpl​(java.lang.String name)
        Creates a new attribute name mapping instance.
        Parameters:
        name - Name of the mapping.
    • Method Detail

      • getMappingName

        public java.lang.String getMappingName()
        Description copied from interface: XAttributeNameMap
        Returns the name of this mapping.
        Specified by:
        getMappingName in interface XAttributeNameMap
        Returns:
        The name of this mapping.
      • map

        public java.lang.String map​(XAttribute attribute)
        Description copied from interface: XAttributeNameMap
        Returns the name mapped onto the provided attribute by this mapping. If no mapping for the given attribute is provided by this map, null is returned.
        Specified by:
        map in interface XAttributeNameMap
        Parameters:
        attribute - Attribute to retrieve mapping for.
        Returns:
        The mapping for the given attribute, or null, if no such mapping exists.
      • map

        public java.lang.String map​(java.lang.String attributeKey)
        Description copied from interface: XAttributeNameMap
        Returns the name mapped onto the provided attribute key by this mapping. If no mapping for the given attribute key is provided by this map, null is returned.
        Specified by:
        map in interface XAttributeNameMap
        Parameters:
        attributeKey - Attribute key to retrieve mapping for.
        Returns:
        The mapping for the given attribute key, or null, if no such mapping exists.
      • registerMapping

        public void registerMapping​(XAttribute attribute,
                                    java.lang.String alias)
        Registers a mapping for a given attribute.
        Parameters:
        attribute - Attribute for which to register a mapping.
        alias - Alias string to map the attribute to.
      • registerMapping

        public void registerMapping​(java.lang.String attributeKey,
                                    java.lang.String alias)
        Registers a mapping for a given attribute key.
        Parameters:
        attributeKey - Attribute key for which to register a mapping.
        alias - Alias string to map the attribute key to.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object