Class NamePathMapperImpl
java.lang.Object
org.apache.jackrabbit.oak.namepath.impl.NamePathMapperImpl
- All Implemented Interfaces:
NameMapper
,NamePathMapper
,PathMapper
TODO document
-
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
ConstructorsConstructorDescriptionNamePathMapperImpl
(NameMapper nameMapper) NamePathMapperImpl
(NameMapper nameMapper, IdentifierManager idManager) -
Method Summary
Modifier and TypeMethodDescription@NotNull String
getExpandedJcrName
(@NotNull String oakName) Returns the JCR name in expanded form for the given Oak name.@NotNull String
getExpandedJcrPath
(@NotNull String oakPath) Returns the JCR path in expanded form for the given Oak path.@NotNull String
getJcrName
(@NotNull String oakName) Returns the JCR name in qualified form for the given Oak name.@NotNull String
getJcrPath
(String oakPath) Returns the JCR path for the given Oak path.getJcrPath
(String oakPath, UnaryOperator<String> mapFunction, BooleanSupplier shouldSkipMappingFunction) @NotNull String
getOakName
(@NotNull String jcrName) Returns the Oak name for the specified JCR name.getOakNameOrNull
(@NotNull String jcrName) Returns the Oak name for the given JCR name, ornull
if no such mapping exists because the given JCR name contains an unknown namespace URI or prefix, or is otherwise invalid.getOakPath
(String jcrPath) Returns the Oak path for the given JCR path, ornull
if no such mapping exists because the given JCR path contains a name element with an unknown namespace URI or prefix, or is otherwise invalid.Returns the local namespace prefix mappings, or an empty map if there aren't any local mappings.
-
Constructor Details
-
NamePathMapperImpl
-
NamePathMapperImpl
-
-
Method Details
-
getOakNameOrNull
Description copied from interface:NameMapper
Returns the Oak name for the given JCR name, ornull
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 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:NameMapper
Returns the Oak name for the specified JCR name. In contrast toNameMapper.getOakNameOrNull(String)
this method will throw aRepositoryException
if the JCR name is invalid and cannot be resolved.- Specified by:
getOakName
in interfaceNameMapper
- Parameters:
jcrName
- The JCR name to be converted.- Returns:
- A valid Oak name.
- Throws:
RepositoryException
- If the JCR name cannot be resolved.
-
getJcrName
Description copied from interface:NameMapper
Returns 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:
getJcrName
in interfaceNameMapper
- Parameters:
oakName
- Oak name- Returns:
- JCR name in qualified form
- See Also:
-
getExpandedJcrName
Description copied from interface:NameMapper
Returns 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:
getExpandedJcrName
in interfaceNameMapper
- Parameters:
oakName
- Oak name- Returns:
- JCR name in expanded form
- See Also:
-
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 interfaceNameMapper
- Returns:
- local namespace prefix to URI mappings
-
getOakPath
Description copied from interface:PathMapper
Returns the Oak path for the given JCR path, ornull
if 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:
getOakPath
in interfacePathMapper
- Parameters:
jcrPath
- JCR path- Returns:
- Oak path, or
null
-
getJcrPath
Description copied from interface:PathMapper
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.- Specified by:
getJcrPath
in interfacePathMapper
- Parameters:
oakPath
- Oak path- Returns:
- JCR path
-
getExpandedJcrPath
Description copied from interface:PathMapper
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.- Specified by:
getExpandedJcrPath
in interfacePathMapper
- Parameters:
oakPath
- Oak path- Returns:
- JCR path in expanded form
- See Also:
-
getJcrPath
public String getJcrPath(String oakPath, UnaryOperator<String> mapFunction, BooleanSupplier shouldSkipMappingFunction)
-