/** * Get the static type of the variable. This is the declared type, unless the value * is statically known and constant, in which case it is the actual type of the value. */ public SequenceType getRequiredType() { return sourceBinding.getInferredType(true); }
/** * Get the static type of the variable. This is the declared type, unless the value * is statically known and constant, in which case it is the actual type of the value. * @return the declared or inferred static type of the variable */ public SequenceType getRequiredType() { return sourceBinding.getInferredType(true); }
/** * Get the static type of the variable. This is the declared type, unless the value * is statically known and constant, in which case it is the actual type of the value. */ public SequenceType getRequiredType() { return sourceBinding.getInferredType(true); }
/** * Get the static type of the variable. This is the declared type, unless the value * is statically known and constant, in which case it is the actual type of the value. * @return the declared or inferred static type of the variable */ public SequenceType getRequiredType() { return sourceBinding.getInferredType(true); }
public WithParam compileWithParam(Expression parent, Compilation exec, ComponentDeclaration decl) throws XPathException { sourceBinding.handleSequenceConstructor(exec, decl); WithParam inst = new WithParam(); inst.setSelectExpression(parent, sourceBinding.getSelectExpression()); inst.setVariableQName(sourceBinding.getVariableQName()); inst.setRequiredType(sourceBinding.getInferredType(true)); return inst; }
public WithParam compileWithParam(Expression parent, Compilation exec, ComponentDeclaration decl) throws XPathException { sourceBinding.handleSequenceConstructor(exec, decl); WithParam inst = new WithParam(); inst.setSelectExpression(parent, sourceBinding.getSelectExpression()); inst.setVariableQName(sourceBinding.getVariableQName()); inst.setRequiredType(sourceBinding.getInferredType(true)); return inst; }
public GroundedValue<?> getConstantValue() { if (constantValue == null) { final SequenceType type = getInferredType(true); final TypeHierarchy th = sourceElement.getConfiguration().getTypeHierarchy(); if (!hasProperty(ASSIGNABLE) && !hasProperty(PARAM) && !(visibility == Visibility.PUBLIC || visibility == Visibility.ABSTRACT)) { if (select instanceof Literal) { // we can't rely on the constant value because it hasn't yet been type-checked, // which could change it (eg by numeric promotion). Rather than attempt all the type-checking // now, we do a quick check. See test bug64 int relation = th.relationship(select.getItemType(), type.getPrimaryType()); if (relation == TypeHierarchy.SAME_TYPE || relation == TypeHierarchy.SUBSUMED_BY) { constantValue = ((Literal) select).getValue(); } } } } return constantValue; }
public GroundedValue<?> getConstantValue() { if (constantValue == null) { final SequenceType type = getInferredType(true); final TypeHierarchy th = sourceElement.getConfiguration().getTypeHierarchy(); if (!hasProperty(ASSIGNABLE) && !hasProperty(PARAM) && !(visibility == Visibility.PUBLIC || visibility == Visibility.ABSTRACT)) { if (select instanceof Literal) { // we can't rely on the constant value because it hasn't yet been type-checked, // which could change it (eg by numeric promotion). Rather than attempt all the type-checking // now, we do a quick check. See test bug64 int relation = th.relationship(select.getItemType(), type.getPrimaryType()); if (relation == TypeHierarchy.SAME_TYPE || relation == TypeHierarchy.SUBSUMED_BY) { constantValue = ((Literal) select).getValue(); } } } } return constantValue; }
final SequenceType type = getInferredType(true); final TypeHierarchy th = sourceElement.getConfiguration().getTypeHierarchy(); GroundedValue constantValue = null;
final SequenceType type = getInferredType(true); final TypeHierarchy th = sourceElement.getConfiguration().getTypeHierarchy(); GroundedValue constantValue = null;