Package net.sf.saxon.expr
Class OperandRole
- java.lang.Object
-
- net.sf.saxon.expr.OperandRole
-
public class OperandRole extends java.lang.ObjectDefines 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 OperandRoleABSORBstatic OperandRoleATOMIC_SEQUENCEstatic intCONSTRAINED_CLASSstatic OperandRoleFLWOR_TUPLE_CONSTRAINEDstatic OperandRoleFOCUS_CONTROLLED_ACTIONstatic OperandRoleFOCUS_CONTROLLING_SELECTstatic intHAS_SPECIAL_FOCUS_RULESstatic intHIGHER_ORDERstatic intIN_CHOICE_GROUPstatic OperandRoleINSPECTstatic OperandRoleNAVIGATEstatic OperandRoleNEW_FOCUS_ATOMICstatic OperandRolePATTERNstatic OperandRoleREPEAT_INSPECTstatic OperandRoleREPEAT_NAVIGATEstatic OperandRoleSAME_FOCUS_ACTIONstatic intSETS_NEW_FOCUSstatic OperandRoleSINGLE_ATOMICstatic intSINGLETONstatic intUSES_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 typeintgetProperties()SequenceTypegetRequiredType()Get the required type of the operandstatic OperandUsagegetTypeDeterminedUsage(ItemType type)Static method to get the type-determined usage for a particular ItemTypeOperandUsagegetUsage()Get the usage of the operandbooleanhasSameFocus()Ask whether the child expression is evaluated with the same focus as its parent expressionbooleanhasSpecialFocusRules()booleanisConstrainedClass()Ask whether the operand is constrained to be of a particular class (preventing substitution of a variable binding)booleanisEvaluatedRepeatedly()Ask whether the operand is a evaluated repeatedly during a single evaluation of the parent expressionbooleanisHigherOrder()Ask whether the operand is a higher-order operandbooleanisInChoiceGroup()Ask whether the operand is a member of a choice groupOperandRolemodifyProperty(int property, boolean on)voidsetConstraint(java.util.function.Predicate<Expression> constraint)Set a constraint on the expression that can be associated with this operand typebooleansetsNewFocus()Ask whether the child expression sets the focus for evaluation of other child expressionsOperandRolewithConstrainedClass()Create an operand role based on this one, but with a constrained class propertyOperandRolewithConstraint(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()
-
-