Class PojoModelPath
- java.lang.Object
-
- org.hibernate.search.mapper.pojo.model.path.PojoModelPath
-
- Direct Known Subclasses:
PojoModelPathPropertyNode,PojoModelPathValueNode
public abstract class PojoModelPath extends Object
Represents an arbitrarily long access path when walking the POJO model.For instance the path could be:
property "propertyOfA" => extractor "MapValueExtractor" => property "propertyOfB"Meaning: extract property "propertyOfA", then extract values using "MapValueExtractor", then for each value extract property "propertyOfB".
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPojoModelPath.Builder
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static PojoModelPath.Builderbuilder()static PojoModelPathPropertyNodeofProperty(String propertyName)static PojoModelPathValueNodeofValue(String propertyName)static PojoModelPathValueNodeofValue(String propertyName, ContainerExtractorPath extractorPath)abstract PojoModelPathparent()static PojoModelPathValueNodeparse(String dotSeparatedPath)StringtoPathString()StringtoString()
-
-
-
Method Detail
-
builder
public static PojoModelPath.Builder builder()
- Returns:
- A builder allowing to create a
PojoModelPathby specifying its components (property, container extractors) one by one.
-
ofProperty
public static PojoModelPathPropertyNode ofProperty(String propertyName)
- Parameters:
propertyName- The name of a POJO property.- Returns:
- A path from a POJO to the property with the given name.
-
ofValue
public static PojoModelPathValueNode ofValue(String propertyName)
- Parameters:
propertyName- The name of a POJO property.- Returns:
- A
PojoModelPathfrom a POJO to the value(s) of the property with the given name. Default container extractors are applied to the property, so that for example a path to a List property will in fact point to the elements of that list.
-
ofValue
public static PojoModelPathValueNode ofValue(String propertyName, ContainerExtractorPath extractorPath)
- Parameters:
propertyName- The name of a POJO property.extractorPath- A container extractor path.- Returns:
- A
PojoModelPathfrom a POJO to the value(s) of the property with the given name. The extractors represented by the given extractor path are applied to the property, so that for example a path to a List property may in fact point to the elements of that list.
-
parse
public static PojoModelPathValueNode parse(String dotSeparatedPath)
- Parameters:
dotSeparatedPath- A dot-separated path, such as"myProperty.someNestedProperty".- Returns:
- A
PojoModelPathrepresenting the same path, which the default container extractors applied to each property, so that for example a path to a List property will in fact point to the elements of that list.
-
toPathString
public final String toPathString()
- Returns:
- A representation of this path in the form
propertyA<containerExtractorPathA>.propertyB<containerExtractorPathB>.propertyC<containerExtractorPathB>.
-
parent
public abstract PojoModelPath parent()
- Returns:
- The model path to the element from which the value represented by this node is extracted.
May be
null.
-
-