本文整理匯總了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));
}