Package dev.morphia.internal
Class PathTarget
- java.lang.Object
-
- dev.morphia.internal.PathTarget
-
public class PathTarget extends Object
- Since:
- 1.3
Developer note.This is an internal item. Its function and presence are subject to change without warning. Its use is highly discouraged.
-
-
Constructor Summary
Constructors Constructor Description PathTarget(Mapper mapper, EntityModel root, String path)
Creates a resolution context for the given root and path.PathTarget(Mapper mapper, EntityModel root, String path, boolean validateNames)
Creates a resolution context for the given root and path.PathTarget(Mapper mapper, Class<T> type, String path)
Creates a resolution context for the given root and path.PathTarget(Mapper mapper, Class<T> type, String path, boolean validateNames)
Creates a resolution context for the given root and path.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PropertyModel
getTarget()
Returns the PropertyModel found at the end of a path.Mapper
mapper()
EntityModel
root()
String
toString()
String
translatedPath()
Returns the translated path for this context.
-
-
-
Constructor Detail
-
PathTarget
public PathTarget(Mapper mapper, EntityModel root, String path)
Creates a resolution context for the given root and path.- Parameters:
mapper
- mapperroot
- rootpath
- path
-
PathTarget
public PathTarget(Mapper mapper, @Nullable EntityModel root, String path, boolean validateNames)
Creates a resolution context for the given root and path.- Parameters:
mapper
- mapperroot
- rootpath
- pathvalidateNames
- true if names should be validated
-
PathTarget
public PathTarget(Mapper mapper, @Nullable Class<T> type, String path)
Creates a resolution context for the given root and path.- Type Parameters:
T
- the root type- Parameters:
mapper
- mappertype
- the root typepath
- the path
-
PathTarget
public PathTarget(Mapper mapper, @Nullable Class<T> type, String path, boolean validateNames)
Creates a resolution context for the given root and path.- Type Parameters:
T
- the root type- Parameters:
mapper
- mappertype
- the root typepath
- the pathvalidateNames
- true if names should be validated
-
-
Method Detail
-
mapper
public Mapper mapper()
-
root
public EntityModel root()
-
translatedPath
public String translatedPath()
Returns the translated path for this context. If validation is disabled, that path could be the same as the initial value.- Returns:
- the translated path
-
getTarget
@Nullable public PropertyModel getTarget()
Returns the PropertyModel found at the end of a path. May be null if the path is invalid and validation is disabled.- Returns:
- the field
-
-