while (parameters.hasNext()) {
// this is to check whether some one has locked the parmter at the top level
OMElement parameterElement = (OMElement) parameters.next();
Parameter parameter = new ParameterImpl();
// setting parameterElement
parameter.setParameterElement(parameterElement);
// setting parameter Name
OMAttribute paramName = parameterElement.getAttribute(new QName(ATTRIBUTE_NAME));
if (paramName == null) {
throw new DeploymentException(
Messages.getMessage(DeploymentErrorMsgs.BAD_PARAMETER_ARGUMENT));
}
parameter.setName(paramName.getAttributeValue());
// setting parameter Value (the chiled elemnt of the parameter)
OMElement paramValue = parameterElement.getFirstElement();
if (paramValue != null) {
parameter.setValue(parameterElement);
parameter.setParameterType(Parameter.OM_PARAMETER);
} else {
String paratextValue = parameterElement.getText();
parameter.setValue(paratextValue);
parameter.setParameterType(Parameter.TEXT_PARAMETER);
}
// setting locking attribute
OMAttribute paramLocked = parameterElement.getAttribute(new QName(ATTRIBUTE_LOCKED));
Parameter parentParam = null;
if (parent != null) {
parentParam = parent.getParameter(parameter.getName());
}
if (paramLocked != null) {
String lockedValue = paramLocked.getAttributeValue();
if (BOOLEAN_TRUE.equals(lockedValue)) {
// if the parameter is locked at some level parameter value replace by that
if ((parent != null) && parent.isParameterLocked(parameter.getName())) {
throw new DeploymentException(
Messages.getMessage(
DeploymentErrorMsgs.CONFIG_NOT_FOUND, parameter.getName()));
} else {
parameter.setLocked(true);
}
} else {
parameter.setLocked(false);
}
}
if (Constants.WSA_ACTION.equals(paramName.getAttributeValue())) {
wsamapping.add(parameter);
// no need to add this parameter , since this is just for mapping
continue;
}
try {
if (parent != null) {
if ((parentParam == null) || !parent.isParameterLocked(parameter.getName())) {
parameterInclude.addParameter(parameter);
}
} else {
parameterInclude.addParameter(parameter);
}