Interface PathMapper
-
- All Known Subinterfaces:
NamePathMapper
- All Known Implementing Classes:
NamePathMapper.Default,NamePathMapperImpl
@ProviderType public interface PathMapperPathMapperinstances provide methods for mapping paths from their JCR string representation to their Oak representation and vice versa. The Oak representation of a path consists of an optional forward slash followed by the names of the respective items in theTreeseparated by forward slashes.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description @NotNull java.lang.StringgetExpandedJcrPath(@NotNull java.lang.String oakPath)Returns the JCR path in expanded form for the given Oak path.@NotNull java.lang.StringgetJcrPath(java.lang.String oakPath)Returns the JCR path for the given Oak path.@Nullable java.lang.StringgetOakPath(java.lang.String jcrPath)Returns the Oak path for the given JCR path, ornullif no such mapping exists because the given JCR path contains a name element with an unknown namespace URI or prefix, or is otherwise invalid.
-
-
-
Method Detail
-
getOakPath
@Nullable @Nullable java.lang.String getOakPath(java.lang.String jcrPath)
Returns the Oak path for the given JCR path, ornullif no such mapping exists because the given JCR path contains a name element with an unknown namespace URI or prefix, or is otherwise invalid.- Parameters:
jcrPath- JCR path- Returns:
- Oak path, or
null
-
getJcrPath
@NotNull @NotNull java.lang.String getJcrPath(java.lang.String oakPath)
Returns the JCR path for the given Oak path. The given path is expected to have come from a valid Oak repository that contains only valid paths whose name elements only use 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.- Parameters:
oakPath- Oak path- Returns:
- JCR path
-
getExpandedJcrPath
@NotNull @NotNull java.lang.String getExpandedJcrPath(@NotNull @NotNull java.lang.String oakPath)Returns the JCR path in expanded form for the given Oak path. The given path 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.- Parameters:
oakPath- Oak path- Returns:
- JCR path in expanded form
- Throws:
java.lang.IllegalStateException- in case the namespace URI for the given Oak name cannot be resolved- Since:
- Oak 1.78.0
- See Also:
- JCR 2.0, 3.2.5.1 Expanded Form
-
-