/** * Copy an expression. This makes a deep copy. * * @return the copy of the original expression * @param rebindings */ /*@NotNull*/ @Override public Expression copy(RebindingMap rebindings) { HomogeneityChecker hc = new HomogeneityChecker(getBaseExpression().copy(rebindings)); ExpressionTool.copyLocationInfo(this, hc); return hc; }
/** * Iterate the path-expression in a given context * * @param context the evaluation context */ /*@NotNull*/ public SequenceIterator<?> iterate(final XPathContext context) throws XPathException { // This class delivers the result of the path expression in unsorted order, // without removal of duplicates. If sorting and deduplication are needed, // this is achieved by wrapping the path expression in a DocumentSorter SequenceIterator<?> base = getBaseExpression().iterate(context); return new HomogeneityCheckerIterator(base, getLocation()); }
if (getBaseExpression() instanceof HomogeneityChecker) { return getBaseExpression().typeCheck(visitor, contextInfo); getOperand().typeCheck(visitor, contextInfo); TypeHierarchy th = visitor.getConfiguration().getTypeHierarchy(); ItemType type = getBaseExpression().getItemType(); if (type.equals(ErrorType.getInstance())) { return Literal.makeEmptySequence(); if (rel == TypeHierarchy.DISJOINT) { if (getBaseExpression() instanceof SlashExpression && ((SlashExpression) getBaseExpression()).getLeadingSteps() instanceof SlashExpression && (((SlashExpression) getBaseExpression()).getLeadingSteps().getSpecialProperties() & StaticProperty.ORDERED_NODESET) == 0) { DocumentSorter ds = new DocumentSorter(((SlashExpression) getBaseExpression()).getLeadingSteps()); SlashExpression se = new SlashExpression(ds, ((SlashExpression) getBaseExpression()).getLastStep()); ExpressionTool.copyLocationInfo(this, se); return se; } else { return getBaseExpression(); Expression savedBase = getBaseExpression(); Expression parent = getParentExpression(); getOperand().detachChild(); DocumentSorter ds = new DocumentSorter(savedBase); ExpressionTool.copyLocationInfo(this, ds);
exp = new HomogeneityChecker(new SlashExpression(exp, next)); } else /* (op == Token.SLASH_SLASH)*/ { setLocation(one, offset); exp = ExpressionTool.makePathExpression(one, next); exp = new HomogeneityChecker(exp);
@Override public Expression optimize(ExpressionVisitor visitor, ContextItemStaticInfo contextInfo) throws XPathException { if (getBaseExpression() instanceof HomogeneityChecker) { return getBaseExpression().optimize(visitor, contextInfo); } return super.optimize(visitor, contextInfo); }
if (getBaseExpression() instanceof HomogeneityChecker) { return getBaseExpression().typeCheck(visitor, contextInfo); getOperand().typeCheck(visitor, contextInfo); TypeHierarchy th = visitor.getConfiguration().getTypeHierarchy(); ItemType type = getBaseExpression().getItemType(); if (type.equals(ErrorType.getInstance())) { return Literal.makeEmptySequence(); if (rel == TypeHierarchy.DISJOINT) { if (getBaseExpression() instanceof SlashExpression && ((SlashExpression) getBaseExpression()).getLeadingSteps() instanceof SlashExpression && (((SlashExpression) getBaseExpression()).getLeadingSteps().getSpecialProperties() & StaticProperty.ORDERED_NODESET) == 0) { DocumentSorter ds = new DocumentSorter(((SlashExpression) getBaseExpression()).getLeadingSteps()); SlashExpression se = new SlashExpression(ds, ((SlashExpression) getBaseExpression()).getLastStep()); ExpressionTool.copyLocationInfo(this, se); return se; } else { return getBaseExpression(); Expression savedBase = getBaseExpression(); Expression parent = getParentExpression(); getOperand().detachChild(); DocumentSorter ds = new DocumentSorter(savedBase); ExpressionTool.copyLocationInfo(this, ds);
exp = new HomogeneityChecker(new SlashExpression(exp, next)); } else if (op == Token.SLASH_SLASH) { setLocation(step); exp = ExpressionTool.makePathExpression(exp, step); exp = new HomogeneityChecker(exp); } else /*if (op == Token.BANG)*/ { if (!allowXPath30Syntax) {
@Override public Expression optimize(ExpressionVisitor visitor, ContextItemStaticInfo contextInfo) throws XPathException { if (getBaseExpression() instanceof HomogeneityChecker) { return getBaseExpression().optimize(visitor, contextInfo); } return super.optimize(visitor, contextInfo); }
/** * Copy an expression. This makes a deep copy. * * @return the copy of the original expression * @param rebindings */ /*@NotNull*/ @Override public Expression copy(RebindingMap rebindings) { HomogeneityChecker hc = new HomogeneityChecker(getBaseExpression().copy(rebindings)); ExpressionTool.copyLocationInfo(this, hc); return hc; }
/** * Iterate the path-expression in a given context * * @param context the evaluation context */ /*@NotNull*/ public SequenceIterator<?> iterate(final XPathContext context) throws XPathException { // This class delivers the result of the path expression in unsorted order, // without removal of duplicates. If sorting and deduplication are needed, // this is achieved by wrapping the path expression in a DocumentSorter SequenceIterator<?> base = getBaseExpression().iterate(context); return new HomogeneityCheckerIterator(base, getLocation()); }
setLocation(one, offset); exp = ExpressionTool.makePathExpression(one, next); exp = new HomogeneityChecker(exp);
setLocation(step); exp = ExpressionTool.makePathExpression(exp, step); exp = new HomogeneityChecker(exp); } else /*if (op == Token.BANG)*/ { if (!allowXPath30Syntax) {
if (t.overlaps(UType.ANY_NODE)) { if (t.overlaps(UType.ANY_ATOMIC.union(UType.FUNCTION))) { result = new HomogeneityChecker(result); } else if (e2.hasSpecialProperty(StaticProperty.ORDERED_NODESET)) {