Class JoinConditionImpl
- java.lang.Object
-
- org.apache.jackrabbit.oak.query.ast.JoinConditionImpl
-
- Direct Known Subclasses:
ChildNodeJoinConditionImpl,DescendantNodeJoinConditionImpl,EquiJoinConditionImpl,SameNodeJoinConditionImpl
public abstract class JoinConditionImpl extends Object
The base class for join conditions.
-
-
Field Summary
Fields Modifier and Type Field Description protected static StringKNOWN_PARENT_PATHThe parent path of the joined selectorprotected static StringKNOWN_PATHA path for a join.protected static StringKNOWN_VALUEprotected QueryImplquerystatic StringSPECIAL_PATH_PREFIXThe prefix for known paths.
-
Constructor Summary
Constructors Constructor Description JoinConditionImpl()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract booleancanEvaluate(Set<SourceImpl> available)Whether the join condition can be evaluated if the given selectors are able to retrieve data.protected PropertyValueconvertValueToType(PropertyValue v, PropertyValue targetType)@NotNull org.apache.jackrabbit.oak.query.ast.AstElementcopyOf()abstract booleanevaluate()Evaluate the result using the currently set values.protected StringgetLocalPath(String path)Calculate the session local path (the path excluding the workspace name) if possible.abstract booleanisParent(SourceImpl source)Check whether the given source is the parent of the join condition, as selector "[b]" is the parent of the join condition "isdescendantnode([a], [b])".protected StringnormalizePath(String path)Validate and normalize the path.protected StringnormalizePropertyName(String propertyName)Normalize the property name (including namespace remapping).protected Stringprotect(Object expression)protected static Stringquote(String pathOrName)protected static StringquoteJson(String string)abstract voidrestrict(FilterImpl f)Apply the condition to the filter, further restricting the filter if possible.abstract voidrestrictPushDown(SelectorImpl s)Push as much of the condition down to this selector, further restricting the selector condition if possible.voidsetQuery(QueryImpl query)
-
-
-
Field Detail
-
SPECIAL_PATH_PREFIX
public static final String SPECIAL_PATH_PREFIX
The prefix for known paths.- See Also:
- Constant Field Values
-
KNOWN_PATH
protected static final String KNOWN_PATH
A path for a join.- See Also:
- Constant Field Values
-
KNOWN_PARENT_PATH
protected static final String KNOWN_PARENT_PATH
The parent path of the joined selector- See Also:
- Constant Field Values
-
KNOWN_VALUE
protected static final String KNOWN_VALUE
- See Also:
- Constant Field Values
-
query
protected QueryImpl query
-
-
Method Detail
-
evaluate
public abstract boolean evaluate()
Evaluate the result using the currently set values.- Returns:
- true if the constraint matches
-
restrict
public abstract void restrict(FilterImpl f)
Apply the condition to the filter, further restricting the filter if possible. This may also verify the data types are compatible, and that paths are valid.- Parameters:
f- the filter
-
restrictPushDown
public abstract void restrictPushDown(SelectorImpl s)
Push as much of the condition down to this selector, further restricting the selector condition if possible.- Parameters:
s- the selector
-
isParent
public abstract boolean isParent(SourceImpl source)
Check whether the given source is the parent of the join condition, as selector "[b]" is the parent of the join condition "isdescendantnode([a], [b])".- Parameters:
source- the source- Returns:
- true if the source is the parent
-
canEvaluate
public abstract boolean canEvaluate(Set<SourceImpl> available)
Whether the join condition can be evaluated if the given selectors are able to retrieve data.- Parameters:
available- the available selectors- Returns:
- true if the condition can be evaluated
-
setQuery
public void setQuery(QueryImpl query)
-
normalizePropertyName
protected String normalizePropertyName(String propertyName)
Normalize the property name (including namespace remapping). Asterisks are kept.- Parameters:
propertyName- the property name to normalize- Returns:
- the normalized (oak-) property name
-
normalizePath
protected String normalizePath(String path)
Validate and normalize the path.- Parameters:
path- the path to validate- Returns:
- the validated and normalized path
-
convertValueToType
protected PropertyValue convertValueToType(PropertyValue v, PropertyValue targetType)
-
getLocalPath
protected String getLocalPath(String path)
Calculate the session local path (the path excluding the workspace name) if possible.- Parameters:
path- the absolute path- Returns:
- the session local path, or null if not within this workspace
-
copyOf
@NotNull public @NotNull org.apache.jackrabbit.oak.query.ast.AstElement copyOf()
- Returns:
- a clone of self. Default implementation in
AstElementreturns same reference tothis.
-
-