/** * Optimize the stylesheet construct * * @param declaration the declaration of this variable */ public void optimize(ComponentDeclaration declaration) throws XPathException { if (!redundant && compiledVariable.getSelectExpression() != null) { Expression exp2 = compiledVariable.getSelectExpression(); ExpressionVisitor visitor = makeExpressionVisitor(); exp2 = ExpressionTool.optimizeComponentBody( exp2, getCompilation(), visitor, getConfiguration().makeContextItemStaticInfo(AnyItemType.getInstance(), true), false); allocateLocalSlots(exp2); if (slotManager != null && slotManager.getNumberOfVariables() > 0) { compiledVariable.setContainsLocals(slotManager); } if (exp2 != compiledVariable.getSelectExpression()) { compiledVariable.setSelectExpression(exp2); } } }
/** * Optimize the stylesheet construct * * @param declaration the declaration of this variable */ public void optimize(ComponentDeclaration declaration) throws XPathException { if (!redundant && compiledVariable.getSelectExpression() != null) { Expression exp2 = compiledVariable.getSelectExpression(); ExpressionVisitor visitor = makeExpressionVisitor(); exp2 = ExpressionTool.optimizeComponentBody( exp2, getCompilation(), visitor, getConfiguration().makeContextItemStaticInfo(AnyItemType.getInstance(), true), false); allocateLocalSlots(exp2); if (slotManager != null && slotManager.getNumberOfVariables() > 0) { compiledVariable.setContainsLocals(slotManager); } if (exp2 != compiledVariable.getSelectExpression()) { compiledVariable.setSelectExpression(exp2); } } }
/** * Get the corresponding Procedure object that results from the compilation of this * StylesheetProcedure */ public Actor getActor() throws XPathException { GlobalVariable gv = getCompiledVariable(); if (gv == null) { gv = this instanceof XSLGlobalParam ? new GlobalParam() : new GlobalVariable(); gv.setPackageData(getCompilation().getPackageData()); gv.makeDeclaringComponent(getVisibility(), getContainingPackage()); gv.setRequiredType(sourceBinding.getDeclaredType()); gv.setDeclaredVisibility(getDeclaredVisibility()); gv.setVariableQName(sourceBinding.getVariableQName()); gv.setSystemId(getSystemId()); gv.setLineNumber(getLineNumber()); RetainedStaticContext rsc = makeRetainedStaticContext(); gv.setRetainedStaticContext(rsc); if (gv.getBody() != null) { gv.getBody().setRetainedStaticContext(rsc); } compiledVariable = gv; } return gv; }
/** * Get the corresponding Procedure object that results from the compilation of this * StylesheetProcedure */ public Actor getActor() throws XPathException { GlobalVariable gv = getCompiledVariable(); if (gv == null) { gv = this instanceof XSLGlobalParam ? new GlobalParam() : new GlobalVariable(); gv.setPackageData(getCompilation().getPackageData()); gv.makeDeclaringComponent(getVisibility(), getContainingPackage()); gv.setRequiredType(sourceBinding.getDeclaredType()); gv.setDeclaredVisibility(getDeclaredVisibility()); gv.setVariableQName(sourceBinding.getVariableQName()); gv.setSystemId(getSystemId()); gv.setLineNumber(getLineNumber()); RetainedStaticContext rsc = makeRetainedStaticContext(); gv.setRetainedStaticContext(rsc); if (gv.getBody() != null) { gv.getBody().setRetainedStaticContext(rsc); } compiledVariable = gv; } return gv; }
if (inst == null) { inst = new GlobalVariable(); inst.setPackageData(getCompilation().getPackageData()); inst.makeDeclaringComponent(getVisibility(), getContainingPackage()); inst.setVariableQName(sourceBinding.getVariableQName());
if (inst == null) { inst = new GlobalVariable(); inst.setPackageData(getCompilation().getPackageData()); inst.makeDeclaringComponent(getVisibility(), getContainingPackage()); inst.setVariableQName(sourceBinding.getVariableQName());