de.mguennewig.pobjects.metadata
Class FormDecl

java.lang.Object
  extended by de.mguennewig.pobjects.metadata.Declaration
      extended by de.mguennewig.pobjects.metadata.FormDecl

public class FormDecl
extends Declaration

Declaration of a form.

Author:
Michael Günnewig
See Also:
SelectExpr

Field Summary
static int GENERATED_HTML_NAME
           
static int GENERATED_SWING_NAME
           
static int HTML_CLASS_NAME
           
static int INTERFACE_ALL
           
static int INTERFACE_HTML
           
static int INTERFACE_SWING
           
static int PARAMETER_PREFIX
           
static int SWING_CLASS_NAME
           
 
Fields inherited from class de.mguennewig.pobjects.metadata.Declaration
ARGUMENT_CONSTRUCTOR, CLASS_NAME, DESCRIPTOR, GENERATED_CLASS_NAME, POINTER_TYPE, SQL_ARG_COLON, SQL_ARG_DOLLAR, SQL_ARG_NONE, SQL_ARG_QUESTION_MARK
 
Constructor Summary
FormDecl(java.lang.String name, FormDecl baseForm, FormEntry[] entries)
          Creates a new form declaration for all supported interfaces.
FormDecl(java.lang.String name, int formInterface, FormDecl baseForm, FormEntry[] entries)
          Creates a new form declaration.
 
Method Summary
 FormDecl getBaseForm()
           
 FormEntry[] getEntries()
           
 FormEntry getEntry(int index)
          Return form entry for index.
 FormEntry getEntry(java.lang.String name)
          Return form entry with the given name.
 int getFormInterface()
           
 int getNumEntries()
          Returns number of entries of this form, inclusive all entries inherited from any base forms.
 java.lang.String name(int variant)
          Returns different names depending on variant for the code generator.
 
Methods inherited from class de.mguennewig.pobjects.metadata.Declaration
getDescription, getModule, getName, setDescription, setModule, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

INTERFACE_HTML

public static final int INTERFACE_HTML
See Also:
Constant Field Values

INTERFACE_SWING

public static final int INTERFACE_SWING
See Also:
Constant Field Values

INTERFACE_ALL

public static final int INTERFACE_ALL
See Also:
Constant Field Values

GENERATED_HTML_NAME

public static final int GENERATED_HTML_NAME
See Also:
Constant Field Values

GENERATED_SWING_NAME

public static final int GENERATED_SWING_NAME
See Also:
Constant Field Values

HTML_CLASS_NAME

public static final int HTML_CLASS_NAME
See Also:
Constant Field Values

SWING_CLASS_NAME

public static final int SWING_CLASS_NAME
See Also:
Constant Field Values

PARAMETER_PREFIX

public static final int PARAMETER_PREFIX
See Also:
Constant Field Values
Constructor Detail

FormDecl

public FormDecl(java.lang.String name,
                FormDecl baseForm,
                FormEntry[] entries)
Creates a new form declaration for all supported interfaces.

All supported interfaces means all of baseForm if given.


FormDecl

public FormDecl(java.lang.String name,
                int formInterface,
                FormDecl baseForm,
                FormEntry[] entries)
Creates a new form declaration.

Throws:
java.lang.IllegalArgumentException - if formInterface specifies more interfaces then the given baseForm.
Method Detail

getFormInterface

public final int getFormInterface()

getBaseForm

public final FormDecl getBaseForm()

getNumEntries

public final int getNumEntries()
Returns number of entries of this form, inclusive all entries inherited from any base forms.


getEntry

public final FormEntry getEntry(int index)
Return form entry for index. If the form has no base form, this is equivalent to getEntries()[index].


getEntry

public final FormEntry getEntry(java.lang.String name)
Return form entry with the given name.

See Also:
getEntry(int)

getEntries

public final FormEntry[] getEntries()

name

public java.lang.String name(int variant)
Returns different names depending on variant for the code generator.

Specified by:
name in class Declaration
Returns:
variant return value
Declaration.DESCRIPTOR form<Name>
Declaration.POINTER_TYPE <JavaPackage>.<Name>
Declaration.CLASS_NAME <Name>
Declaration.GENERATED_CLASS_NAME PClass<Name>
HTML_CLASS_NAME depends on getFormInterface()
GENERATED_HTML_NAME depends on getFormInterface()
SWING_CLASS_NAME depends on getFormInterface()
GENERATED_SWING_NAME depends on getFormInterface()
PARAMETER_PREFIX <name>