/** * Sets the value of the collection item. * @param c */ public void addItem(String key, Calendar c) { addItem(key, new PdfDate(c)); }
/** * Sets the value of the collection item. * @param n */ public void addItem(String key, PdfNumber n) { PdfName fieldname = new PdfName(key); PdfCollectionField field = (PdfCollectionField)schema.get(fieldname); if (field.fieldType == PdfCollectionField.NUMBER) { put(fieldname, n); } }
/** * Adds a prefix for the Collection item. * You can only use this method after you have set the value of the item. * @param prefix a prefix */ public void setPrefix(String key, String prefix) { PdfName fieldname = new PdfName(key); PdfObject o = get(fieldname); if (o == null) throw new IllegalArgumentException("You must set a value before adding a prefix."); PdfDictionary dict = new PdfDictionary(PdfName.COLLECTIONSUBITEM); dict.put(PdfName.D, o); dict.put(PdfName.P, new PdfString(prefix, PdfObject.TEXT_UNICODE)); put(fieldname, dict); } }
/** * Sets the value of the collection item. * @param d */ public void addItem(String key, PdfDate d) { PdfName fieldname = new PdfName(key); PdfCollectionField field = (PdfCollectionField)schema.get(fieldname); if (field.fieldType == PdfCollectionField.DATE) { put(fieldname, d); } }
/** * Adds a prefix for the Collection item. * You can only use this method after you have set the value of the item. * @param prefix a prefix */ public void setPrefix(String key, String prefix) { PdfName fieldname = new PdfName(key); PdfObject o = get(fieldname); if (o == null) throw new IllegalArgumentException(MessageLocalization.getComposedMessage("you.must.set.a.value.before.adding.a.prefix")); PdfDictionary dict = new PdfDictionary(PdfName.COLLECTIONSUBITEM); dict.put(PdfName.D, o); dict.put(PdfName.P, new PdfString(prefix, PdfObject.TEXT_UNICODE)); put(fieldname, dict); } }
/** * Sets the value of the collection item. * @param d */ public void addItem(String key, double d) { addItem(key, new PdfNumber(d)); }
/** * Sets the value of the collection item. * @param value */ public void addItem(String key, PdfString value) { PdfName fieldname = new PdfName(key); PdfCollectionField field = (PdfCollectionField)schema.get(fieldname); if (field.fieldType == PdfCollectionField.TEXT) { put(fieldname, value); } }
/** * Adds a prefix for the Collection item. * You can only use this method after you have set the value of the item. * @param prefix a prefix */ public void setPrefix(String key, String prefix) { PdfName fieldname = new PdfName(key); PdfObject o = get(fieldname); if (o == null) throw new IllegalArgumentException(MessageLocalization.getComposedMessage("you.must.set.a.value.before.adding.a.prefix")); PdfDictionary dict = new PdfDictionary(PdfName.COLLECTIONSUBITEM); dict.put(PdfName.D, o); dict.put(PdfName.P, new PdfString(prefix, PdfObject.TEXT_UNICODE)); put(fieldname, dict); } }
/** * Sets the value of the collection item. * @param i */ public void addItem(String key, int i) { addItem(key, new PdfNumber(i)); }
/** * Sets the value of the collection item. * @param n */ public void addItem(String key, PdfNumber n) { PdfName fieldname = new PdfName(key); PdfCollectionField field = (PdfCollectionField)schema.get(fieldname); if (field.fieldType == PdfCollectionField.NUMBER) { put(fieldname, n); } }
/** * Sets the value of the collection item. * @param f */ public void addItem(String key, float f) { addItem(key, new PdfNumber(f)); }
/** * Sets the value of the collection item. * @param d */ public void addItem(String key, PdfDate d) { PdfName fieldname = new PdfName(key); PdfCollectionField field = (PdfCollectionField)schema.get(fieldname); if (field.fieldType == PdfCollectionField.DATE) { put(fieldname, d); } }
/** * Sets the value of the collection item. * @param d */ public void addItem(String key, double d) { addItem(key, new PdfNumber(d)); }
/** * Sets the value of the collection item. * @param n */ public void addItem(String key, PdfNumber n) { PdfName fieldname = new PdfName(key); PdfCollectionField field = (PdfCollectionField)schema.get(fieldname); if (field.fieldType == PdfCollectionField.NUMBER) { put(fieldname, n); } }
/** * Sets the value of the collection item. * @param i */ public void addItem(String key, int i) { addItem(key, new PdfNumber(i)); }
/** * Sets the value of the collection item. * @param value */ public void addItem(String key, PdfString value) { PdfName fieldname = new PdfName(key); PdfCollectionField field = (PdfCollectionField)schema.get(fieldname); if (field.fieldType == PdfCollectionField.TEXT) { put(fieldname, value); } }
/** * Sets the value of the collection item. * @param f */ public void addItem(String key, float f) { addItem(key, new PdfNumber(f)); }
/** * Sets the value of the collection item. * @param value */ public void addItem(String key, PdfString value) { PdfName fieldname = new PdfName(key); PdfCollectionField field = (PdfCollectionField)schema.get(fieldname); if (field.fieldType == PdfCollectionField.TEXT) { put(fieldname, value); } }
/** * Sets the value of the collection item. * @param i */ public void addItem(String key, int i) { addItem(key, new PdfNumber(i)); }
/** * Sets the value of the collection item. * @param d */ public void addItem(String key, PdfDate d) { PdfName fieldname = new PdfName(key); PdfCollectionField field = (PdfCollectionField)schema.get(fieldname); if (field.fieldType == PdfCollectionField.DATE) { put(fieldname, d); } }