Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.lowagie.text.pdf
Class XfdfReader

    java.lang.Object
      com.lowagie.text.pdf.XfdfReader

All Implemented Interfaces:
  SimpleXMLDocHandler

    public class XfdfReader

extends Object
implements SimpleXMLDocHandler

Reads a XFDF.

Author:
  Leonard Rosenthol (leonardr@pdfsages.com)

Field Summary
`private Stack` | `fieldNames`
`(package private) HashMap` | `fields`
`private Stack` | `fieldValues`
`(package private) String` | `fileSpec`
`private boolean` | `foundRoot`

Constructor Summary
`XfdfReader(byte[] xfdfIn)` Reads an XFDF form.
`XfdfReader(String filename)` Reads an XFDF form.

Method Summary
`void` | `endDocument()` Called after the document is parsed.
`void` | `endElement(String tag)` Called when an end tag is found.
`String` | `getField(String name)` Gets the field value.
`HashMap` | `getFields()` Gets all the fields.
`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.
`void` | `startDocument()` Called when the document starts to be parsed.
`void` | `startElement(String tag, HashMap h)` Called when a start tag is found.
`void` | `text(String str)` Called when a text element is found.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### foundRoot

    private boolean foundRoot

### fieldNames

    private Stack fieldNames

### fieldValues

    private Stack fieldValues

### fields

    HashMap fields

### fileSpec

    String fileSpec

Constructor Detail

### XfdfReader

    public XfdfReader(String filename)
               throws IOException

  Reads an XFDF form.

  Parameters:
    `filename` - the file name of the form
  Throws:
    `IOException` - on error

### XfdfReader

    public XfdfReader(byte[] xfdfIn)
               throws IOException

  Reads an XFDF form.

  Parameters:
    `xfdfIn` - the byte array with the form
  Throws:
    `IOException` - on error

Method Detail

### getFields

    public HashMap getFields()

  Gets all the fields. The map is keyed by the fully qualified field name and the value is a merged `PdfDictionary` with the field content.

  Returns:
    all the fields

### getField

    public String getField(String name)

  Gets the field value.

  Parameters:
    `name` - the fully qualified field name
  Returns:
    the field's value

### getFieldValue

    public String getFieldValue(String name)

  Gets the field value or `null` if the field does not exist or has no value defined.

  Parameters:
    `name` - the fully qualified field name
  Returns:
    the field value or `null`

### getFileSpec

    public String getFileSpec()

  Gets the PDF file specification contained in the FDF.

  Returns:
    the PDF file specification contained in the FDF

### startElement

    public void startElement(String tag,
                             HashMap h)

  Called when a start tag is found.

  Specified by:
    `startElement` in interface `SimpleXMLDocHandler`
  Parameters:
    `tag` - the tag name
    `h` - the tag's attributes

### endElement

    public void endElement(String tag)

  Called when an end tag is found.

  Specified by:
    `endElement` in interface `SimpleXMLDocHandler`
  Parameters:
    `tag` - the tag name

### startDocument

    public void startDocument()

  Called when the document starts to be parsed.

  Specified by:
    `startDocument` in interface `SimpleXMLDocHandler`

### endDocument

    public void endDocument()

  Called after the document is parsed.

  Specified by:
    `endDocument` in interface `SimpleXMLDocHandler`

### text

    public void text(String str)

  Called when a text element is found.

  Specified by:
    `text` in interface `SimpleXMLDocHandler`
  Parameters:
    `str` - the text element, probably a fragment.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD