/** * */ public String getName() { return parent.getName(); }
public Object getFieldValue(JRField field) throws JRException { String name = field.getName(); Class clazz = field.getValueClass(); Object value = this.currentRow.get(name.toUpperCase()); return ValueObjectUtil.typeCast(value, clazz); // return reader.getValue(); }
/** * */ protected JRBaseField(JRField field, JRBaseObjectFactory factory) { factory.put(field, this); name = field.getName(); description = field.getDescription(); valueClassName = field.getValueClassName(); this.propertiesMap = field.getPropertiesMap().cloneProperties(); }
public String getPropertyName(JRField field) { if (field.getDescription() == null) { return field.getName(); } return field.getDescription(); } };
/** * */ 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); writer.writeCDATAElement(JRXmlConstants.ELEMENT_fieldDescription, field.getDescription()); writer.closeElement(); }
fieldIndexMap.put(fields[i].getName(), new Integer(i)); if (sortField.getName().equals(field.getName())) collatorFlags[i] = String.class.getName().equals(field.getValueClassName()); break;
return null; String expression = jrField.getDescription(); if (expression == null || expression.length() == 0) return null; Class valueClass = jrField.getValueClass(); Object selectedObject = xPathExecuter.selectObject(currentNode, expression);
/** * */ public Class getValueClass() { return parent.getValueClass(); }
/** * */ public String getDescription() { return parent.getDescription(); }
public JRPropertiesMap getPropertiesMap() { return parent.getPropertiesMap(); }
String expression = field.getDescription(); expression = field.getName(); log.debug("field: " + field.getName() + "/" + value);
protected String getFieldMapping(JRField field) { return field.getDescription(); }
public String getPropertyName(JRField field) { return field.getName(); } };
public Object getFieldValue(JRField field) throws JRException { String name = field.getName(); Class clazz = field.getValueClass(); Object value = ValueObjectUtil.getValue(this.currentRow,name); return ValueObjectUtil.typeCast(value, clazz); // return reader.getValue(); }
/** * */ public Object getFieldValue(JRField field) { Object value = null; if (currentRecord != null) { value = currentRecord.get(field.getName()); } return value; }
public Object getFieldValue(JRField field) throws JRException { String name = field.getName(); Class clazz = field.getValueClass(); Object value = ValueObjectUtil.getValue(currentRow,name); return ValueObjectUtil.typeCast(value, clazz); // return reader.getValue(); }
/** * {@inheritDoc} */ @Override public Object getFieldValue(JRField field) throws JRException { return currentRecord.get(field.getName()); }
/** * */ 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); } } } }
/** * */ public Object getFieldValue(JRField field) { Object value = null; Map currentRecord = (Map)records[index]; if (currentRecord != null) { value = currentRecord.get(field.getName()); } return value; }
/** * Get the value of a given field * * @param field The field to get the value for. The expression language to get the value * of the field is either taken from the description property or from the name of the field * if the description is <code>null</code>. * @return an <code>Object</code> containing the field value or a new * <code>ValueStackDataSource</code> object if the field value evaluates to * an object that can be iterated over. * @throws JRException if there is a problem obtaining the value */ public Object getFieldValue(JRField field) throws JRException { //TODO: move the code to return a ValueStackDataSource to a seperate // method when and if the JRDataSource interface is updated to support // this. String expression = field.getName(); Object value = valueStack.findValue(expression); LOG.debug("Field [{}] = [{}]", field.getName(), value); if (!wrapField && MakeIterator.isIterable(value) && field.getValueClass().isInstance(value)) { return value; } else if (MakeIterator.isIterable(value)) { // wrap value with ValueStackDataSource if not already wrapped return new ValueStackDataSource(this.valueStack, expression, wrapField); } else { return value; } }