public void validate(ComponentDeclaration decl) throws XPathException { if (sourceBinding.hasProperty(SourceBinding.REQUIRED)) { if (sourceBinding.getSelectExpression() != null) { // NB, we do this test before setting the default select attribute compileError("The select attribute must be absent when required='yes'", "XTSE0010"); } if (hasChildNodes()) { compileError("A parameter specifying required='yes' must have empty content", "XTSE0010"); } Visibility vis = getVisibility(); if (!sourceBinding.isStatic() && !(vis == Visibility.PUBLIC || vis == Visibility.FINAL || vis == Visibility.ABSTRACT)) { compileError("The visibility of a required non-static parameter must be public, final, or abstract", "XTSE3370"); } } super.validate(decl); }
public void validate(ComponentDeclaration decl) throws XPathException { if (sourceBinding.hasProperty(SourceBinding.REQUIRED)) { if (sourceBinding.getSelectExpression() != null) { // NB, we do this test before setting the default select attribute compileError("The select attribute must be absent when required='yes'", "XTSE0010"); } if (hasChildNodes()) { compileError("A parameter specifying required='yes' must have empty content", "XTSE0010"); } Visibility vis = getVisibility(); if (!sourceBinding.isStatic() && !(vis == Visibility.PUBLIC || vis == Visibility.FINAL || vis == Visibility.ABSTRACT)) { compileError("The visibility of a required non-static parameter must be public, final, or abstract", "XTSE3370"); } } super.validate(decl); }
/** * Validate the declaration * * @throws XPathException if the declaration is invalid */ public void validate() throws XPathException { if (select != null && sourceElement.hasChildNodes()) { sourceElement.compileError("An " + sourceElement.getDisplayName() + " element with a select attribute must be empty", "XTSE0620"); } if (hasProperty(DISALLOWS_CONTENT) && sourceElement.hasChildNodes()) { if (isStatic()) { sourceElement.compileError("A static variable or parameter must have no content", "XTSE0010"); } else { sourceElement.compileError("Within xsl:function, an xsl:param element must have no content", "XTSE0620"); } } if (visibility == Visibility.ABSTRACT && (select != null || sourceElement.hasChildNodes())) { sourceElement.compileError("An abstract variable must have no select attribute and no content", "XTSE0620"); } }
/** * Validate the declaration * * @throws XPathException if the declaration is invalid */ public void validate() throws XPathException { if (select != null && sourceElement.hasChildNodes()) { sourceElement.compileError("An " + sourceElement.getDisplayName() + " element with a select attribute must be empty", "XTSE0620"); } if (hasProperty(DISALLOWS_CONTENT) && sourceElement.hasChildNodes()) { if (isStatic()) { sourceElement.compileError("A static variable or parameter must have no content", "XTSE0010"); } else { sourceElement.compileError("Within xsl:function, an xsl:param element must have no content", "XTSE0620"); } } if (visibility == Visibility.ABSTRACT && (select != null || sourceElement.hasChildNodes())) { sourceElement.compileError("An abstract variable must have no select attribute and no content", "XTSE0620"); } }
/** * Compile a global xsl:param element: this ensures space is available for local variables declared within * this global variable */ public void compileDeclaration(Compilation compilation, ComponentDeclaration decl) throws XPathException { if (sourceBinding.isStatic()) { super.compileDeclaration(compilation, decl); } else if (!redundant) { sourceBinding.handleSequenceConstructor(compilation, decl); GlobalParam binding = (GlobalParam)compiledVariable; binding.setPackageData(getCompilation().getPackageData()); binding.makeDeclaringComponent(Visibility.PUBLIC, getContainingPackage()); Expression select = sourceBinding.getSelectExpression(); binding.setSelectExpression(select); binding.setVariableQName(sourceBinding.getVariableQName()); initializeBinding(binding); binding.setRequiredType(getRequiredType()); binding.setRequiredParam(sourceBinding.hasProperty(SourceBinding.REQUIRED)); binding.setImplicitlyRequiredParam(sourceBinding.hasProperty(SourceBinding.IMPLICITLY_REQUIRED)); sourceBinding.fixupBinding(binding); //compiledVariable = binding; Component overridden = getOverriddenComponent(); if (overridden != null) { checkCompatibility(overridden); } } }
/** * Compile a global xsl:param element: this ensures space is available for local variables declared within * this global variable */ public void compileDeclaration(Compilation compilation, ComponentDeclaration decl) throws XPathException { if (sourceBinding.isStatic()) { super.compileDeclaration(compilation, decl); } else if (!redundant) { sourceBinding.handleSequenceConstructor(compilation, decl); GlobalParam binding = (GlobalParam)compiledVariable; binding.setPackageData(getCompilation().getPackageData()); binding.makeDeclaringComponent(Visibility.PUBLIC, getContainingPackage()); Expression select = sourceBinding.getSelectExpression(); binding.setSelectExpression(select); binding.setVariableQName(sourceBinding.getVariableQName()); initializeBinding(binding); binding.setRequiredType(getRequiredType()); binding.setRequiredParam(sourceBinding.hasProperty(SourceBinding.REQUIRED)); binding.setImplicitlyRequiredParam(sourceBinding.hasProperty(SourceBinding.IMPLICITLY_REQUIRED)); sourceBinding.fixupBinding(binding); //compiledVariable = binding; Component overridden = getOverriddenComponent(); if (overridden != null) { checkCompatibility(overridden); } } }
inst.setVariableQName(sourceBinding.getVariableQName()); if (sourceBinding.isStatic()) { inst.setStatic(true); GroundedValue<?> value =
inst.setVariableQName(sourceBinding.getVariableQName()); if (sourceBinding.isStatic()) { inst.setStatic(true); GroundedValue<?> value =