Package net.sf.saxon.expr
Class OperandRole
- java.lang.Object
-
- net.sf.saxon.expr.OperandRole
-
public class OperandRole extends java.lang.Object
Defines the role of a child expression relative to its parent expression. The properties of an operand role depend only on the kind of expression and not on the actual arguments supplied to a specific instance of the kind of operand.
-
-
Field Summary
Fields Modifier and Type Field Description static OperandRole
ABSORB
static OperandRole
ATOMIC_SEQUENCE
static int
CONSTRAINED_CLASS
static OperandRole
FLWOR_TUPLE_CONSTRAINED
static OperandRole
FOCUS_CONTROLLED_ACTION
static OperandRole
FOCUS_CONTROLLING_SELECT
static int
HAS_SPECIAL_FOCUS_RULES
static int
HIGHER_ORDER
static int
IN_CHOICE_GROUP
static OperandRole
INSPECT
static OperandRole
NAVIGATE
static OperandRole
NEW_FOCUS_ATOMIC
static OperandRole
PATTERN
static OperandRole
REPEAT_INSPECT
static OperandRole
REPEAT_NAVIGATE
static OperandRole
SAME_FOCUS_ACTION
static int
SETS_NEW_FOCUS
static OperandRole
SINGLE_ATOMIC
static int
SINGLETON
static int
USES_NEW_FOCUS
-
Constructor Summary
Constructors Constructor Description OperandRole(int properties, OperandUsage usage)
OperandRole(int properties, OperandUsage usage, SequenceType requiredType)
OperandRole(int properties, OperandUsage usage, SequenceType requiredType, java.util.function.Predicate<Expression> constraint)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.function.Predicate<Expression>
getConstraint()
Get any constraint on the expression that can be associated with this operand typeint
getProperties()
SequenceType
getRequiredType()
Get the required type of the operandstatic OperandUsage
getTypeDeterminedUsage(ItemType type)
Static method to get the type-determined usage for a particular ItemTypeOperandUsage
getUsage()
Get the usage of the operandboolean
hasSameFocus()
Ask whether the child expression is evaluated with the same focus as its parent expressionboolean
hasSpecialFocusRules()
boolean
isConstrainedClass()
Ask whether the operand is constrained to be of a particular class (preventing substitution of a variable binding)boolean
isEvaluatedRepeatedly()
Ask whether the operand is a evaluated repeatedly during a single evaluation of the parent expressionboolean
isHigherOrder()
Ask whether the operand is a higher-order operandboolean
isInChoiceGroup()
Ask whether the operand is a member of a choice groupOperandRole
modifyProperty(int property, boolean on)
void
setConstraint(java.util.function.Predicate<Expression> constraint)
Set a constraint on the expression that can be associated with this operand typeboolean
setsNewFocus()
Ask whether the child expression sets the focus for evaluation of other child expressionsOperandRole
withConstrainedClass()
Create an operand role based on this one, but with a constrained class propertyOperandRole
withConstraint(java.util.function.Predicate<Expression> constraint)
Create an operand role based on this one, but with a constraint
-
-
-
Field Detail
-
SETS_NEW_FOCUS
public static final int SETS_NEW_FOCUS
- See Also:
- Constant Field Values
-
USES_NEW_FOCUS
public static final int USES_NEW_FOCUS
- See Also:
- Constant Field Values
-
HIGHER_ORDER
public static final int HIGHER_ORDER
- See Also:
- Constant Field Values
-
IN_CHOICE_GROUP
public static final int IN_CHOICE_GROUP
- See Also:
- Constant Field Values
-
CONSTRAINED_CLASS
public static final int CONSTRAINED_CLASS
- See Also:
- Constant Field Values
-
SINGLETON
public static final int SINGLETON
- See Also:
- Constant Field Values
-
HAS_SPECIAL_FOCUS_RULES
public static final int HAS_SPECIAL_FOCUS_RULES
- See Also:
- Constant Field Values
-
SAME_FOCUS_ACTION
public static final OperandRole SAME_FOCUS_ACTION
-
FOCUS_CONTROLLING_SELECT
public static final OperandRole FOCUS_CONTROLLING_SELECT
-
FOCUS_CONTROLLED_ACTION
public static final OperandRole FOCUS_CONTROLLED_ACTION
-
INSPECT
public static final OperandRole INSPECT
-
ABSORB
public static final OperandRole ABSORB
-
REPEAT_INSPECT
public static final OperandRole REPEAT_INSPECT
-
NAVIGATE
public static final OperandRole NAVIGATE
-
REPEAT_NAVIGATE
public static final OperandRole REPEAT_NAVIGATE
-
FLWOR_TUPLE_CONSTRAINED
public static final OperandRole FLWOR_TUPLE_CONSTRAINED
-
SINGLE_ATOMIC
public static final OperandRole SINGLE_ATOMIC
-
ATOMIC_SEQUENCE
public static final OperandRole ATOMIC_SEQUENCE
-
NEW_FOCUS_ATOMIC
public static final OperandRole NEW_FOCUS_ATOMIC
-
PATTERN
public static final OperandRole PATTERN
-
-
Constructor Detail
-
OperandRole
public OperandRole(int properties, OperandUsage usage)
-
OperandRole
public OperandRole(int properties, OperandUsage usage, SequenceType requiredType)
-
OperandRole
public OperandRole(int properties, OperandUsage usage, SequenceType requiredType, java.util.function.Predicate<Expression> constraint)
-
-
Method Detail
-
withConstraint
public OperandRole withConstraint(java.util.function.Predicate<Expression> constraint)
Create an operand role based on this one, but with a constraint- Parameters:
constraint
- the constraint to be applied- Returns:
- the new operand role (the original is unchanged)
-
withConstrainedClass
public OperandRole withConstrainedClass()
Create an operand role based on this one, but with a constrained class property- Returns:
- the new operand role (the original is unchanged)
-
setsNewFocus
public boolean setsNewFocus()
Ask whether the child expression sets the focus for evaluation of other child expressions- Returns:
- true if the child expression is evaluated with the same focus as its parent expression
-
hasSameFocus
public boolean hasSameFocus()
Ask whether the child expression is evaluated with the same focus as its parent expression- Returns:
- true if the child expression is evaluated with the same focus as its parent expression
-
hasSpecialFocusRules
public boolean hasSpecialFocusRules()
-
isHigherOrder
public boolean isHigherOrder()
Ask whether the operand is a higher-order operand- Returns:
- true if the operand is higher-order
-
isEvaluatedRepeatedly
public boolean isEvaluatedRepeatedly()
Ask whether the operand is a evaluated repeatedly during a single evaluation of the parent expression- Returns:
- true if the operand is evaluated repeatedly
-
isConstrainedClass
public boolean isConstrainedClass()
Ask whether the operand is constrained to be of a particular class (preventing substitution of a variable binding)- Returns:
- true if the operand expression is constrained to be of a particular class
-
setConstraint
public void setConstraint(java.util.function.Predicate<Expression> constraint)
Set a constraint on the expression that can be associated with this operand type- Parameters:
constraint
- the constraint that must be satisfied by the relevant expression
-
getConstraint
public java.util.function.Predicate<Expression> getConstraint()
Get any constraint on the expression that can be associated with this operand type- Returns:
- any constraint that has been registered, or null
-
getUsage
public OperandUsage getUsage()
Get the usage of the operand- Returns:
- the usage
-
getRequiredType
public SequenceType getRequiredType()
Get the required type of the operand- Returns:
- the required type
-
isInChoiceGroup
public boolean isInChoiceGroup()
Ask whether the operand is a member of a choice group- Returns:
- true if the operand is in a choice group
-
getTypeDeterminedUsage
public static OperandUsage getTypeDeterminedUsage(ItemType type)
Static method to get the type-determined usage for a particular ItemType- Parameters:
type
- the required type- Returns:
- the type-determined operand usage
-
modifyProperty
public OperandRole modifyProperty(int property, boolean on)
-
getProperties
public int getProperties()
-
-