• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java JRValueParameter类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中net.sf.jasperreports.engine.JRValueParameter的典型用法代码示例。如果您正苦于以下问题:Java JRValueParameter类的具体用法?Java JRValueParameter怎么用?Java JRValueParameter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



JRValueParameter类属于net.sf.jasperreports.engine包,在下文中一共展示了JRValueParameter类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: JRJpaQueryExecuter

import net.sf.jasperreports.engine.JRValueParameter; //导入依赖的package包/类
/**
 * 
 */
public JRJpaQueryExecuter(
	JasperReportsContext jasperReportsContext, 
	JRDataset dataset, 
	Map<String,? extends JRValueParameter> parameters
	) 
{
	super(jasperReportsContext, dataset, parameters);
	
	em = (EntityManager)getParameterValue(JRJpaQueryExecuterFactory.PARAMETER_JPA_ENTITY_MANAGER);
	reportMaxCount = (Integer)getParameterValue(JRParameter.REPORT_MAX_COUNT);

	if (em == null) {
		log.warn("The supplied javax.persistence.EntityManager object is null.");
	}

	parseQuery();
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:21,代码来源:JRJpaQueryExecuter.java


示例2: JaxenXPathQueryExecuter

import net.sf.jasperreports.engine.JRValueParameter; //导入依赖的package包/类
/**
 * 
 */
public JaxenXPathQueryExecuter(
	JasperReportsContext jasperReportsContext,
	JRDataset dataset, 
	Map<String,? extends JRValueParameter> parametersMap
	)
{
	super(jasperReportsContext, dataset, parametersMap);
			
	document = (Document) getParameterValue(JaxenXPathQueryExecuterFactory.PARAMETER_XML_DATA_DOCUMENT);
	documentBuilderFactory = (DocumentBuilderFactory) getParameterValue(
			JaxenXPathQueryExecuterFactory.PARAMETER_DOCUMENT_BUILDER_FACTORY, true);
	namespacesMap = (Map<String, String>) getParameterValue(
			JaxenXPathQueryExecuterFactory.PARAMETER_XML_NAMESPACE_MAP, true);
	
	if (document == null)
	{
		log.warn("The supplied org.w3c.dom.Document object is null.");
	}

	parseQuery();
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:25,代码来源:JaxenXPathQueryExecuter.java


示例3: XalanXPathQueryExecuter

import net.sf.jasperreports.engine.JRValueParameter; //导入依赖的package包/类
/**
 * 
 */
public XalanXPathQueryExecuter(
	JasperReportsContext jasperReportsContext, 
	JRDataset dataset, 
	Map<String,? extends JRValueParameter> parametersMap
	)
{
	super(jasperReportsContext, dataset, parametersMap);
			
	document = (Document) getParameterValue(XalanXPathQueryExecuterFactory.PARAMETER_XML_DATA_DOCUMENT);
	documentBuilderFactory = (DocumentBuilderFactory) getParameterValue(
			XalanXPathQueryExecuterFactory.PARAMETER_DOCUMENT_BUILDER_FACTORY, true);
	namespacesMap = (Map<String, String>) getParameterValue(
			XalanXPathQueryExecuterFactory.PARAMETER_XML_NAMESPACE_MAP, true);

	if (document == null)
	{
		log.warn("The supplied org.w3c.dom.Document object is null.");
	}

	parseQuery();
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:25,代码来源:XalanXPathQueryExecuter.java


示例4: JRHibernateQueryExecuter

import net.sf.jasperreports.engine.JRValueParameter; //导入依赖的package包/类
/**
 * 
 */
public JRHibernateQueryExecuter(
	JasperReportsContext jasperReportsContext, 
	JRDataset dataset, Map<String, ? extends JRValueParameter> parameters
	)
{
	super(jasperReportsContext, dataset, parameters);
	
	session = (Session) getParameterValue(JRHibernateQueryExecuterFactory.PARAMETER_HIBERNATE_SESSION);
	reportMaxCount = (Integer) getParameterValue(JRParameter.REPORT_MAX_COUNT);
	isClearCache = getPropertiesUtil().getBooleanProperty(dataset, 
			JRHibernateQueryExecuterFactory.PROPERTY_HIBERNATE_CLEAR_CACHE,
			false);

	if (session == null)
	{
		log.warn("The supplied org.hibernate.Session object is null.");
	}
	
	parseQuery();
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:24,代码来源:JRHibernateQueryExecuter.java


示例5: setParameters

import net.sf.jasperreports.engine.JRValueParameter; //导入依赖的package包/类
/**
 * Binds values for all the query parameters.
 */
protected void setParameters()
{
	List<String> parameterNames = getCollectedParameterNames();
	
	if (!parameterNames.isEmpty())
	{
		Set<String> namesSet = new HashSet<String>();
		
		for (Iterator<String> iter = parameterNames.iterator(); iter.hasNext();)
		{
			String parameterName = iter.next();
			if (namesSet.add(parameterName))
			{
				JRValueParameter parameter = getValueParameter(parameterName);
				setParameter(parameter);
			}
		}
	}
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:23,代码来源:JRHibernateQueryExecuter.java


示例6: createParameterHandler

import net.sf.jasperreports.engine.JRValueParameter; //导入依赖的package包/类
@Override
protected ClauseFunctionParameterHandler createParameterHandler(JRQueryClauseContext queryContext, 
		String clauseId, String parameterName, boolean left)
{
	JRValueParameter valueParameter = queryContext.getValueParameter(parameterName);
	Object value = valueParameter.getValue();
	if (Date.class.isAssignableFrom(valueParameter.getValueClass()) || value instanceof Date)
	{
		// treat as regular parameter
		return new DefaultClauseFunctionParameterHandler(queryContext, parameterName, value);
	}

	if (value != null && !(value instanceof DateRange))
	{
		throw 
			new JRRuntimeException(
				EXCEPTION_MESSAGE_KEY_UNSUPPORTED_PARAMETER_TYPE,
				new Object[]{parameterName, clauseId, value.getClass().getName()});
	}
	
	boolean useRangeStart = left ? isLeftClosed(clauseId) : !isRightClosed(clauseId);
	return new DateRangeParameterHandler(queryContext, parameterName, 
			(DateRange) value, useRangeStart);
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:25,代码来源:DateRangeSQLBetweenClause.java


示例7: JRMondrianQueryExecuter

import net.sf.jasperreports.engine.JRValueParameter; //导入依赖的package包/类
/**
 * 
 */
public JRMondrianQueryExecuter(
	JasperReportsContext jasperReportsContext, 
	JRDataset dataset, 
	Map<String,? extends JRValueParameter> parametersMap
	)
{
	super(jasperReportsContext, dataset, parametersMap);
	
	connection = (Connection) getParameterValue(JRMondrianQueryExecuterFactory.PARAMETER_MONDRIAN_CONNECTION);

	if (connection == null)
	{
		log.warn("The supplied mondrian.olap.Connection object is null.");
	}
	
	parseQuery();
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:21,代码来源:JRMondrianQueryExecuter.java


示例8: getFields

import net.sf.jasperreports.engine.JRValueParameter; //导入依赖的package包/类
@Override
public List<JRDesignField> getFields(DataAdapterService con, JasperReportsConfiguration jConfig, JRDataset jDataset) throws JRException, UnsupportedOperationException {
	
	Map<String, Object> parameters = new HashMap<String, Object>();
	parameters.put("REPORT_PARAMETERS_MAP", new HashMap<String, Object>());
	try {
		//Here there is the password of the connection
		con.contributeParameters(parameters);
	} catch (JRException e) {
		e.printStackTrace();
	}
	ParameterUtil.setParameters(jConfig, jDataset, parameters);
	parameters.put(JRParameter.REPORT_MAX_COUNT, 2);
	Map<String,? extends JRValueParameter> tmpMap  = ParameterUtil.convertMap(parameters, jDataset);

	JRXmlaQueryExecuter qe = new JRXmlaQueryExecuter(jConfig, jDataset, tmpMap);
	JROlapResult result = qe.getResult();
	return OlapFieldsProviderSupport.getFieldsFromResult(result);
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:20,代码来源:XmlaFieldsProvider.java


示例9: getFields

import net.sf.jasperreports.engine.JRValueParameter; //导入依赖的package包/类
@Override
public List<JRDesignField> getFields(DataAdapterService con, JasperReportsConfiguration jConfig, JRDataset jDataset) throws JRException, UnsupportedOperationException {
	Map<String, Object> parameters = new HashMap<String, Object>();
	con.contributeParameters(parameters);

	ParameterUtil.setParameters(jConfig, jDataset, parameters);
	parameters.put(JRParameter.REPORT_MAX_COUNT, 0);

	// JasperReports query executer instances require
	// REPORT_PARAMETERS_MAP parameter to be defined and not null
	Map<String, JRValueParameter> tmpMap = ParameterUtil.convertMap(parameters, jDataset);
	tmpMap.put(JRParameter.REPORT_PARAMETERS_MAP, new SimpleValueParameter(new HashMap<String, JRValueParameter>()));

	JRMondrianQueryExecuter qe = new JRMondrianQueryExecuter(jConfig, jDataset, tmpMap);
	qe.createDatasource();

	JRMondrianResult result = new JRMondrianResult(qe.getResult());
	return OlapFieldsProviderSupport.getFieldsFromResult(result);
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:20,代码来源:MondrianFieldsProvider.java


示例10: convertMap

import net.sf.jasperreports.engine.JRValueParameter; //导入依赖的package包/类
public static Map<String, JRValueParameter> convertMap(JRDataset dataset, Map<String, ?> inmap) {
        Map<String, JRValueParameter> outmap = new HashMap<String, JRValueParameter>();
        for (String key : inmap.keySet())
        {
                SimpleValueParameter svp = new SimpleValueParameter(inmap.get(key));
                
                // Let's set the correct class name for this parameter...
                for (JRParameter p : dataset.getParameters() )
                {
                    if (p.getName() != null && p.getName().equals(key))
                    {
                        svp.setValueClassName( p.getValueClassName());
                        break;
                    }
                }
                outmap.put(key, svp);
        }
        return outmap;
}
 
开发者ID:JockiHendry,项目名称:ireport-fork,代码行数:20,代码来源:SQLFieldsProvider.java


示例11: determineParameterType

import net.sf.jasperreports.engine.JRValueParameter; //导入依赖的package包/类
protected Class<?> determineParameterType(JRClauseTokens clauseTokens,
		JRQueryClauseContext queryContext, int parameterPosition)
{
	String parameterName = clauseTokens.getToken(parameterPosition);
	if (parameterName == null)
	{
		throw 
			new JRRuntimeException(
				EXCEPTION_MESSAGE_KEY_QUERY_PARAMETER_TYPE_SELECTOR_CLAUSE_IMPLEMENTATION_NOT_FOUND,
				new Object[]{parameterPosition, clauseTokens.getClauseId()});
	}
	
	// the method throws an exception if it doesn't find the parameter, 
	// so we don't have to handle that case here
	JRValueParameter parameter = queryContext.getValueParameter(parameterName);
	
	Class<?> parameterType;
	Object parameterValue = parameter.getValue();
	if (parameterValue == null)
	{
		// if we don't have a value, use the declared type
		parameterType = parameter.getValueClass();
	}
	else
	{
		// use the actual value
		parameterType = parameterValue.getClass();
	}
	
	if (log.isDebugEnabled())
	{
		log.debug("query clause parameter " + parameterName 
				+ " at position " + parameterPosition 
				+ " has type " + parameterType.getName());
	}
	
	return parameterType;
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:39,代码来源:ParameterTypeSelectorClauseFunction.java


示例12: JsonQueryExecuter

import net.sf.jasperreports.engine.JRValueParameter; //导入依赖的package包/类
/**
 * 
 */
public JsonQueryExecuter(
	JasperReportsContext jasperReportsContext,
	JRDataset dataset, 
	Map<String, ? extends JRValueParameter> parametersMap
	)
{
	super(jasperReportsContext, dataset, parametersMap);
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:12,代码来源:JsonQueryExecuter.java


示例13: createQueryExecuter

import net.sf.jasperreports.engine.JRValueParameter; //导入依赖的package包/类
@Override
public JRQueryExecuter createQueryExecuter(
	JasperReportsContext jasperReportsContext,
	JRDataset dataset, 
	Map<String,? extends JRValueParameter> parameters
	) throws JRException 
{
	return new JRXlsxQueryExecuter(jasperReportsContext, dataset, parameters);
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:10,代码来源:JRXlsxQueryExecuterFactory.java


示例14: createQueryExecuter

import net.sf.jasperreports.engine.JRValueParameter; //导入依赖的package包/类
@Override
public JRQueryExecuter createQueryExecuter(
	JasperReportsContext jasperReportsContext, 
	JRDataset dataset, 
	Map<String,? extends JRValueParameter> parameters
	) throws JRException
{
	return new JRXPathQueryExecuter(jasperReportsContext, dataset, parameters);
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:10,代码来源:JRXPathQueryExecuterFactory.java


示例15: createQueryExecuter

import net.sf.jasperreports.engine.JRValueParameter; //导入依赖的package包/类
@Override
public JRQueryExecuter createQueryExecuter(
	JasperReportsContext jasperReportsContext,
	JRDataset dataset, 
	Map<String,? extends JRValueParameter> parameters
	) throws JRException 
{
	return new JRJpaQueryExecuter(jasperReportsContext, dataset, parameters);
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:10,代码来源:JRJpaQueryExecuterFactory.java


示例16: JRAbstractQueryExecuter

import net.sf.jasperreports.engine.JRValueParameter; //导入依赖的package包/类
/**
 * 
 */
protected JRAbstractQueryExecuter(
	JasperReportsContext jasperReportsContext, 
	JRDataset dataset, 
	Map<String, ? extends JRValueParameter> parametersMap
	)
{
	this.jasperReportsContext = jasperReportsContext;
	this.propertiesUtil = JRPropertiesUtil.getInstance(jasperReportsContext);
	this.dataset = dataset;
	this.parametersMap = parametersMap;
	
	queryString = "";
	queryParameters = new ArrayList<QueryParameterEntry>();
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:18,代码来源:JRAbstractQueryExecuter.java


示例17: parameterHasValue

import net.sf.jasperreports.engine.JRValueParameter; //导入依赖的package包/类
/**
 * 
 */
protected boolean parameterHasValue(String parameter)
{
	JRValueParameter reportParametersMap = getValueParameter(JRParameter.REPORT_PARAMETERS_MAP, false);
	@SuppressWarnings("unchecked")
	Map<String,Object> parametersMap = (Map<String,Object>)reportParametersMap.getValue();  
	return parametersMap.containsKey(parameter);
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:11,代码来源:JRAbstractQueryExecuter.java


示例18: getValueParameter

import net.sf.jasperreports.engine.JRValueParameter; //导入依赖的package包/类
/**
 * Return a value parameter from the parameters map.
 * 
 * @param parameterName the parameter name
 * @param ignoreMissing if <code>true</code>, the method will return null for non existing parameters;
 * 		otherwise, an exception will be thrown if the parameter does not exist
 * @return the parameter
 */
protected JRValueParameter getValueParameter(String parameterName, boolean ignoreMissing)
{
	JRValueParameter parameter = parametersMap.get(parameterName);
	
	if (parameter == null && !ignoreMissing)
	{
		throw 
			new JRRuntimeException(
				EXCEPTION_MESSAGE_KEY_PARAMETER_NOT_FOUND,
				new Object[]{parameterName});
	}
	
	return parameter;
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:23,代码来源:JRAbstractQueryExecuter.java


示例19: createQueryExecuter

import net.sf.jasperreports.engine.JRValueParameter; //导入依赖的package包/类
@Override
public JRQueryExecuter createQueryExecuter(
	JasperReportsContext jasperReportsContext,
	JRDataset dataset, 
	Map<String, ? extends JRValueParameter> parameters
	) throws JRException
{
	return new JsonQueryExecuter(jasperReportsContext, dataset, parameters);
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:10,代码来源:JsonQueryExecuterFactory.java


示例20: JRXPathQueryExecuter

import net.sf.jasperreports.engine.JRValueParameter; //导入依赖的package包/类
/**
 * 
 */
public JRXPathQueryExecuter(
	JasperReportsContext jasperReportsContext,
	JRDataset dataset, 
	Map<String,? extends JRValueParameter> parametersMap
	)
{
	super(jasperReportsContext, dataset, parametersMap);
			
	parseQuery();
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:14,代码来源:JRXPathQueryExecuter.java



注:本文中的net.sf.jasperreports.engine.JRValueParameter类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java GbifTerm类代码示例发布时间:2022-05-23
下一篇:
Java LabelMethodItem类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap