/*
* 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: CallTemplate.java,v 1.2.4.1 2005/09/12 10:02:41 pvedula Exp $
*/
/**
* @author Jacek Ambroziak
* @author Santiago Pericas-Geertsen
* @author Erwin Bolwidt <ejb@klomp.org>
*/
/**
* Name of template to call.
*/
/**
* The array of effective parameters in this CallTemplate. An object in
* this array can be either a WithParam or a Param if no WithParam
* exists for a particular parameter.
*/
/**
* The corresponding template which this CallTemplate calls.
*/
}
public boolean hasWithParams() {
return elementCount() > 0;
}
}
}
else {
}
}
/**
* Verify that a template with this name exists.
*/
}
else {
throw new TypeCheckError(err);
}
}
// If there are Params in the stylesheet or WithParams in this call?
// Build the parameter list if the called template is simple named
if (_calleeTemplate != null) {
}
// This is only needed when the called template is not
// a simple named template.
else {
// Push parameter frame
}
}
// Generate a valid Java method name
// Load standard arguments
// Initialize prefix of method signature
// If calling a simply named template, push actual arguments
if (_calleeTemplate != null) {
for (int i = 0; i < numParams; i++) {
// Push 'null' if Param to indicate no actual parameter specified
}
else { // translate WithParam
}
}
}
// Complete signature and generate invokevirtual call
// Do not need to call Translet.popParamFrame() if we are
// calling a simple named template.
// Pop parameter frame
}
}
/**
* Return the simple named template which this CallTemplate calls.
* Return false if there is no matched template or the matched
* template is not a simple named template.
*/
}
/**
* Build the list of effective parameters in this CallTemplate.
* The parameters of the called template are put into the array first.
* Then we visit the WithParam children of this CallTemplate and replace
* the Param with a corresponding WithParam having the same name.
*/
private void buildParameterList() {
// Put the parameters from the called template into the array first.
// This is to ensure the order of the parameters.
for (int i = 0; i < numParams; i++) {
}
// Replace a Param with a WithParam if they have the same name.
int count = elementCount();
for (int i = 0; i < count; i++) {
// Ignore if not WithParam
// Search for a Param with the same name
for (int k = 0; k < numParams; k++) {
_parameters[k] = withParam;
break;
}
_parameters[k] = withParam;
break;
}
}
}
}
}
}