本文整理汇总了Java中net.sf.jasperreports.engine.ParameterContributor类的典型用法代码示例。如果您正苦于以下问题:Java ParameterContributor类的具体用法?Java ParameterContributor怎么用?Java ParameterContributor使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ParameterContributor类属于net.sf.jasperreports.engine包,在下文中一共展示了ParameterContributor类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getContributors
import net.sf.jasperreports.engine.ParameterContributor; //导入依赖的package包/类
@Override
public List<ParameterContributor> getContributors(ParameterContributorContext context) throws JRException
{
List<ParameterContributor> contributors = new ArrayList<ParameterContributor>();
String dataAdapterUri = JRPropertiesUtil.getInstance(context.getJasperReportsContext()).getProperty(context.getDataset(), PROPERTY_DATA_ADAPTER_LOCATION);
if (dataAdapterUri != null)
{
DataAdapterResource dataAdapterResource = RepositoryUtil.getInstance(context.getJasperReportsContext()).getResourceFromLocation(dataAdapterUri, DataAdapterResource.class);
ParameterContributor dataAdapterService = DataAdapterServiceUtil.getInstance(context).getService(dataAdapterResource.getDataAdapter());
return Collections.singletonList(dataAdapterService);
}
return contributors;
}
示例2: getParameterContributors
import net.sf.jasperreports.engine.ParameterContributor; //导入依赖的package包/类
/**
*
*/
private List<ParameterContributor> getParameterContributors(ParameterContributorContext context) throws JRException
{
List<ParameterContributor> allContributors = null;
List<?> factories = getJasperReportsContext().getExtensions(ParameterContributorFactory.class);
if (factories != null && factories.size() > 0)
{
allContributors = new ArrayList<ParameterContributor>();
for (Iterator<?> it = factories.iterator(); it.hasNext();)
{
ParameterContributorFactory factory = (ParameterContributorFactory)it.next();
List<ParameterContributor> contributors = factory.getContributors(context);
if (contributors != null)
{
allContributors.addAll(contributors);
}
}
}
return allContributors;
}
示例3: contributeParameters
import net.sf.jasperreports.engine.ParameterContributor; //导入依赖的package包/类
/**
*
*/
public void contributeParameters(Map<String,Object> parameterValues) throws JRException
{
parameterContributors = getParameterContributors(new ParameterContributorContext(getJasperReportsContext(), this, parameterValues));
if (parameterContributors != null)
{
for(ParameterContributor contributor : parameterContributors)
{
contributor.contributeParameters(parameterValues);
}
}
}
示例4: disposeParameterContributors
import net.sf.jasperreports.engine.ParameterContributor; //导入依赖的package包/类
/**
*
*/
public void disposeParameterContributors()
{
if (parameterContributors != null)
{
for(ParameterContributor contributor : parameterContributors)
{
contributor.dispose();
}
}
}
示例5: getContributors
import net.sf.jasperreports.engine.ParameterContributor; //导入依赖的package包/类
@Override
public List<ParameterContributor> getContributors(ParameterContributorContext context) throws JRException
{
return Collections.<ParameterContributor>singletonList(new HeaderToolbarParameterContributor(context));
}
示例6: getContributors
import net.sf.jasperreports.engine.ParameterContributor; //导入依赖的package包/类
@Override
public List<ParameterContributor> getContributors(ParameterContributorContext context) throws JRException
{
return Collections.<ParameterContributor>singletonList(new SortParameterContributor(context));
}