/** * Determine the data type of the items returned by the expression * @param th The type hierarchy cache */ public ItemType getItemType(TypeHierarchy th) { return operand.getItemType(th); }
/** * Determine the data type of the expression, if this is known statically * @param th the type hierarchy cache */ public ItemType getItemType(TypeHierarchy th) { return operand.getItemType(th); }
public ItemType getOperandItemType() { if (operandItemType == null) { operandItemType = getBaseExpression().getItemType(); } return operandItemType; }
@Override public void supplyTypeInformation(ExpressionVisitor visitor, ContextItemStaticInfo contextItemType, Expression[] arguments) { ItemType type0 = arguments[0].getItemType(); ItemType type1 = arguments[1].getItemType(); if (type0 instanceof AtomicType && type1 instanceof AtomicType) { preAllocateComparer((AtomicType) type0, (AtomicType) type1, visitor.getStaticContext()); } }
/** * Determine the data type of the items returned by the expression, if possible * * @return one of the values Type.STRING, Type.BOOLEAN, Type.NUMBER, Type.NODE, * or Type.ITEM (meaning not known in advance) */ /*@NotNull*/ public ItemType getItemType() { return getAction().getItemType(); }
/** * Get the item type of the items returned by evaluating this instruction * * @return the static item type of the instruction */ /*@NotNull*/ public ItemType getItemType() { return getChild().getItemType(); }
/** * Get the item type of the items returned by evaluating this instruction * * @return the static item type of the instruction */ /*@NotNull*/ public ItemType getItemType() { return getActionExpression().getItemType(); }
/** * Determine the data type of the items returned by this expression * * @return the data type */ /*@NotNull*/ public final ItemType getItemType() { return getAction().getItemType(); }
/** * Get the item type of the items returned by evaluating this instruction * * @return the static item type of the instruction */ /*@NotNull*/ public ItemType getItemType() { return getAction().getItemType(); }
/** * Determine the data type of the items returned by the expression, if possible * * @return a value such as Type.STRING, Type.BOOLEAN, Type.NUMBER, Type.NODE, * or Type.ITEM (meaning not known in advance) */ /*@NotNull*/ public ItemType getItemType() { return getSelect().getItemType(); }
/** * Determine the data type of the items returned by the expression, if possible * * @return a value such as Type.STRING, Type.BOOLEAN, Type.NUMBER, Type.NODE, * or Type.ITEM (meaning not known in advance) */ /*@NotNull*/ public ItemType getItemType() { return getBaseExpression().getItemType(); }
/** * Determine the data type of the items returned by the expression. * * @return a value such as Type.STRING, Type.BOOLEAN, Type.NUMBER, * Type.NODE, or Type.ITEM (meaning not known at compile time) */ /*@NotNull*/ @Override public ItemType getItemType() { return getReturnClause().getItemType(); }
/** * Determine the item type of the value returned by the function */ @Override public ItemType getItemType() { if (itemType == AnyItemType.getInstance() && controllingInstruction != null) { itemType = controllingInstruction.getSelectExpression().getItemType(); } return itemType; }
/** * Test whether a path expression is an absolute path - that is, a path whose first step selects a * document node * * @return true if the first step in this path expression selects a document node */ public boolean isAbsolute() { return getFirstStep().getItemType().getPrimitiveType() == Type.DOCUMENT; }
private void computeSingleValued(TypeHierarchy th) { singleValued = untyped; if (!singleValued) { ItemType nodeType = operand.getItemType(th); if (nodeType instanceof NodeTest) { SchemaType st = ((NodeTest)nodeType).getContentType(); if (st == AnyType.getInstance() || st.isAtomicType()) { singleValued = true; } } } }
@Override public void refineVariableType(ExpressionVisitor visitor, List<VariableReference> references, Expression returnExpr) { ItemType actualItemType = getSequence().getItemType(); if (actualItemType instanceof ErrorType) { actualItemType = AnyItemType.getInstance(); } for (VariableReference ref : references) { ref.refineVariableType(actualItemType, allowsEmpty ? StaticProperty.ALLOWS_ZERO_OR_ONE : StaticProperty.EXACTLY_ONE, null, getSequence().getSpecialProperties()); } }
@Override public void refineVariableType(ExpressionVisitor visitor, List<VariableReference> references, Expression returnExpr) { final Expression seq = getSequence(); final ItemType actualItemType = seq.getItemType(); for (VariableReference ref : references) { ref.refineVariableType(actualItemType, getSequence().getCardinality(), seq instanceof Literal ? ((Literal) seq).getValue() : null, seq.getSpecialProperties()); ExpressionTool.resetStaticProperties(returnExpr); } }
public Expression optimize(ExpressionVisitor visitor, ItemType contextItemType) throws XPathException { TypeHierarchy th = visitor.getConfiguration().getTypeHierarchy(); setStartExpression(visitor.optimize(start, contextItemType)); setStepExpression(step.optimize(visitor, start.getItemType(th))); return promoteFocusIndependentSubexpressions(visitor, contextItemType); }
public PathMap.PathMapNodeSet addToPathMap(PathMap pathMap, PathMap.PathMapNodeSet pathMapNodeSet) { PathMap.PathMapNodeSet result = getBaseExpression().addToPathMap(pathMap, pathMapNodeSet); if (result != null) { TypeHierarchy th = getConfiguration().getTypeHierarchy(); ItemType operandItemType = getBaseExpression().getItemType(); if (th.relationship(NodeKindTest.ELEMENT, operandItemType) != TypeHierarchy.DISJOINT || th.relationship(NodeKindTest.DOCUMENT, operandItemType) != TypeHierarchy.DISJOINT) { result.setAtomized(); } } return null; }
public Expression optimize(ExpressionVisitor visitor, ContextItemStaticInfo contextItemType) throws XPathException { optimizeChildren(visitor, contextItemType); if (getSelect().isCallOn(String_1.class)) { SystemFunctionCall sf = (SystemFunctionCall) getSelect(); TypeHierarchy th = visitor.getConfiguration().getTypeHierarchy(); if (th.isSubType(sf.getArg(0).getItemType(), BuiltInAtomicType.STRING) && !Cardinality.allowsMany(sf.getArg(0).getCardinality())) { setSelect(sf.getArg(0)); } } return this; }