public class XfdfReader extends Object implements SimpleXMLDocHandler, FieldReader
Constructor and Description |
---|
XfdfReader(byte[] xfdfIn)
Reads an XFDF form.
|
XfdfReader(String filename)
Reads an XFDF form.
|
Modifier and Type | Method and Description |
---|---|
void |
endDocument()
Called after the document is parsed.
|
void |
endElement(String tag)
Called when an end tag is found.
|
Map<String,String> |
getAllFields() |
String |
getField(String name)
Gets the field value.
|
HashMap<String,String> |
getFields()
Deprecated.
use
getAllFields() |
String |
getFieldValue(String name)
Gets the field value or
null if the field does not exist or has no value defined. |
String |
getFileSpec()
Gets the PDF file specification contained in the FDF.
|
List<String> |
getListValues(String name)
Gets the field values for a list or
null if the field does not exist or has no value defined. |
void |
startDocument()
Called when the document starts to be parsed.
|
void |
startElement(String tag,
HashMap h)
Deprecated.
|
void |
startElement(String tag,
Map<String,String> h)
Called when a start tag is found.
|
void |
text(String str)
Called when a text element is found.
|
public XfdfReader(String filename) throws IOException
filename
- the file name of the formIOException
- on errorpublic XfdfReader(byte[] xfdfIn) throws IOException
xfdfIn
- the byte array with the formIOException
- on error@Deprecated public HashMap<String,String> getFields()
getAllFields()
PdfDictionary
with the
field content.getFields
in interface FieldReader
public Map<String,String> getAllFields()
getAllFields
in interface FieldReader
public String getField(String name)
name
- the fully qualified field namepublic String getFieldValue(String name)
null
if the field does not exist or has no value defined.getFieldValue
in interface FieldReader
name
- the fully qualified field namenull
public List<String> getListValues(String name)
null
if the field does not exist or has no value defined.getListValues
in interface FieldReader
name
- the fully qualified field namenull
public String getFileSpec()
@Deprecated public void startElement(String tag, HashMap h)
startElement
in interface SimpleXMLDocHandler
tag
- the tag nameh
- the tag's attributespublic void startElement(String tag, Map<String,String> h)
startElement
in interface SimpleXMLDocHandler
tag
- the tag nameh
- the tag's attributespublic void endElement(String tag)
endElement
in interface SimpleXMLDocHandler
tag
- the tag namepublic void startDocument()
startDocument
in interface SimpleXMLDocHandler
public void endDocument()
endDocument
in interface SimpleXMLDocHandler
public void text(String str)
text
in interface SimpleXMLDocHandler
str
- the text element, probably a fragment.Copyright © 2020. All rights reserved.