/** * Get the saved static base URI as a string * * @return the static base URI */ public String getStaticBaseURIString() { return getRetainedStaticContext().getStaticBaseUriString(); }
/** * Get the saved static base URI as a string * * @return the static base URI */ public String getStaticBaseURIString() { return getRetainedStaticContext().getStaticBaseUriString(); }
/** * Get the saved static base URI as a URI * * @return the static base URI as a URI * @throws XPathException if the static base URI is not a valid URI */ public URI getStaticBaseURI() throws XPathException { return getRetainedStaticContext().getStaticBaseUri(); }
/** * Get the retained static context of the expression * @return the retained static context */ public final RetainedStaticContext getRetainedStaticContext() { if (retainedStaticContext == null) { Expression parent = getParentExpression(); assert parent != null; retainedStaticContext = parent.getRetainedStaticContext(); assert retainedStaticContext != null; } return retainedStaticContext; }
/** * Get the saved static base URI as a URI * * @return the static base URI as a URI * @throws XPathException if the static base URI is not a valid URI */ public URI getStaticBaseURI() throws XPathException { return getRetainedStaticContext().getStaticBaseUri(); }
/** * Get the retained static context of the expression * @return the retained static context */ public final RetainedStaticContext getRetainedStaticContext() { if (retainedStaticContext == null) { Expression parent = getParentExpression(); assert parent != null; retainedStaticContext = parent.getRetainedStaticContext(); assert retainedStaticContext != null; } return retainedStaticContext; }
/** * Get the configuration containing this expression * * @return the containing Configuration */ public Configuration getConfiguration() { try { return getRetainedStaticContext().getConfiguration(); } catch (NullPointerException e) { throw new NullPointerException("Internal error: expression " + toShortString() + " has no retained static context"); } }
/** * Get information about the containing package * @return package data */ public PackageData getPackageData() { try { return getRetainedStaticContext().getPackageData(); } catch (NullPointerException e) { throw new NullPointerException("Internal error: expression " + toShortString() + " has no retained static context"); } }
/** * Get information about the containing package * @return package data */ public PackageData getPackageData() { try { return getRetainedStaticContext().getPackageData(); } catch (NullPointerException e) { throw new NullPointerException("Internal error: expression " + toShortString() + " has no retained static context"); } }
/** * Get the configuration containing this expression * * @return the containing Configuration */ public Configuration getConfiguration() { try { return getRetainedStaticContext().getConfiguration(); } catch (NullPointerException e) { throw new NullPointerException("Internal error: expression " + toShortString() + " has no retained static context"); } }
/** * Ask whether the static context of this expression is compatible with the static context * of another expression. The static contexts are considered compatible if either (a) * neither expression depends on the static context, or (b) both expressions depend on the static * context and the two static contexts compare equal. * @param other the other expression * @return true if the two expressions have equivalent static contexts */ protected boolean hasCompatibleStaticContext(Expression other) { boolean d1 = (getIntrinsicDependencies() & StaticProperty.DEPENDS_ON_STATIC_CONTEXT) != 0; boolean d2 = (other.getIntrinsicDependencies() & StaticProperty.DEPENDS_ON_STATIC_CONTEXT) != 0; if (d1 != d2) { return false; } if (d1) { return getRetainedStaticContext().equals(other.getRetainedStaticContext()); } return true; }
/** * Construct an expression that obtains the effective boolean value of a given expression, * by wrapping it in a call of the boolean() function * * @param in the given expression * @return an expression that wraps the given expression in a call to the fn:boolean() function */ private static Expression forceToBoolean(Expression in) { if (in.getItemType().getPrimitiveType() == StandardNames.XS_BOOLEAN) { return in; } return SystemFunction.makeCall("boolean", in.getRetainedStaticContext(), in); }
/** * Construct an expression that obtains the effective boolean value of a given expression, * by wrapping it in a call of the boolean() function * * @param in the given expression * @return an expression that wraps the given expression in a call to the fn:boolean() function */ private static Expression forceToBoolean(Expression in) { if (in.getItemType().getPrimitiveType() == StandardNames.XS_BOOLEAN) { return in; } return SystemFunction.makeCall("boolean", in.getRetainedStaticContext(), in); }
public void setStreamable(boolean streamable) { this.streamable = streamable; if (streamable && instruction.getConfiguration().getBooleanProperty(Feature.STREAMING_FALLBACK)) { this.streamable = false; Expression select = rowSelectOp.getChildExpression(); rowSelectOp.setChildExpression( SystemFunction.makeCall("snapshot", select.getRetainedStaticContext(), select)); } }
public void setStreamable(boolean streamable) { this.streamable = streamable; if (streamable && instruction.getConfiguration().getBooleanProperty(Feature.STREAMING_FALLBACK)) { this.streamable = false; Expression select = rowSelectOp.getChildExpression(); rowSelectOp.setChildExpression( SystemFunction.makeCall("snapshot", select.getRetainedStaticContext(), select)); } }
private static Expression makeMinOrMax(Expression exp, String function) { if (Cardinality.allowsMany(exp.getCardinality())) { Expression fn = SystemFunction.makeCall(function, exp.getRetainedStaticContext(), exp); assert fn != null; ((Minimax) ((SystemFunctionCall) fn).getTargetFunction()).setIgnoreNaN(true); return fn; } else { return exp; } }
private static Expression makeMinOrMax(Expression exp, String function) { if (Cardinality.allowsMany(exp.getCardinality())) { Expression fn = SystemFunction.makeCall(function, exp.getRetainedStaticContext(), exp); assert fn != null; ((Minimax) ((SystemFunctionCall) fn).getTargetFunction()).setIgnoreNaN(true); return fn; } else { return exp; } }
private Expression makeGetCall(ExpressionVisitor visitor, BuiltInFunctionSet fnSet, ContextItemStaticInfo contextInfo, Expression[] arguments) throws XPathException { Expression target = arguments[0]; Expression key = ((SquareArrayConstructor)arguments[1]).getOperanda().getOperand(0).getChildExpression(); Expression getter = fnSet.makeFunction("get", 2).makeFunctionCall(target, key); getter.setRetainedStaticContext(target.getRetainedStaticContext()); return getter.typeCheck(visitor, contextInfo); }
private Expression makeGetCall(ExpressionVisitor visitor, BuiltInFunctionSet fnSet, ContextItemStaticInfo contextInfo, Expression[] arguments) throws XPathException { Expression target = arguments[0]; Expression key = ((SquareArrayConstructor)arguments[1]).getOperanda().getOperand(0).getChildExpression(); Expression getter = fnSet.makeFunction("get", 2).makeFunctionCall(target, key); getter.setRetainedStaticContext(target.getRetainedStaticContext()); return getter.typeCheck(visitor, contextInfo); }
private void compileNamedTemplate(Compilation compilation, Expression body, ComponentDeclaration decl) throws XPathException { RetainedStaticContext rsc = body.getRetainedStaticContext(); compiledNamedTemplate.setPackageData(rsc.getPackageData()); compiledNamedTemplate.setBody(body); compiledNamedTemplate.setStackFrameMap(stackFrameMap); compiledNamedTemplate.setSystemId(getSystemId()); compiledNamedTemplate.setLineNumber(getLineNumber()); compiledNamedTemplate.setHasRequiredParams(hasRequiredParams); compiledNamedTemplate.setRequiredType(requiredType); compiledNamedTemplate.setContextItemRequirements(requiredContextItemType, mayOmitContextItem, absentFocus); compiledNamedTemplate.setRetainedStaticContext(rsc); compiledNamedTemplate.setDeclaredVisibility(getDeclaredVisibility()); Component overridden = getOverriddenComponent(); if (overridden != null) { checkCompatibility(overridden); } ContextItemStaticInfo cisi = getConfiguration().makeContextItemStaticInfo(requiredContextItemType, mayOmitContextItem); Expression body2 = refineTemplateBody(body, cisi); compiledNamedTemplate.setBody(body2); }