/** * */ public Class getValueClass() { return parent.getValueClass(); }
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(); }
Class valueClass = jrField.getValueClass();
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(); }
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(); }
Class clazz = field.getValueClass();
Class valueClass = jrField.getValueClass(); Object selectedObject = xPathExecuter.selectObject(currentNode, expression);
/** * 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; } }
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()); }
/** * */ 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); } } } }
return normalize(((PrismProperty) i).getRealValue(), jrField.getValueClass()); normalized.add(normalize(real, jrField.getValueClass()));