本文整理汇总了Java中ro.nextreports.engine.queryexec.QueryParameter.setRuntimeName方法的典型用法代码示例。如果您正苦于以下问题:Java QueryParameter.setRuntimeName方法的具体用法?Java QueryParameter.setRuntimeName怎么用?Java QueryParameter.setRuntimeName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ro.nextreports.engine.queryexec.QueryParameter
的用法示例。
在下文中一共展示了QueryParameter.setRuntimeName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getParameter
import ro.nextreports.engine.queryexec.QueryParameter; //导入方法依赖的package包/类
public Serializable getParameter(ExternalParameter parameter) {
QueryParameter qp = new QueryParameter(parameter.getName(), parameter.getDescription(),
parameter.getValueClassName());
qp.setRuntimeName(parameter.getRuntimeName());
if (ExternalParameter.COMBO_TYPE.equals(parameter.getType())) {
qp.setSelection(QueryParameter.SINGLE_SELECTION);
} else {
qp.setSelection(QueryParameter.MULTIPLE_SELECTION);
}
List<String> list = new ArrayList<String>();
for (IdName in : parameter.getValues()) {
// TODO resolve
// list.add(in.getName());
}
qp.setValues(list);
return qp;
}
示例2: convert
import ro.nextreports.engine.queryexec.QueryParameter; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
private Map<String, QueryParameter> convert(DataSource ds, Map<String, Serializable> params) throws Exception {
Map<String, QueryParameter> result = new LinkedHashMap<String, QueryParameter>();
Set s = params.entrySet();
for (Object value : s) {
Map.Entry<String, Serializable> me = (Map.Entry<String, Serializable>) value;
JasperParameter jp = (JasperParameter) me.getValue();
String className = JasperReportsUtil.getValueClassName(storageService, ds, jp);
QueryParameter qp = new QueryParameter(jp.getName(), jp.getDescription(), className);
//System.out.println(">>> Source = " + jp.getSelect());
qp.setSource(jp.getSelect());
qp.setMandatory(jp.isMandatory());
qp.setRuntimeName(jp.getShortName());
if (JasperParameterSource.LIST.equals(jp.getType())) {
qp.setSelection(QueryParameter.MULTIPLE_SELECTION);
qp.setManualSource(true);
} else if (JasperParameterSource.COMBO.equals(jp.getType())) {
qp.setSelection(QueryParameter.SINGLE_SELECTION);
qp.setManualSource(true);
} else {
// SINGLE
qp.setSelection(QueryParameter.SINGLE_SELECTION);
qp.setManualSource(false);
}
//System.out.println("Convert qp=" + qp.getName() + " " + qp.getSelection() + " " + qp.getValueClass());
result.put(me.getKey(), qp);
}
return result;
}
示例3: convertJasper
import ro.nextreports.engine.queryexec.QueryParameter; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
private static Map<String, QueryParameter> convertJasper(StorageService storageService, DataSource ds, Map<String, Serializable> params) throws Exception {
Map<String, QueryParameter> result = new LinkedHashMap<String, QueryParameter>();
Set s = params.entrySet();
for (Object value : s) {
Map.Entry<String, Serializable> me = (Map.Entry<String, Serializable>) value;
JasperParameter jp = (JasperParameter) me.getValue();
String className = JasperReportsUtil.getValueClassName(storageService, ds, jp);
QueryParameter qp = new QueryParameter(jp.getName(), jp.getDescription(), className);
//System.out.println(">>> Source = " + jp.getSelect());
qp.setSource(jp.getSelect());
qp.setMandatory(true);
qp.setRuntimeName(jp.getShortName());
if (JasperParameterSource.LIST.equals(jp.getType())) {
qp.setSelection(QueryParameter.MULTIPLE_SELECTION);
qp.setManualSource(true);
} else if (JasperParameterSource.COMBO.equals(jp.getType())) {
qp.setSelection(QueryParameter.SINGLE_SELECTION);
qp.setManualSource(true);
} else {
// SINGLE
qp.setSelection(QueryParameter.SINGLE_SELECTION);
qp.setManualSource(false);
}
//System.out.println("Convert qp=" + qp.getName() + " " + qp.getSelection() + " " + qp.getValueClass());
result.put(me.getKey(), qp);
}
return result;
}