Package net.sf.saxon.expr
Class OperandRole
java.lang.Object
net.sf.saxon.expr.OperandRole
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
FieldsModifier and TypeFieldDescriptionstatic final OperandRole
static final OperandRole
static final OperandRole
static final int
static final OperandRole
static final OperandRole
static final OperandRole
static final OperandRole
static final int
static final int
static final int
static final OperandRole
static final OperandRole
static final OperandRole
static final OperandRole
static final OperandRole
static final OperandRole
static final OperandRole
static final int
static final OperandRole
static final int
static final int
-
Constructor Summary
ConstructorsConstructorDescriptionOperandRole
(int properties, OperandUsage usage) OperandRole
(int properties, OperandUsage usage, SequenceType requiredType) OperandRole
(int properties, OperandUsage usage, SequenceType requiredType, Predicate<Expression> constraint) -
Method Summary
Modifier and TypeMethodDescriptionGet any constraint on the expression that can be associated with this operand typeint
Get the required type of the operandstatic OperandUsage
Static method to get the type-determined usage for a particular ItemTypegetUsage()
Get the usage of the operandboolean
Ask whether the child expression is evaluated with the same focus as its parent expressionboolean
boolean
Ask whether the operand is constrained to be of a particular class (preventing substitution of a variable binding)boolean
Ask whether the operand is a evaluated repeatedly during a single evaluation of the parent expressionboolean
Ask whether the operand is a higher-order operandboolean
Ask whether the operand is a member of a choice groupmodifyProperty
(int property, boolean on) void
setConstraint
(Predicate<Expression> constraint) Set a constraint on the expression that can be associated with this operand typeboolean
Ask whether the child expression sets the focus for evaluation of other child expressionsCreate an operand role based on this one, but with a constrained class propertywithConstraint
(Predicate<Expression> constraint) Create an operand role based on this one, but with a constraint
-
Field Details
-
SETS_NEW_FOCUS
public static final int SETS_NEW_FOCUS- See Also:
-
USES_NEW_FOCUS
public static final int USES_NEW_FOCUS- See Also:
-
HIGHER_ORDER
public static final int HIGHER_ORDER- See Also:
-
IN_CHOICE_GROUP
public static final int IN_CHOICE_GROUP- See Also:
-
CONSTRAINED_CLASS
public static final int CONSTRAINED_CLASS- See Also:
-
SINGLETON
public static final int SINGLETON- See Also:
-
HAS_SPECIAL_FOCUS_RULES
public static final int HAS_SPECIAL_FOCUS_RULES- See Also:
-
SAME_FOCUS_ACTION
-
FOCUS_CONTROLLING_SELECT
-
FOCUS_CONTROLLED_ACTION
-
INSPECT
-
ABSORB
-
REPEAT_INSPECT
-
NAVIGATE
-
REPEAT_NAVIGATE
-
FLWOR_TUPLE_CONSTRAINED
-
SINGLE_ATOMIC
-
ATOMIC_SEQUENCE
-
CONSTRAINED_SINGLE_ATOMIC
-
CONSTRAINED_ATOMIC_SEQUENCE
-
NEW_FOCUS_ATOMIC
-
PATTERN
-
-
Constructor Details
-
OperandRole
-
OperandRole
-
OperandRole
public OperandRole(int properties, OperandUsage usage, SequenceType requiredType, Predicate<Expression> constraint)
-
-
Method Details
-
withConstraint
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
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
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
Get any constraint on the expression that can be associated with this operand type- Returns:
- any constraint that has been registered, or null
-
getUsage
Get the usage of the operand- Returns:
- the usage
-
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
Static method to get the type-determined usage for a particular ItemType- Parameters:
type
- the required type- Returns:
- the type-determined operand usage
-
modifyProperty
-
getProperties
public int getProperties()
-