adapforms.form.parser
Class FormParser

java.lang.Object
  extended by adapforms.form.parser.FormParser

public class FormParser
extends java.lang.Object

Parses adaptive forms from XML files into Form instances.

Author:
Henrik Gammelmark, geemark@cs.au.dk

Field Summary
static java.lang.String NAMESPACE_ADAPFORMS
          XML namespace used for Adaptive Forms.
 
Constructor Summary
FormParser()
           
 
Method Summary
static Form parseForm(java.io.File xmlFile)
          Parse a form from a named local XML file.
static Form parseForm(java.io.InputStream stream)
          Parse a form from an XML input stream.
static Form parseForm(java.lang.String filename)
          Parse a form from a named file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAMESPACE_ADAPFORMS

public static final java.lang.String NAMESPACE_ADAPFORMS
XML namespace used for Adaptive Forms.

See Also:
Constant Field Values
Constructor Detail

FormParser

public FormParser()
Method Detail

parseForm

public static Form parseForm(java.lang.String filename)
                      throws ParserException,
                             InconsistentFormException
Parse a form from a named file. The file is primarily attempted resolved on the local filesystem, and secondarily by a call to Class.getResourceAsStream(String).

Parameters:
filename - Full or partial file name.
Throws:
ParserException - If the parsing fails for whatever reason
InconsistentFormException - If the form is correctly parsed, but it is invalid

parseForm

public static Form parseForm(java.io.File xmlFile)
                      throws ParserException,
                             InconsistentFormException
Parse a form from a named local XML file.

Throws:
ParserException - If the parsing fails for whatever reason
InconsistentFormException - If the form is correctly parsed, but it is invalid

parseForm

public static Form parseForm(java.io.InputStream stream)
                      throws ParserException,
                             InconsistentFormException
Parse a form from an XML input stream.

Throws:
ParserException - If the parsing fails for whatever reason
InconsistentFormException - If the form is correctly parsed, but it is invalid