things.data.tabular
Class Module

java.lang.Object
  extended by things.data.tabular.Module

public abstract class Module
extends java.lang.Object

An abstract module reactor. A concrete module will implement a specific sheet. Each of the abstract methods helps define the sheet. All DECLARATIVE methods (upper case) are used in the abstract sections to define the sheet.

MODULE_Example() {

        // A sheet defines general attributes and one-time entries.
        void sheet()    {
                HEADER_TEMPLATE("/tmp/template_file");
                PARAMETER("TOKEN_XXXX", "Database", "Validator_X");
        }

        // A section is a repeatable unit.
        void section() {
                DECLARE_SECTION("SECTION_1");
        //                       section line       mod1          mod2
                DECLARE_LINE("GROUP","ITEM1",   REQUIRED, MANY);
                DECLARE_LINE("GROUP","ITEM2",   OPTIONAL, MANY);
                DECLARE_LINE("GROUP","ITEM3",   REQUIRED, MANY);
                DECLARE_LINE("GROUP","ITEM4",   OPTIONAL, MANY);
        }

        // Lines are repeatable units within each section.
        void lines() {
                //            section  line     entry,  default,             , modifyer  validator              
                DECLARE_ENTRY("GROUP", "GROUP", "Name", "Enter name here", UNIQUE,      "VALIDATE_SECTION_NAME");

                DECLARE_LINE("GROUP","VALIDATE_GROUP")
                DECLARE_ENTRY("GROUP","NAME", "VALIDATE_GROUP_NAME");
                DECLARE_ENTRY("GROUP","SELECTION_TYPE", "VALIDATE_SELECTION_TYPE");
        }

        // Validations specify validation steps for each line.
        void validations() {    
                VALIDATE_HELP("VALIDATE_GROUP_HEADER", "Title", "Text");
                VALIDATE_TEXT("VALIDATE_GROUP_NAME", "Title", "Text", 4, 39, "Error title", "Error text");
                VALIDATE_LIST("VALIDATE_SELECTION_TYPE", "Title", "Text", "ITEM1, ITEM2, ITEM3", false, "Error title", "Error text");           
        }
}
 

NOTE: This package was never completed and isn't used anywhere.

Version:
1.0

Version History

EPG - Initial - 10 NOV 04
 
Author:
Erich P. Gatejen

Constructor Summary
Module()
           
 
Method Summary
protected  void DECLARE_ENTRY(java.lang.String section, java.lang.String line, java.lang.String entry, int type, java.lang.String defaultEntry, int incidence, java.lang.String validator)
           
protected  void DECLARE_LINE(java.lang.String section, java.lang.String name, int necessity, int frequency)
           
protected  void DECLARE_SECTION(java.lang.String name)
           
protected  void DECLARE_VALIDATION(java.lang.String name, int type, java.lang.String title, java.lang.String text, java.lang.String value, java.lang.String min, java.lang.String max, int necessity, java.lang.String errorTitle, java.lang.String errorText)
           
protected  void HEADER_TEMPLATE(java.lang.String templateFile)
           
abstract  java.lang.String lines()
           
static java.lang.String normalize(java.lang.String in)
           
protected  void PARAMETER(java.lang.String name, java.lang.String templateToken, java.lang.String validator)
           
 void prepare()
           
abstract  java.lang.String section()
           
abstract  java.lang.String sheet()
           
abstract  java.lang.String validations()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Module

public Module()
Method Detail

sheet

public abstract java.lang.String sheet()
                                throws TabularException
Throws:
TabularException

section

public abstract java.lang.String section()
                                  throws TabularException
Throws:
TabularException

lines

public abstract java.lang.String lines()
                                throws TabularException
Throws:
TabularException

validations

public abstract java.lang.String validations()
                                      throws TabularException
Throws:
TabularException

HEADER_TEMPLATE

protected void HEADER_TEMPLATE(java.lang.String templateFile)
                        throws TabularException
Throws:
TabularException

PARAMETER

protected void PARAMETER(java.lang.String name,
                         java.lang.String templateToken,
                         java.lang.String validator)
                  throws TabularException
Throws:
TabularException

DECLARE_SECTION

protected void DECLARE_SECTION(java.lang.String name)
                        throws TabularException
Throws:
TabularException

DECLARE_LINE

protected void DECLARE_LINE(java.lang.String section,
                            java.lang.String name,
                            int necessity,
                            int frequency)
                     throws TabularException
Throws:
TabularException

DECLARE_ENTRY

protected void DECLARE_ENTRY(java.lang.String section,
                             java.lang.String line,
                             java.lang.String entry,
                             int type,
                             java.lang.String defaultEntry,
                             int incidence,
                             java.lang.String validator)
                      throws TabularException
Throws:
TabularException

DECLARE_VALIDATION

protected void DECLARE_VALIDATION(java.lang.String name,
                                  int type,
                                  java.lang.String title,
                                  java.lang.String text,
                                  java.lang.String value,
                                  java.lang.String min,
                                  java.lang.String max,
                                  int necessity,
                                  java.lang.String errorTitle,
                                  java.lang.String errorText)
                           throws java.lang.Throwable
Throws:
java.lang.Throwable

prepare

public void prepare()
             throws TabularException
Throws:
TabularException

normalize

public static java.lang.String normalize(java.lang.String in)


Things.