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


Java JRField类代码示例

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


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

示例1: getFieldValue

import net.sf.jasperreports.engine.JRField; //导入依赖的package包/类
@Override
public Object getFieldValue(JRField field) throws JRException	{
	HrmsLogin user = userList.get(index);
	
	if(field.getName().equals("empId"))		{
		return user.getHrmsEmployeeDetails().getEmpId()+"";
	}
	else if(field.getName().equals("username"))		{
		return user.getUsername();
	}
	else if(field.getName().equals("password"))		{
		return user.getPassword();
	}
	else if(field.getName().equals("role"))		{
		return user.getRole();
	}
	return null;
}
 
开发者ID:PacktPublishing,项目名称:Spring-MVC-Blueprints,代码行数:19,代码来源:AdminJasperBase.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 ("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

示例3: 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

示例4: 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

示例5: 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

示例6: getField

import net.sf.jasperreports.engine.JRField; //导入依赖的package包/类
/**
 *
 */
protected JRBaseField getField(JRField field)
{
	JRBaseField baseField = null;

	if (field != null)
	{
		baseField = (JRBaseField)get(field);
		if (baseField == null)
		{
			baseField = new JRBaseField(field, this);
		}
	}

	return baseField;
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:19,代码来源:JRBaseObjectFactory.java

示例7: getFieldValue

import net.sf.jasperreports.engine.JRField; //导入依赖的package包/类
@Override
public Object getFieldValue(JRField jrField) throws JRException {
    if(currentJsonNode == null) {
        return null;
    }

    String expression;
    if (fieldExpressions.containsKey(jrField.getName())) {
        expression = fieldExpressions.get(jrField.getName());
    } else {
        expression = getFieldExpression(jrField);
        fieldExpressions.put(jrField.getName(), expression);
    }

    if (expression == null || expression.length() == 0) {
        return null;
    }

    JRJsonNode selectedNode = jsonQLExecuter.selectNode(currentJsonNode, root, expression);
    if (selectedNode != null) {
        return getConvertedValue(selectedNode, jrField);
    }

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

示例8: 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

示例9: getFieldValue

import net.sf.jasperreports.engine.JRField; //导入依赖的package包/类
@Override
public Object getFieldValue(JRField jrField) throws JRException
{
	String fieldName = jrField.getName();
	
	Integer columnIndex = this.columnNames.get(fieldName);
	
	if (columnIndex != null)
	{
		return this.tableModel.getValueAt(index, columnIndex.intValue());
	}
	else if (fieldName.startsWith("COLUMN_"))
	{
		return this.tableModel.getValueAt(index, Integer.parseInt(fieldName.substring(7)));
	}
	else
	{
		throw 
			new JRException(
				EXCEPTION_MESSAGE_KEY_UNKNOWN_COLUMN_NAME,
				new Object[]{fieldName});
	}
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:24,代码来源:JRTableModelDataSource.java

示例10: 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,代码来源:JsonDataSource.java

示例11: 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

示例12: writeField

import net.sf.jasperreports.engine.JRField; //导入依赖的package包/类
/**
 *
 */
private void writeField(JRField field) throws IOException
{
	writer.startElement(JRXmlConstants.ELEMENT_field);
	writer.addEncodedAttribute(JRXmlConstants.ATTRIBUTE_name, field.getName());
	writer.addAttribute(JRXmlConstants.ATTRIBUTE_class, field.getValueClassName());

	writeProperties(field);
	if (isNewerVersionOrEqual(JRConstants.VERSION_6_3_1))
	{
		writePropertyExpressions(field.getPropertyExpressions());
	}

	writer.writeCDATAElement(JRXmlConstants.ELEMENT_fieldDescription, field.getDescription());

	writer.closeElement();
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:20,代码来源:JRXmlWriter.java

示例13: JRSourceCompileTask

import net.sf.jasperreports.engine.JRField; //导入依赖的package包/类
protected JRSourceCompileTask(
		JasperDesign jasperDesign, 
		String unitName, 
		JRExpressionCollector expressionCollector, 
		Map<String, ? extends JRParameter> parametersMap, 
		Map<String, JRField> fieldsMap, 
		Map<String, JRVariable> variablesMap, 
		JRVariable[] variables, 
		boolean onlyDefaultEvaluation
		)
{
	this.jasperDesign = jasperDesign;
	this.unitName = unitName;
	this.expressionCollector = expressionCollector;
	this.parametersMap = parametersMap;
	this.fieldsMap = fieldsMap;
	this.variablesMap = variablesMap;
	this.variables = variables;
	this.expressions = expressionCollector.getCompiledExpressions();
	this.onlyDefaultEvaluation = onlyDefaultEvaluation;
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:22,代码来源:JRSourceCompileTask.java

示例14: 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

示例15: removeField

import net.sf.jasperreports.engine.JRField; //导入依赖的package包/类
/**
 * Removes a field from the dataset.
 * 
 * @param field the field to be removed
 * @return the field to be removed
 */
public JRField removeField(JRField field)
{
	if (field != null)
	{
		int idx = fieldsList.indexOf(field);
		if (idx >= 0)
		{
			fieldsList.remove(idx);
			fieldsMap.remove(field.getName());
			
			getEventSupport().fireCollectionElementRemovedEvent(PROPERTY_FIELDS, field, idx);
		}
	}

	return field;
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:23,代码来源:JRDesignDataset.java


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