本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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());
}
示例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());
}
示例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()];
}
示例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()];
}
示例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());
}
}
}
示例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);
}
示例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;
}