当前位置: 首页>>代码示例>>Java>>正文


Java JRField.getName方法代码示例

本文整理汇总了Java中net.sf.jasperreports.engine.JRField.getName方法的典型用法代码示例。如果您正苦于以下问题:Java JRField.getName方法的具体用法?Java JRField.getName怎么用?Java JRField.getName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.sf.jasperreports.engine.JRField的用法示例。


在下文中一共展示了JRField.getName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getFieldValue

import net.sf.jasperreports.engine.JRField; //导入方法依赖的package包/类
@Override
public Object getFieldValue(JRField field) throws JRException
{
	Object value = null;
	
	String fieldName = field.getName();
	
	if ("the_city".equals(fieldName))
	{
		value = data[index][0];
	}
	else if ("id".equals(fieldName))
	{
		value = data[index][1];
	}
	else if ("name".equals(fieldName))
	{
		value = data[index][2];
	}
	else if ("street".equals(fieldName))
	{
		value = data[index][3];
	}
	
	return value;
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:27,代码来源:CustomDataSource.java

示例2: getFieldValue

import net.sf.jasperreports.engine.JRField; //导入方法依赖的package包/类
@Override
public Object getFieldValue(JRField field) throws JRException
{
	Object value = null;
	
	String fieldName = field.getName();
	
	if ("City".equals(fieldName))
	{
		value = data[index][0];
	}
	else if ("Id".equals(fieldName))
	{
		value = data[index][1];
	}
	else if ("Name".equals(fieldName))
	{
		value = data[index][2];
	}
	else if ("Street".equals(fieldName))
	{
		value = data[index][3];
	}
	
	return value;
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:27,代码来源:WebappDataSource.java

示例3: getFieldValue

import net.sf.jasperreports.engine.JRField; //导入方法依赖的package包/类
/**
 *
 */
public Object getFieldValue(JRField field) throws JRException
{
	Object value = null;
	
	String fieldName = field.getName();
	
	if ("City".equals(fieldName))
	{
		value = data[index][0];
	}
	else if ("Id".equals(fieldName))
	{
		value = data[index][1];
	}
	else if ("Name".equals(fieldName))
	{
		value = data[index][2];
	}
	else if ("Street".equals(fieldName))
	{
		value = data[index][3];
	}
	
	return value;
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:29,代码来源:WebappDataSource.java

示例4: getFieldValue

import net.sf.jasperreports.engine.JRField; //导入方法依赖的package包/类
@Override
public Object getFieldValue(JRField field) throws DataSnapshotException
{
	ColumnValuesIterator iterator = iterators.get(field.getName());
	if (iterator == null)
	{
		throw 
			new DataSnapshotException(
				EXCEPTION_MESSAGE_KEY_NO_SUCH_SNAPSHOT_FIELD,
				new Object[]{field.getName()});
	}
	
	Object value = iterator.get();
	
	if (value != null && !field.getValueClass().isInstance(value))
	{
		throw 
			new DataSnapshotException(
				EXCEPTION_MESSAGE_KEY_INVALID_SNAPSHOT_FIELD_TYPE,
				new Object[]{field.getName(), field.getValueClassName(), value.getClass().getName()});
	}
	
	return value;
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:25,代码来源:ColumnValuesDataSource.java

示例5: addField

import net.sf.jasperreports.engine.JRField; //导入方法依赖的package包/类
/**
 * Inserts a field at the specified position into the dataset.
 * @param index the field position
 * @param field the field to insert
 * @throws JRException
 * @see net.sf.jasperreports.engine.JRDataset#getFields()
 */
public void addField(int index, JRField field) throws JRException
{
	if (fieldsMap.containsKey(field.getName()))
	{
		throw 
			new JRException(
				EXCEPTION_MESSAGE_KEY_DUPLICATE_FIELD,
				new Object[]{field.getName()});
	}

	fieldsList.add(index, field);
	fieldsMap.put(field.getName(), field);
	
	getEventSupport().fireCollectionElementAddedEvent(PROPERTY_FIELDS, field, index);
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:23,代码来源:JRDesignDataset.java

示例6: getFieldExpression

import net.sf.jasperreports.engine.JRField; //导入方法依赖的package包/类
protected String getFieldExpression(JRField field) {
    String fieldExpression = null;

    if (field.hasProperties()) {
        fieldExpression = field.getPropertiesMap().getProperty(PROPERTY_FIELD_EXPRESSION);
    }

    if (fieldExpression == null) {
        fieldExpression = field.getDescription();

        if (fieldExpression == null || fieldExpression.length() == 0) {
            fieldExpression = field.getName();
        }
    }

    return fieldExpression;
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:18,代码来源:JsonQLDataSource.java

示例7: getFieldExpression

import net.sf.jasperreports.engine.JRField; //导入方法依赖的package包/类
protected String getFieldExpression(JRField field)
{
	String fieldExpression = null;
	if (field.hasProperties())
	{
		fieldExpression = field.getPropertiesMap().getProperty(PROPERTY_FIELD_EXPRESSION);
	}
	if (fieldExpression == null || fieldExpression.length() == 0)
	{
		fieldExpression = field.getDescription();
		if (fieldExpression == null || fieldExpression.length() == 0)
		{
			fieldExpression = field.getName();
		}
	}
	return fieldExpression;
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:18,代码来源:AbstractXmlDataSource.java

示例8: getFieldValue

import net.sf.jasperreports.engine.JRField; //导入方法依赖的package包/类
/**
 * Returns a field value
 * 
 */
public Object getFieldValue(JRField field) throws JRException {
	UserSettlementBean usb = usbList.get(index);
	Object value = null;		
	String fieldName = field.getName();
	
	if ("amount".equals(fieldName))
	{
		value = usb.getAmount();
	}
	else if ("userName".equals(fieldName))
	{
		value = usb.getUserName();
	}
	else if ("userShare".equals(fieldName))
	{
		value = usb.getUserShare();
	}
	else if ("userPaid".equals(fieldName))
	{
		value = usb.getUserPaid();
	}
	return value;
}
 
开发者ID:arunkpatra,项目名称:expense-tracker,代码行数:28,代码来源:SettlementGenerationDataSource.java

示例9: init

import net.sf.jasperreports.engine.JRField; //导入方法依赖的package包/类
private void init(JasperDesign jasperDesign) throws DRException {
	Validate.notNull(jasperDesign, "jasperDesign must not be null");
	this.jasperDesign = jasperDesign;

	this.fields = new ArrayList<DRIField<?>>();
	for (JRField jrField : jasperDesign.getFields()) {
		@SuppressWarnings({ "unchecked", "rawtypes" })
		DRField<?> field = new DRField(jrField.getName(), jrField.getValueClass());
		fields.add(field);
	}

	this.margin = new DRMargin();
	margin.setTop(jasperDesign.getTopMargin());
	margin.setLeft(jasperDesign.getLeftMargin());
	margin.setBottom(jasperDesign.getBottomMargin());
	margin.setRight(jasperDesign.getRightMargin());
}
 
开发者ID:svn2github,项目名称:dynamicreports-jasper,代码行数:18,代码来源:JasperTemplateDesign.java

示例10: JRBaseField

import net.sf.jasperreports.engine.JRField; //导入方法依赖的package包/类
/**
 *
 */
protected JRBaseField(JRField field, JRBaseObjectFactory factory)
{
	factory.put(field, this);
	
	name = field.getName();
	description = field.getDescription();
	valueClassName = field.getValueClassName();
	
	propertiesMap = field.getPropertiesMap().cloneProperties();
	propertyExpressions = factory.getPropertyExpressions(field.getPropertyExpressions());
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:15,代码来源:JRBaseField.java

示例11: getFieldValue

import net.sf.jasperreports.engine.JRField; //导入方法依赖的package包/类
@Override
public Object getFieldValue(JRField jrField)
{
	Integer fieldIndex = columnNamesMap.get(jrField.getName());

	if (fieldIndex == null)
	{
		throw 
			new JRRuntimeException(
				EXCEPTION_MESSAGE_KEY_FIELD_NOT_FOUND,
				new Object[]{jrField.getName()});
	}

	return currentRecord[fieldIndex.intValue()];
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:16,代码来源:ListOfArrayDataSource.java

示例12: getFieldValue

import net.sf.jasperreports.engine.JRField; //导入方法依赖的package包/类
@Override
public Object getFieldValue(JRField jrField)
{
	Integer fieldIndex = fieldIndexMap.get(jrField.getName());

	if (fieldIndex == null)
	{
		throw 
			new JRRuntimeException(
				ListOfArrayDataSource.EXCEPTION_MESSAGE_KEY_FIELD_NOT_FOUND,
				new Object[]{jrField.getName()});
	}

	return currentRecord[fieldIndex.intValue()];
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:16,代码来源:JRSortableDataSource.java

示例13: verifyFields

import net.sf.jasperreports.engine.JRField; //导入方法依赖的package包/类
/**
 *
 */
private void verifyFields(JRDesignDataset dataset)
{
	JRField[] fields = dataset.getFields();
	if (fields != null && fields.length > 0)
	{
		for(int index = 0; index < fields.length; index++)
		{
			JRField field = fields[index];

			if (field.getName() == null || field.getName().trim().length() == 0)
			{
				addBrokenRule("Field name missing.", field);
			}

			try
			{
				Class<?> fieldType = field.getValueClass();
				if (fieldType == null)
				{
					addBrokenRule("Class not set for field : " + field.getName(), field);
				}
			}
			catch (JRRuntimeException e)
			{
				addBrokenRule(e, field);
			}
			
			verifyProperyExpressions(field.getPropertyExpressions());
		}
	}
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:35,代码来源:JRVerifier.java

示例14: getFieldValue

import net.sf.jasperreports.engine.JRField; //导入方法依赖的package包/类
@Override
public Object getFieldValue(JRField jrField) throws JRException
{
	FieldReader reader = fieldReaders.get(jrField.getName());
	if (reader == null)
	{
		throw 
			new JRRuntimeException(
				EXCEPTION_MESSAGE_KEY_NO_FIELD_READER,
				new Object[]{jrField.getName()});
	}
	return reader.getFieldValue(currentReturnValue);
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:14,代码来源:JRHibernateAbstractDataSource.java

示例15: getPropertyName

import net.sf.jasperreports.engine.JRField; //导入方法依赖的package包/类
@Override
public String getPropertyName(JRField field) 
{
	String fieldPropertyName = null;

	if (fieldPropertyNames.containsKey(field.getName()))
	{
		fieldPropertyName = fieldPropertyNames.get(field.getName());
	}
	else
	{
		if (field.hasProperties())
		{
			fieldPropertyName = field.getPropertiesMap().getProperty(PROPERTY_JAVABEAN_FIELD_PROPERTY);
		}
		
		if (fieldPropertyName == null)
		{
			if (isUseFieldDescription && field.getDescription() != null)
			{
				fieldPropertyName = field.getDescription();
			}
			else
			{
				fieldPropertyName = field.getName();
			}
		}
		
		fieldPropertyNames.put(field.getName(), fieldPropertyName);
	}
	
	return fieldPropertyName;
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:34,代码来源:JRAbstractBeanDataSource.java


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