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

Java JRPropertiesHolder类代码示例

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

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



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

示例1: setStatementMultiParameter

import net.sf.jasperreports.engine.JRPropertiesHolder; //导入依赖的package包/类
protected void setStatementMultiParameter(int parameterIndex, String parameterName, int valueIndex, Object value,
		JRPropertiesHolder properties) throws SQLException
{
	if (value == null)
	{
		throw 
			new JRRuntimeException(
				EXCEPTION_MESSAGE_KEY_MULTI_PARAMETERS_CANNOT_CONTAIN_NULL_VALUES,
				(Object[])null);
	}
	
	Class<?> type = value.getClass();
	
	if (log.isDebugEnabled())
	{
		log.debug("Parameter #" + parameterIndex + 
				" (" + parameterName + "[" + valueIndex + "] of type " + type.getName() + "): " + value);
	}
	
	setStatementParameter(parameterIndex, type, value, properties);
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:22,代码来源:JRJdbcQueryExecuter.java


示例2: getFactory

import net.sf.jasperreports.engine.JRPropertiesHolder; //导入依赖的package包/类
/**
 * Returns the text measurer factory given a set of properties.
 * 
 * @param propertiesHolder the properties holder
 * @return the text measurer factory
 */
public JRTextMeasurerFactory getFactory(JRPropertiesHolder propertiesHolder)
{
	String factoryClass = getTextMeasurerFactoryClass(propertiesHolder);
	try
	{
		@SuppressWarnings("deprecation")
		net.sf.jasperreports.engine.fill.JRTextMeasurerFactory factory = cache.getCachedInstance(factoryClass);
		if (factory instanceof JRTextMeasurerFactory)
		{
			return (JRTextMeasurerFactory)factory;
		}
		
		return new WrappingTextMeasurerFactory(factory);
	}
	catch (JRException e)
	{
		throw new JRRuntimeException(e);
	}
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:26,代码来源:JRTextMeasurerUtil.java


示例3: writeProperties

import net.sf.jasperreports.engine.JRPropertiesHolder; //导入依赖的package包/类
/**
 * 
 *
 */
private void writeProperties( JRPropertiesHolder propertiesHolder, String propertiesHolderName)
{
	if (propertiesHolder.hasProperties())
	{
		JRPropertiesMap propertiesMap = propertiesHolder.getPropertiesMap();
		String[] propertyNames = propertiesMap.getPropertyNames();
		if (propertyNames != null && propertyNames.length > 0)
		{
			write( "//properties\n");
			for(int i = 0; i < propertyNames.length; i++)
			{
				String value = propertiesMap.getProperty(propertyNames[i]);
				if (value != null)
				{
					write( propertiesHolderName + ".setProperty(\"" + propertyNames[i] + "\", \"" + JRStringUtil.escapeJavaStringLiteral(value) + "\");\n");
				}
			}
			write("\n");
		}
		flush();
	}
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:27,代码来源:JRApiWriter.java


示例4: getProducer

import net.sf.jasperreports.engine.JRPropertiesHolder; //导入依赖的package包/类
/**
 * 
 */
public BarcodeImageProducer getProducer(JRPropertiesHolder propertiesHolder)
{
	String producerProperty = JRPropertiesUtil.getInstance(jasperReportsContext).getProperty(propertiesHolder, 
			BarcodeImageProducer.PROPERTY_IMAGE_PRODUCER);
	
	String producerClass = JRPropertiesUtil.getInstance(jasperReportsContext).getProperty(propertiesHolder, 
			BarcodeImageProducer.PROPERTY_PREFIX_IMAGE_PRODUCER + producerProperty);
	if (producerClass == null)
	{
		producerClass = producerProperty;
	}
	
	try
	{
		return imageProducerCache.getCachedInstance(producerClass);
	}
	catch (JRException e)
	{
		throw new JRRuntimeException(e);
	}
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:25,代码来源:BarcodeUtils.java


示例5: getQRCodeProducer

import net.sf.jasperreports.engine.JRPropertiesHolder; //导入依赖的package包/类
/**
 * 
 */
public QRCodeImageProducer getQRCodeProducer(JRPropertiesHolder propertiesHolder)
{
	String producerProperty = JRPropertiesUtil.getInstance(jasperReportsContext).getProperty(propertiesHolder, 
			BarcodeImageProducer.PROPERTY_IMAGE_PRODUCER);
	
	String producerClass = JRPropertiesUtil.getInstance(jasperReportsContext).getProperty(propertiesHolder, 
			QRCodeImageProducer.PROPERTY_PREFIX_QRCODE_PRODUCER + producerProperty);
	if (producerClass == null)
	{
		producerClass = producerProperty;
	}
	
	try
	{
		return qrCodeProducerCache.getCachedInstance(producerClass);
	}
	catch (JRException e)
	{
		throw new JRRuntimeException(e);
	}
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:25,代码来源:BarcodeUtils.java


示例6: JRPropertiesMapProperty

import net.sf.jasperreports.engine.JRPropertiesHolder; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public JRPropertiesMapProperty(JRPropertiesHolder holder)
{
   super( "properties", JRPropertiesMap.class, I18n.getString("JRPropertiesMapProperty.Property.Properties"),I18n.getString("JRPropertiesMapProperty.Property.Propertiesdetail"), true,true);
   setValue("canEditAsText", Boolean.FALSE);
   this.propertiesHolder = holder;
   if (holder instanceof JasperDesign)
   {
       setValue("reportProperties", Boolean.TRUE);
       setValue("hintType", com.jaspersoft.ireport.designer.sheet.editors.JRPropertyDialog.SCOPE_REPORT);
   }
   else if(holder instanceof JRTextField)
   {
       setValue("hintType", com.jaspersoft.ireport.designer.sheet.editors.JRPropertyDialog.SCOPE_TEXT_ELEMENT);
   }
   else if(holder instanceof JRElement)
   {
       setValue("hintType", com.jaspersoft.ireport.designer.sheet.editors.JRPropertyDialog.SCOPE_ELEMENT);
   }
}
 
开发者ID:JockiHendry,项目名称:ireport-fork,代码行数:21,代码来源:JRPropertiesMapProperty.java


示例7: setTimestamp

import net.sf.jasperreports.engine.JRPropertiesHolder; //导入依赖的package包/类
protected void setTimestamp(int parameterIndex, Object parameterValue, JRPropertiesHolder properties)
		throws SQLException
{
	if (parameterValue == null)
	{
		statement.setNull(parameterIndex, Types.TIMESTAMP);
	}
	else
	{
		Calendar cal = getParameterCalendar(properties);
		if (log.isDebugEnabled())
		{
			log.debug("setting timestamp parameter " + parameterIndex
					+ " as " + parameterValue
					+ " (" + ((java.sql.Timestamp) parameterValue).getTime() + ")"
					+ " with calendar " + cal);
		}
		if (cal == null)
		{
			statement.setTimestamp(parameterIndex, (java.sql.Timestamp) parameterValue);
		}
		else
		{
			statement.setTimestamp(parameterIndex, (java.sql.Timestamp) parameterValue, cal);
		}
	}
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:28,代码来源:JRJdbcQueryExecuter.java


示例8: setTime

import net.sf.jasperreports.engine.JRPropertiesHolder; //导入依赖的package包/类
protected void setTime(int parameterIndex, Object parameterValue, JRPropertiesHolder properties)
		throws SQLException
{
	if (parameterValue == null)
	{
		statement.setNull(parameterIndex, Types.TIME);
	}
	else
	{
		Calendar cal = getParameterCalendar(properties);
		if (log.isDebugEnabled())
		{
			log.debug("setting time parameter " + parameterIndex
					+ " as " + parameterValue
					+ " (" + ((java.sql.Time) parameterValue).getTime() + ")"
					+ " with calendar " + cal);
		}
		if (cal == null)
		{
			statement.setTime(parameterIndex, (java.sql.Time) parameterValue);
		}
		else
		{
			statement.setTime(parameterIndex, (java.sql.Time) parameterValue, cal);
		}
	}
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:28,代码来源:JRJdbcQueryExecuter.java


示例9: setDate

import net.sf.jasperreports.engine.JRPropertiesHolder; //导入依赖的package包/类
protected void setDate(int parameterIndex, Object parameterValue, JRPropertiesHolder properties)
		throws SQLException
{
	if (parameterValue == null)
	{
		statement.setNull(parameterIndex, Types.DATE);
	}
	else
	{
		Calendar cal = getParameterCalendar(properties);
		if (log.isDebugEnabled())
		{
			log.debug("setting date parameter " + parameterIndex
					+ " as " + parameterValue
					+ " (" + ((java.util.Date) parameterValue).getTime() + ")"
					+ " with calendar " + cal);
		}
		if (cal == null)
		{
			statement.setDate(parameterIndex, new java.sql.Date(((java.util.Date)parameterValue).getTime()));
		}
		else
		{
			statement.setDate(parameterIndex, new java.sql.Date(((java.util.Date)parameterValue).getTime()), cal);
		}
	}
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:28,代码来源:JRJdbcQueryExecuter.java


示例10: getParameterCalendar

import net.sf.jasperreports.engine.JRPropertiesHolder; //导入依赖的package包/类
protected Calendar getParameterCalendar(JRPropertiesHolder properties)
{
	TimeZone tz;
	if (parametersTimeZoneOverride)
	{
		// if we have a parameter, use it
		tz = parametersTimeZone;
	}
	else
	{
		if (properties.hasProperties() && properties.getPropertiesMap().containsProperty(
				JRJdbcQueryExecuterFactory.PROPERTY_TIME_ZONE))
		{
			// read the parameter level property
			String timezoneId = getPropertiesUtil().getProperty(properties, 
					JRJdbcQueryExecuterFactory.PROPERTY_TIME_ZONE);
			if (log.isDebugEnabled())
			{
				log.debug("parameter timezone property " + timezoneId);
			}
			tz = resolveTimeZone(timezoneId);
		}
		else
		{
			// dataset/default property
			tz = parametersTimeZone;
		}
	}

	// using default JVM locale for the calendar
	Calendar cal = tz == null ? null : Calendar.getInstance(tz);
	return cal;
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:34,代码来源:JRJdbcQueryExecuter.java


示例11: writeProperties

import net.sf.jasperreports.engine.JRPropertiesHolder; //导入依赖的package包/类
public void writeProperties(JRPropertiesHolder propertiesHolder) throws IOException
{
	if (propertiesHolder.hasProperties())
	{
		JRPropertiesMap propertiesMap = propertiesHolder.getPropertiesMap();
		String[] propertyNames = propertiesMap.getPropertyNames();
		if (propertyNames != null && propertyNames.length > 0)
		{
			for(int i = 0; i < propertyNames.length; i++)
			{
				String propertyName = propertyNames[i];
				if (isPropertyToWrite(propertiesHolder, propertyName))
				{
					writer.startElement(JRXmlConstants.ELEMENT_property, getNamespace());
					writer.addEncodedAttribute(JRXmlConstants.ATTRIBUTE_name, propertyName);
					String value = propertiesMap.getProperty(propertyName);
					if (value != null)
					{
						String encodedValue = JRStringUtil.encodeXmlAttribute(value);
						if (
							isNewerVersionOrEqual(JRConstants.VERSION_6_4_0)
							&& encodedValue.length() != value.length()
							)
						{
							writer.writeCDATA(value);
						}
						else
						{
							writer.addAttribute(JRXmlConstants.ATTRIBUTE_value, encodedValue);
						}
					}
					writer.closeElement();
				}
			}
		}
	}
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:38,代码来源:JRXmlWriter.java


示例12: isPropertyToWrite

import net.sf.jasperreports.engine.JRPropertiesHolder; //导入依赖的package包/类
protected boolean isPropertyToWrite(JRPropertiesHolder propertiesHolder, String propertyName)
{
	// currently the properties holder does not matter, we just look at the property name
	boolean toWrite = true;
	for (Pattern pattern : excludePropertiesPattern)
	{
		if (pattern.matcher(propertyName).matches())
		{
			// excluding
			toWrite = false;
			break;
		}
	}
	return toWrite;
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:16,代码来源:JRXmlWriter.java


示例13: createObject

import net.sf.jasperreports.engine.JRPropertiesHolder; //导入依赖的package包/类
@Override
public Object createObject(Attributes atts)
{
	JRPropertiesHolder propertiesHolder = (JRPropertiesHolder) digester.peek();
	String name = atts.getValue(JRXmlConstants.ATTRIBUTE_name);
	String value = atts.getValue(JRXmlConstants.ATTRIBUTE_value);
	propertiesHolder.getPropertiesMap().setProperty(name, value);

	return new JRPropertyObject(propertiesHolder, name);
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:11,代码来源:JRPropertyFactory.java


示例14: begin

import net.sf.jasperreports.engine.JRPropertiesHolder; //导入依赖的package包/类
@Override
public void begin(String namespace, String name, Attributes attributes)
{
	JRPropertiesHolder propertiesHolder = (JRPropertiesHolder) digester.peek();
	String key = attributes.getValue(JRXmlConstants.ATTRIBUTE_name);
	String value = attributes.getValue(JRXmlConstants.ATTRIBUTE_value);
	propertiesHolder.getPropertiesMap().setProperty(key, value);
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:9,代码来源:JRPropertyDigesterRule.java


示例15: getTextMeasurerFactoryClass

import net.sf.jasperreports.engine.JRPropertiesHolder; //导入依赖的package包/类
protected String getTextMeasurerFactoryClass(JRPropertiesHolder propertiesHolder)
{
	String factory = JRPropertiesUtil.getInstance(jasperReportsContext).getProperty(propertiesHolder, PROPERTY_TEXT_MEASURER_FACTORY);
	String factoryClassProperty = PROPERTY_TEXT_MEASURER_FACTORY + '.' + factory;
	String factoryClass = JRPropertiesUtil.getInstance(jasperReportsContext).getProperty(propertiesHolder, factoryClassProperty);
	if (factoryClass == null)
	{
		factoryClass = factory;
	}
	return factoryClass;
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:12,代码来源:JRTextMeasurerUtil.java


示例16: DelegatePropertiesHolder

import net.sf.jasperreports.engine.JRPropertiesHolder; //导入依赖的package包/类
public DelegatePropertiesHolder(
	JRPropertiesHolder propertiesHolder, 
	JRPropertiesHolder parentProperties
	) 
{
	this.propertiesHolder = propertiesHolder;
	this.parentProperties = parentProperties;
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:9,代码来源:DelegatePropertiesHolder.java


示例17: getParentProperties

import net.sf.jasperreports.engine.JRPropertiesHolder; //导入依赖的package包/类
@Override
public JRPropertiesHolder getParentProperties() 
{
	return 
		parentProperties == null 
			? (propertiesHolder == null ? null : propertiesHolder.getParentProperties()) 
			: parentProperties;
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:9,代码来源:DelegatePropertiesHolder.java


示例18: exportProperties

import net.sf.jasperreports.engine.JRPropertiesHolder; //导入依赖的package包/类
protected void exportProperties(JRPropertiesHolder propertiesHolder) throws IOException
{
	if (propertiesHolder.hasProperties())
	{
		JRPropertiesMap propertiesMap = propertiesHolder.getPropertiesMap();
		String[] propertyNames = propertiesMap.getPropertyNames();
		if (propertyNames != null && propertyNames.length > 0)
		{
			for(int i = 0; i < propertyNames.length; i++)
			{
				xmlWriter.startElement(JRXmlConstants.ELEMENT_property);
				xmlWriter.addEncodedAttribute(JRXmlConstants.ATTRIBUTE_name, propertyNames[i]);
				String value = propertiesMap.getProperty(propertyNames[i]);
				if (value != null)
				{
					String encodedValue = JRStringUtil.encodeXmlAttribute(value);
					if (
						isNewerVersionOrEqual(JRConstants.VERSION_6_4_0)
						&& encodedValue.length() != value.length()
						)
					{
						xmlWriter.writeCDATA(value);
					}
					else
					{
						xmlWriter.addAttribute(JRXmlConstants.ATTRIBUTE_value, encodedValue);
					}
				}
				xmlWriter.closeElement();
			}
		}
	}
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:34,代码来源:JRXmlExporter.java


示例19: TextMeasurer

import net.sf.jasperreports.engine.JRPropertiesHolder; //导入依赖的package包/类
/**
 * 
 */
public TextMeasurer(JasperReportsContext jasperReportsContext, JRCommonText textElement)
{
	this.jasperReportsContext = jasperReportsContext;
	this.textElement = textElement;
	this.propertiesHolder = textElement instanceof JRPropertiesHolder ? (JRPropertiesHolder) textElement : null;//FIXMENOW all elements are now properties holders, so interfaces might be rearranged
	if (textElement.getDefaultStyleProvider() instanceof JRPropertiesHolder)
	{
		this.propertiesHolder = 
			new DelegatePropertiesHolder(
				propertiesHolder, 
				(JRPropertiesHolder)textElement.getDefaultStyleProvider()
				);
	}
	
	if (textElement instanceof DynamicPropertiesHolder)
	{
		this.dynamicPropertiesHolder = (DynamicPropertiesHolder) textElement;
		
		// we can check this from the beginning
		this.hasDynamicIgnoreMissingFontProp = this.dynamicPropertiesHolder.hasDynamicProperty(
				JRStyledText.PROPERTY_AWT_IGNORE_MISSING_FONT);
		this.hasDynamicSaveLineBreakOffsetsProp = this.dynamicPropertiesHolder.hasDynamicProperty(
				JRTextElement.PROPERTY_SAVE_LINE_BREAKS);
	}

	// read static property values
	JRPropertiesUtil propertiesUtil = JRPropertiesUtil.getInstance(jasperReportsContext);
	defaultIgnoreMissingFont = propertiesUtil.getBooleanProperty(propertiesHolder, 
			JRStyledText.PROPERTY_AWT_IGNORE_MISSING_FONT, false);
	defaultSaveLineBreakOffsets = propertiesUtil.getBooleanProperty(propertiesHolder, 
			JRTextElement.PROPERTY_SAVE_LINE_BREAKS, false);
	
	Context measureContext = new Context();
	simpleLineWrapper = new SimpleTextLineWrapper();
	simpleLineWrapper.init(measureContext);
	
	complextLineWrapper = new ComplexTextLineWrapper();
	complextLineWrapper.init(measureContext);
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:43,代码来源:TextMeasurer.java


示例20: getPropertyValue

import net.sf.jasperreports.engine.JRPropertiesHolder; //导入依赖的package包/类
/**
 * 
 */
protected Object getPropertyValue(Method method, JRPropertiesHolder propertiesHolder)
{
	Object value = null;
	ExporterProperty exporterProperty = method.getAnnotation(ExporterProperty.class);
	if (exporterProperty != null)
	{
		value = getPropertyValue(jasperReportsContext, propertiesHolder, exporterProperty, method.getReturnType());
	}
	return value;
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:14,代码来源:PropertiesNoDefaultsConfigurationFactory.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java PSQLState类代码示例发布时间:2022-05-23
下一篇:
Java ElGamalPublicKey类代码示例发布时间: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