}
} else if (searchParamChain == null) {
searchParam.addChain(nextParameter.getName());
searchParamChain = searchParam.getChain().get(searchParam.getChain().size()-1);
ExtensionDt ext = new ExtensionDt();
ext.setUrl(ExtensionConstants.CONF_CHAIN_REQUIRED);
ext.setValue(new BooleanDt(nextParameter.isRequired()));
searchParamChain.getUndeclaredExtensions().add(ext);
} else {
ExtensionDt ext = new ExtensionDt();
ext.setUrl(ExtensionConstants.CONF_ALSO_CHAIN);
searchParamChain.getUndeclaredExtensions().add(ext);
ExtensionDt extReq = new ExtensionDt();
extReq.setUrl(ExtensionConstants.CONF_CHAIN_REQUIRED);
extReq.setValue(new BooleanDt(nextParameter.isRequired()));
ext.getUndeclaredExtensions().add(extReq);
}
}