adapforms.form.parser
Class ParserContext

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

 class ParserContext
extends java.lang.Object

Holds context data used by the FormParser when parsing XML files. This includes current default values and loaded templates.

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

Constructor Summary
ParserContext()
           
 
Method Summary
 void addTemplate(java.lang.String id, FormElement prototype)
          Add a new template
 BooleanExpression getDefaultReadOnly()
           
 BooleanExpression getDefaultRelevant()
           
 BooleanExpression getDefaultRequired()
           
 java.lang.String[] getDefaultRolesRead()
           
 java.lang.String[] getDefaultRolesWrite()
           
 FormElement getTemplate(java.lang.String id)
           
 java.io.File getWorkingDirectory()
          Get the working directory.
 void setDefaultReadOnly(BooleanExpression readOnly)
           
 void setDefaultRelevant(BooleanExpression value)
           
 void setDefaultRequired(BooleanExpression required)
           
 void setDefaultRolesRead(java.lang.String[] rolesRead)
           
 void setDefaultRolesWrite(java.lang.String[] rolesWrite)
           
 void setWorkingDirectory(java.io.File dir)
          Set the folder to use as working directory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParserContext

ParserContext()
Method Detail

setWorkingDirectory

public void setWorkingDirectory(java.io.File dir)
Set the folder to use as working directory.

See Also:
getWorkingDirectory()

getWorkingDirectory

public java.io.File getWorkingDirectory()
Get the working directory. This acts as the base folder when loading include files etc, and is usually the folder from which the form was loaded.

If unknown, null is returned.


addTemplate

public void addTemplate(java.lang.String id,
                        FormElement prototype)
                 throws ParserException
Add a new template

Throws:
If - another template with the same id exists,
ParserException

getTemplate

public FormElement getTemplate(java.lang.String id)

getDefaultRequired

public BooleanExpression getDefaultRequired()

setDefaultRequired

public void setDefaultRequired(BooleanExpression required)

getDefaultReadOnly

public BooleanExpression getDefaultReadOnly()

setDefaultReadOnly

public void setDefaultReadOnly(BooleanExpression readOnly)

getDefaultRelevant

public BooleanExpression getDefaultRelevant()

setDefaultRelevant

public void setDefaultRelevant(BooleanExpression value)

getDefaultRolesRead

public java.lang.String[] getDefaultRolesRead()

setDefaultRolesRead

public void setDefaultRolesRead(java.lang.String[] rolesRead)

getDefaultRolesWrite

public java.lang.String[] getDefaultRolesWrite()

setDefaultRolesWrite

public void setDefaultRolesWrite(java.lang.String[] rolesWrite)