本文整理匯總了Java中net.sf.jasperreports.engine.ParameterContributorFactory類的典型用法代碼示例。如果您正苦於以下問題:Java ParameterContributorFactory類的具體用法?Java ParameterContributorFactory怎麽用?Java ParameterContributorFactory使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
ParameterContributorFactory類屬於net.sf.jasperreports.engine包,在下文中一共展示了ParameterContributorFactory類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getParameterContributors
import net.sf.jasperreports.engine.ParameterContributorFactory; //導入依賴的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;
}
示例2: init
import net.sf.jasperreports.engine.ParameterContributorFactory; //導入依賴的package包/類
public void init()
{
jasperReportsContext = new SimpleJasperReportsContext();
// for some reason data adapter extensions are not registered by default
jasperReportsContext.setExtensions(ParameterContributorFactory.class,
Collections.singletonList(DataAdapterParameterContributorFactory.getInstance()));
jasperReportsContext.setExtensions(DataFileServiceFactory.class,
Collections.singletonList(BuiltinDataFileServiceFactory.instance()));
try
{
compileReport();
readReferenceDigest();
}
catch (JRException | IOException | NoSuchAlgorithmException e)
{
throw new RuntimeException(e);
}
}