@Test public void getUnsupportedTypeValueTest() { final String stringValue = "string value"; final String fieldName = "fieldName"; junitExpectedException.expect(PdfException.class); junitExpectedException.expectMessage(MessageFormatUtil.format(PdfException._1IsNotAnAcceptableValueForTheField2, stringValue, fieldName)); PdfCollectionField field = new PdfCollectionField(fieldName, PdfCollectionField.FILENAME); field.getValue(stringValue); }
public PdfObject getValue(String value) { switch (subType) { case TEXT: return new PdfString(value); case DATE: return new PdfDate(PdfDate.decode(value)).getPdfObject(); case NUMBER: return new PdfNumber(Double.parseDouble(value.trim())); } throw new PdfException(PdfException._1IsNotAnAcceptableValueForTheField2).setMessageParams(value, getPdfObject().getAsString(PdfName.N).getValue()); }
PdfCollectionField extends PdfObjectWrapper<PdfDictionary> { public PdfObject getValue(String value) { switch (subType) { case TEXT: return new PdfString(value); case DATE: return new PdfDate(PdfDate.decode(value)).getPdfObject(); case NUMBER: return new PdfNumber(Double.parseDouble(value.trim())); } throw new PdfException(PdfException._1IsNotAnAcceptableValueForTheField2).setMessageParams(value, getPdfObject().getAsString(PdfName.N).getValue()); } }
PdfCollectionField extends PdfObjectWrapper<PdfDictionary> { public PdfObject getValue(String value) { switch (subType) { case TEXT: return new PdfString(value); case DATE: return new PdfDate(PdfDate.decode(value)).getPdfObject(); case NUMBER: return new PdfNumber(Double.parseDouble(value.trim())); } throw new PdfException(PdfException._1IsNotAnAcceptableValueForTheField2).setMessageParams(value, getPdfObject().getAsString(PdfName.N).getValue()); } protected  PdfCollectionField(PdfDictionary pdfObject);  PdfCollectionField(String name, int subType); }
PdfCollectionField extends PdfObjectWrapper<PdfDictionary> { public PdfObject getValue(String value) { switch (subType) { case TEXT: return new PdfString(value); case DATE: return new PdfDate(PdfDate.decode(value)).getPdfObject(); case NUMBER: return new PdfNumber(Double.parseDouble(value.trim())); } throw new PdfException(PdfException._1IsNotAnAcceptableValueForTheField2).setMessageParams(value, getPdfObject().getAsString(PdfName.N).getValue()); } protected  PdfCollectionField(PdfDictionary pdfObject);  PdfCollectionField(String name, int subType); PdfCollectionField setOrder(int order); PdfNumber getOrder(); PdfCollectionField setVisibility(boolean visible); PdfBoolean getVisibility(); PdfCollectionField setEditable(boolean editable); PdfBoolean getEditable(); PdfObject getValue(String value); }
PdfCollectionField extends PdfObjectWrapper<PdfDictionary> { public PdfObject getValue(String value) { switch (subType) { case TEXT: return new PdfString(value); case DATE: return new PdfDate(PdfDate.decode(value)).getPdfObject(); case NUMBER: return new PdfNumber(Double.parseDouble(value.trim())); } throw new PdfException(PdfException._1IsNotAnAcceptableValueForTheField2).setMessageParams(value, getPdfObject().getAsString(PdfName.N).getValue()); } protected  PdfCollectionField(PdfDictionary pdfObject);  PdfCollectionField(String name, int subType); PdfCollectionField setOrder(int order); PdfNumber getOrder(); PdfCollectionField setVisibility(boolean visible); PdfBoolean getVisibility(); PdfCollectionField setEditable(boolean editable); PdfBoolean getEditable(); PdfObject getValue(String value); static final int TEXT; static final int DATE; static final int NUMBER; static final int FILENAME; static final int DESC; static final int MODDATE; static final int CREATIONDATE; static final int SIZE; }