Class NamePathMapper.Default
- java.lang.Object
-
- org.apache.jackrabbit.oak.namepath.NamePathMapper.Default
-
- All Implemented Interfaces:
NameMapper,NamePathMapper,PathMapper
- Enclosing interface:
- NamePathMapper
public static class NamePathMapper.Default extends Object implements NamePathMapper
Default implementation that doesn't perform any conversions for cases where a mapper object only deals with oak internal names and paths.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.jackrabbit.oak.namepath.NamePathMapper
NamePathMapper.Default
-
-
Field Summary
-
Fields inherited from interface org.apache.jackrabbit.oak.namepath.NamePathMapper
DEFAULT
-
-
Constructor Summary
Constructors Constructor Description Default()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull StringgetExpandedJcrName(@NotNull String oakName)Returns the JCR name in expanded form for the given Oak name.@NotNull StringgetExpandedJcrPath(@NotNull String oakPath)Returns the JCR path in expanded form for the given Oak path.@NotNull StringgetJcrName(@NotNull String oakName)Returns the JCR name in qualified form for the given Oak name.@NotNull StringgetJcrPath(String oakPath)Returns the JCR path for the given Oak path.@NotNull StringgetOakName(@NotNull String jcrName)Returns the Oak name for the specified JCR name.StringgetOakNameOrNull(@NotNull String jcrName)Returns the Oak name for the given JCR name, ornullif no such mapping exists because the given JCR name contains an unknown namespace URI or prefix, or is otherwise invalid.StringgetOakPath(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.@NotNull Map<String,String>getSessionLocalMappings()Returns the local namespace prefix mappings, or an empty map if there aren't any local mappings.
-
-
-
Method Detail
-
getOakNameOrNull
public String getOakNameOrNull(@NotNull @NotNull String jcrName)
Description copied from interface:NameMapperReturns the Oak name for the given JCR name, ornullif no such mapping exists because the given JCR name contains an unknown namespace URI or prefix, or is otherwise invalid.- Specified by:
getOakNameOrNullin interfaceNameMapper- Parameters:
jcrName- JCR name- Returns:
- Oak name, or
null
-
getOakName
@NotNull public @NotNull String getOakName(@NotNull @NotNull String jcrName) throws RepositoryException
Description copied from interface:NameMapperReturns the Oak name for the specified JCR name. In contrast toNameMapper.getOakNameOrNull(String)this method will throw aRepositoryExceptionif the JCR name is invalid and cannot be resolved.- Specified by:
getOakNamein interfaceNameMapper- Parameters:
jcrName- The JCR name to be converted.- Returns:
- A valid Oak name.
- Throws:
RepositoryException- If the JCR name cannot be resolved.
-
getSessionLocalMappings
@NotNull public @NotNull Map<String,String> getSessionLocalMappings()
Description copied from interface:NameMapperReturns the local namespace prefix mappings, or an empty map if there aren't any local mappings.- Specified by:
getSessionLocalMappingsin interfaceNameMapper- Returns:
- local namespace prefix to URI mappings
-
getJcrName
@NotNull public @NotNull String getJcrName(@NotNull @NotNull String oakName)
Description copied from interface:NameMapperReturns the JCR name in qualified form 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:
getJcrNamein interfaceNameMapper- Parameters:
oakName- Oak name- Returns:
- JCR name in qualified form
- See Also:
- JCR 2.0, 3.2.5.2 Qualifed Form
-
getExpandedJcrName
@NotNull public @NotNull String getExpandedJcrName(@NotNull @NotNull String oakName)
Description copied from interface:NameMapperReturns the JCR name in expanded form 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:
getExpandedJcrNamein interfaceNameMapper- Parameters:
oakName- Oak name- Returns:
- JCR name in expanded form
- See Also:
- JCR 2.0, 3.2.5.1 Expanded Form
-
getOakPath
public String getOakPath(String jcrPath)
Description copied from interface:PathMapperReturns 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.- Specified by:
getOakPathin interfacePathMapper- Parameters:
jcrPath- JCR path- Returns:
- Oak path, or
null
-
getJcrPath
@NotNull public @NotNull String getJcrPath(String oakPath)
Description copied from interface:PathMapperReturns 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.- Specified by:
getJcrPathin interfacePathMapper- Parameters:
oakPath- Oak path- Returns:
- JCR path
-
getExpandedJcrPath
@NotNull public @NotNull String getExpandedJcrPath(@NotNull @NotNull String oakPath)
Description copied from interface:PathMapperReturns 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.- Specified by:
getExpandedJcrPathin interfacePathMapper- Parameters:
oakPath- Oak path- Returns:
- JCR path in expanded form
- See Also:
- JCR 2.0, 3.2.5.1 Expanded Form
-
-