/** * Static factory method * * @param base A sequence expression denoting sequence whose first item is to be returned * @return the FirstItemExpression, or an equivalent */ public static Expression makeFirstItemExpression(Expression base) { if (base instanceof FirstItemExpression) { return base; } else { return new FirstItemExpression(base); } }
/** * Static factory method * * @param base A sequence expression denoting sequence whose first item is to be returned * @return the FirstItemExpression, or an equivalent */ public static Expression makeFirstItemExpression(Expression base) { if (base instanceof FirstItemExpression) { return base; } else { return new FirstItemExpression(base); } }
/** * Copy an expression. This makes a deep copy. * * @return the copy of the original expression */ public Expression copy() { return new FirstItemExpression(getBaseExpression().copy()); }
/** * Copy an expression. This makes a deep copy. * * @return the copy of the original expression */ public Expression copy() { return new FirstItemExpression(getBaseExpression().copy()); }
/** * Copy an expression. This makes a deep copy. * * @return the copy of the original expression */ public Expression copy() { return new FirstItemExpression(getBaseExpression().copy()); }
/** * Copy an expression. This makes a deep copy. * * @return the copy of the original expression * @param rebindings */ /*@NotNull*/ public Expression copy(RebindingMap rebindings) { Expression e2 = new FirstItemExpression(getBaseExpression().copy(rebindings)); ExpressionTool.copyLocationInfo(this, e2); return e2; }
/** * Copy an expression. This makes a deep copy. * * @return the copy of the original expression * @param rebindings */ /*@NotNull*/ public Expression copy(RebindingMap rebindings) { Expression e2 = new FirstItemExpression(getBaseExpression().copy(rebindings)); ExpressionTool.copyLocationInfo(this, e2); return e2; }
/** * Make an expression that extracts the first item of a sequence, after atomization */ public static Expression makeFirstItem(Expression exp, StaticContext env) { final TypeHierarchy th = env.getConfiguration().getTypeHierarchy(); if (!exp.getItemType(th).isAtomicType()) { exp = new Atomizer(exp, env.getConfiguration()); } if (Cardinality.allowsMany(exp.getCardinality())) { exp = new FirstItemExpression(exp); } if (!th.isSubType(exp.getItemType(th), BuiltInAtomicType.STRING)) { exp = new AtomicSequenceConverter(exp, BuiltInAtomicType.STRING); } return exp; }
/** * Make an expression that extracts the first item of a sequence, after atomization */ public static Expression makeFirstItem(Expression exp, StaticContext env) { final TypeHierarchy th = env.getConfiguration().getTypeHierarchy(); if (!exp.getItemType(th).isAtomicType()) { exp = new Atomizer(exp, env.getConfiguration()); } if (Cardinality.allowsMany(exp.getCardinality())) { exp = new FirstItemExpression(exp); } if (!th.isSubType(exp.getItemType(th), BuiltInAtomicType.STRING)) { exp = new AtomicSequenceConverter(exp, BuiltInAtomicType.STRING); } return exp; }
/** * Make an expression that extracts the first item of a sequence, after atomization */ public static Expression makeFirstItem(Expression exp, StaticContext env) { final TypeHierarchy th = env.getConfiguration().getTypeHierarchy(); if (!exp.getItemType(th).isAtomicType()) { exp = new Atomizer(exp, env.getConfiguration()); } if (Cardinality.allowsMany(exp.getCardinality())) { exp = new FirstItemExpression(exp); } if (!th.isSubType(exp.getItemType(th), BuiltInAtomicType.STRING)) { exp = new AtomicSequenceConverter(exp, BuiltInAtomicType.STRING); } return exp; }
public Expression compile(Executable exec) throws XPathException { final TypeHierarchy th = getConfiguration().getTypeHierarchy(); if (separator == null && select != null && backwardsCompatibleModeIsEnabled()) { if (!select.getItemType(th).isAtomicType()) { select = new Atomizer(select, getStaticContext().getConfiguration()); } if (Cardinality.allowsMany(select.getCardinality())) { select = new FirstItemExpression(select); } if (!th.isSubType(select.getItemType(th), BuiltInAtomicType.STRING)) { select = new AtomicSequenceConverter(select, BuiltInAtomicType.STRING); } } else { if (separator == null) { if (select == null) { separator = new StringLiteral(StringValue.EMPTY_STRING); } else { separator = new StringLiteral(StringValue.SINGLE_SPACE); } } } ValueOf inst = new ValueOf(select, disable, false); compileContent(exec, inst, separator); return inst; }
public Expression compile(Executable exec) throws XPathException { final TypeHierarchy th = getConfiguration().getTypeHierarchy(); if (separator == null && select != null && backwardsCompatibleModeIsEnabled()) { if (!select.getItemType(th).isAtomicType()) { select = new Atomizer(select, getStaticContext().getConfiguration()); } if (Cardinality.allowsMany(select.getCardinality())) { select = new FirstItemExpression(select); } if (!th.isSubType(select.getItemType(th), BuiltInAtomicType.STRING)) { select = new AtomicSequenceConverter(select, BuiltInAtomicType.STRING); } } else { if (separator == null) { if (select == null) { separator = new StringLiteral(StringValue.EMPTY_STRING); } else { separator = new StringLiteral(StringValue.SINGLE_SPACE); } } } ValueOf inst = new ValueOf(select, disable, false); compileContent(exec, inst, separator); return inst; }
FirstItemExpression fie = new FirstItemExpression(start); ExpressionTool.copyLocationInfo(this, fie); return fie;
sortKey = visitor.typeCheck(sortKey, selectedItemType); if (visitor.getStaticContext().isInBackwardsCompatibleMode()) { sortKey = new FirstItemExpression(sortKey); } else { RoleLocator role =
sortKey = visitor.typeCheck(sortKey, selectedItemType); if (visitor.getStaticContext().isInBackwardsCompatibleMode()) { sortKey = new FirstItemExpression(sortKey); } else { RoleLocator role =
sortKey = visitor.typeCheck(sortKey, sortedItemType); if (visitor.getStaticContext().isInBackwardsCompatibleMode()) { sortKey = new FirstItemExpression(sortKey); } else { RoleLocator role =
sortKey = visitor.typeCheck(sortKey, sortedItemType); if (visitor.getStaticContext().isInBackwardsCompatibleMode()) { sortKey = new FirstItemExpression(sortKey); } else { RoleLocator role =
sortKey = visitor.typeCheck(sortKey, sortedItemType); if (visitor.getStaticContext().isInBackwardsCompatibleMode()) { sortKey = new FirstItemExpression(sortKey); } else { RoleLocator role =
private Expression createConversionCode( Expression operand, final TypeHierarchy th, AtomicType type) { if (Cardinality.allowsMany(operand.getCardinality())) { FirstItemExpression fie = new FirstItemExpression(operand); ExpressionTool.copyLocationInfo(this, fie); operand = fie;
private Expression createConversionCode( Expression operand, final TypeHierarchy th, AtomicType type) { if (Cardinality.allowsMany(operand.getCardinality())) { FirstItemExpression fie = new FirstItemExpression(operand); ExpressionTool.copyLocationInfo(this, fie); operand = fie;