/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
*/
/*
* Copyright 2001-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id: WithParam.java,v 1.2.4.1 2005/09/12 11:38:01 pvedula Exp $
*/
/**
* @author Jacek Ambroziak
* @author Santiago Pericas-Geertsen
* @author Morten Jorgensen
* @author John Howard <JohnH@schemasoft.com>
*/
/**
* Parameter's name.
*/
/**
* The escaped qname of the with-param.
*/
/**
* Parameter's default value.
*/
/**
* %OPT% This is set to true when the WithParam is used in a CallTemplate
* for a simple named template. If this is true, the parameters are
* passed to the named template through method arguments rather than
* using the expensive Translet.addParameter() call.
*/
private boolean _doParameterOptimization = false;
/**
* Displays the contents of this element
*/
}
}
/**
* Returns the escaped qname of the parameter
*/
return _escapedName;
}
/**
* Return the name of this WithParam.
*/
return _name;
}
/**
* Set the name of the variable or paremeter. Escape all special chars.
*/
}
/**
* Set the do parameter optimization flag
*/
}
/**
* The contents of a <xsl:with-param> elements are either in the element's
* 'select' attribute (this has precedence) or in the element body.
*/
this);
}
}
else {
}
}
}
/**
* Type-check either the select attribute or the element body, depending
* on which is in use.
*/
if (tselect instanceof ReferenceType == false) {
}
}
else {
}
}
/**
* Compile the value of the parameter, which is either in an expression in
* a 'select' attribute, or in the with-param element's body
*/
// Compile expression is 'select' attribute if present
}
// If not, compile result tree from parameter body if present.
else if (hasContents()) {
}
// If neither are present then store empty string in parameter slot
else {
}
}
/**
* This code generates a sequence of bytecodes that call the
* addParameter() method in AbstractTranslet. The method call will add
* (or update) the parameter frame with the new parameter value.
*/
// Translate the value and put it on the stack
if (_doParameterOptimization) {
return;
}
// Make name acceptable for use as field name in class
// Load reference to the translet (method is in AbstractTranslet)
// Load the name of the parameter
// Generete the value of the parameter (use value in 'select' by def.)
// Mark this parameter value is not being the default value
// Pass the parameter to the template
}
}