Class PathMapper


  • public class PathMapper
    extends java.lang.Object
    A component that maps source data paths to target data paths.

    This class caches results and is thread-safe.

    Since:
    3.2
    Author:
    Derek Hulley
    • Constructor Summary

      Constructors 
      Constructor Description
      PathMapper()
      Default constructor
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addPathMap​(java.lang.String sourcePath, java.lang.String targetPath)
      Add a path mapping.
      void clear()  
      <V> java.util.Map<java.lang.String,​V> convertMap​(java.util.Map<java.lang.String,​V> valueMap)  
      java.util.Set<java.lang.String> getMappedPaths​(java.lang.String sourcePath)
      Gets the remapped paths for the given source path, excluding any derivative paths i.e.
      java.util.Set<java.lang.String> getMappedPathsWithPartialMatch​(java.lang.String sourcePath)
      Gets the remapped paths for the given source path, including any derivative paths i.e.
      boolean isEmpty()  
      void lock()
      Locks the instance against further modifications.
      • Methods inherited from class java.lang.Object

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

      • PathMapper

        public PathMapper()
        Default constructor
    • Method Detail

      • lock

        public void lock()
        Locks the instance against further modifications.
      • clear

        public void clear()
      • addPathMap

        public void addPathMap​(java.lang.String sourcePath,
                               java.lang.String targetPath)
        Add a path mapping.
        Parameters:
        sourcePath - the source path
        targetPath - the target path
      • getMappedPaths

        public java.util.Set<java.lang.String> getMappedPaths​(java.lang.String sourcePath)
        Gets the remapped paths for the given source path, excluding any derivative paths i.e. does exact path matching only.
        Parameters:
        sourcePath - the source path
        Returns:
        Returns the target paths (never null)
      • getMappedPathsWithPartialMatch

        public java.util.Set<java.lang.String> getMappedPathsWithPartialMatch​(java.lang.String sourcePath)
        Gets the remapped paths for the given source path, including any derivative paths i.e. does partial path matching.
        Parameters:
        sourcePath - the source path
        Returns:
        Returns the target paths (never null)
      • isEmpty

        public boolean isEmpty()
      • convertMap

        public <V> java.util.Map<java.lang.String,​V> convertMap​(java.util.Map<java.lang.String,​V> valueMap)