Class LocalNameMapper

  • All Implemented Interfaces:
    NameMapper

    public class LocalNameMapper
    extends GlobalNameMapper
    Name mapper with local namespace mappings.
    • Constructor Summary

      Constructors 
      Constructor Description
      LocalNameMapper​(java.util.Map<java.lang.String,​java.lang.String> global, java.util.Map<java.lang.String,​java.lang.String> local)  
      LocalNameMapper​(Root root, java.util.Map<java.lang.String,​java.lang.String> local)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      @NotNull java.lang.String getJcrName​(@NotNull java.lang.String oakName)
      Returns the JCR name for the given Oak name.
      @Nullable java.lang.String getOakNameOrNull​(@NotNull java.lang.String jcrName)
      Returns the Oak name for the given JCR name, or null if no such mapping exists because the given JCR name contains an unknown namespace URI or prefix, or is otherwise invalid.
      @NotNull java.util.Map<java.lang.String,​java.lang.String> getSessionLocalMappings()
      Returns the local namespace prefix mappings, or an empty map if there aren't any local mappings.
      • Methods inherited from class java.lang.Object

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

      • LocalNameMapper

        public LocalNameMapper​(Root root,
                               java.util.Map<java.lang.String,​java.lang.String> local)
      • LocalNameMapper

        public LocalNameMapper​(java.util.Map<java.lang.String,​java.lang.String> global,
                               java.util.Map<java.lang.String,​java.lang.String> local)
    • Method Detail

      • getSessionLocalMappings

        @NotNull
        public @NotNull java.util.Map<java.lang.String,​java.lang.String> getSessionLocalMappings()
        Description copied from interface: NameMapper
        Returns the local namespace prefix mappings, or an empty map if there aren't any local mappings.
        Specified by:
        getSessionLocalMappings in interface NameMapper
        Overrides:
        getSessionLocalMappings in class GlobalNameMapper
        Returns:
        local namespace prefix to URI mappings
      • getJcrName

        @NotNull
        public @NotNull java.lang.String getJcrName​(@NotNull
                                                    @NotNull java.lang.String oakName)
        Description copied from interface: NameMapper
        Returns the JCR name for the given Oak name. The given name is expected to have come from a valid Oak repository that contains only valid names with proper namespace mappings. If that's not the case, either a programming error or a repository corruption has occurred and an appropriate unchecked exception gets thrown.
        Specified by:
        getJcrName in interface NameMapper
        Overrides:
        getJcrName in class GlobalNameMapper
        Parameters:
        oakName - Oak name
        Returns:
        JCR name
      • getOakNameOrNull

        @Nullable
        public @Nullable java.lang.String getOakNameOrNull​(@NotNull
                                                           @NotNull java.lang.String jcrName)
        Description copied from interface: NameMapper
        Returns the Oak name for the given JCR name, or null if no such mapping exists because the given JCR name contains an unknown namespace URI or prefix, or is otherwise invalid.
        Specified by:
        getOakNameOrNull in interface NameMapper
        Overrides:
        getOakNameOrNull in class GlobalNameMapper
        Parameters:
        jcrName - JCR name
        Returns:
        Oak name, or null