Com.jFormTK JValue Class…

This Class is designed to hold a collection of properties derived from a com.jFormTK "Dynamic Reference" String.

Properties:

The derived properties are as follows:

1) String value

2) Char type
- If the "Dynamic Reference" is a JFormField

Then this field is the JFormField.type

Else this field is null, i.e. "".

3) int numericType

- 'int' code to indicate the type of processing performed to construct
the current 'value' parameter. Used by the Util.assignment method to
process a "Dynamic Reference" from a parsed com.jFormTK Assignment
Statement…

Numeric
Type
Processing Type…
0 Amount
1 Integer
2 Date
3 Float [no '$' prefix]
4 "<c>" [AppDB.AppCommonDB] Field
5 "<b>" Branch to Form as a function of a given 'Anchor'
6 "<u>" Utility Class Method Reference
7 "<AddressBook>" Address Book Reference
8 "Show" Request
9 "Print" Request
10 "<db> Application Data
11 JFormTKDB Data Base primitive, LAF or Variable Reference

4) JFormField JFormField
- If the source contained a "JFormField Reference" OR a JFormField
Reference was given in the Constructor

Then this is a JFormField "Reference'

Else this is a 'null'

5) int index
- If the 'numericType' is a 4, i.e. "<c>" Prefix
Then index is the AppCommonDB index for the derived value

- If the 'numericType' is a 7, i.e. "<ab>" Prefix

Then index is the JAddressBook index for the derived value.

"Dynamic Reference Format:

The "Reference" Format is as follows:

  1. "JFormField Reference"
    - A reference to a com.jFormTK 'JFormField' Field.
    See Dynamic Referencing Document.
  2. Prefix's

    The following table illustrates the JValue prefix's used to set the 'value' from com.jFormTK Data Bases:
Prefix Description…
<ab> Reference the com.jFormTK Address Book [JaddressBook]
Syntax 1: <ab>(name, field)
where
- name [String] is an existing JaddressBook
element name.
- field {String] is the JaddressBook Field where the
Value is to be fetched.
Example 1: "<ab>("Stephen J. Crowell", phone)"
- Set the 'value' from the "Phone" Field of the JAddressBook's
"Stephen J. Crowell element.

Syntax 2: <ab>((JFormField_ID), field)
where
- (JFormField_ID) is the JformField ID that holds
the jAddressBook element name to Reference.
- field is the JAddressBook Field where the
Value is to be fetched.
Example 2: "<ab>((DirFamily.spouse), Phone)"
Set the 'value' from the "Phone" Field of the
'jAddressBook' element name found in the
'spouse' JformField of the 'DirFamily' JFormForm.

Example 2: "<ab>((this), phone)"
Set the 'value' from the "Phone" Field of the
'JAddressBook' element name found in the "this"
'JFormField'. [See "this" Note Below].
<b> Branch to the given JFormField
Syntax: <b>JFormField_ID
where
- JFormField_ID is a JFormField ID to receive the
Focus.
NOTE:
- This com.jFormTK Feature may be used to cause LOOP
processing in an 'Assignment' Statement OR to conditionally
change the Application Focus in a Pre / Post Processor
Operation.
<c> Reference the com.jFormTK.AppCommonDB Data Base
Syntax: <c>elementName
where
- elementName is the name assigned to a AppCommonDB
Data Base Entry.
Example: "this=<c>Registered_Email"
- Assignment Statement to set the host JFormField value to
the current Value in the AppAppCommonDB "Registered_Email"
element. [See "this" Note Below].
<db> Reference the com.jFormTK.AppDB Data Base

Syntax: <db>

def: Reference to a 'JMessageTopic' item
Syntax: def:itemname
where 'itemName is the name assigned to an element of
the 'JMessageTopic' com.jFormTK instance.
Example: "def:Living Trust"
Set 'value' to the "Living Trust" definition in
the SLPlus JMessageTopic instance.
<print> Syntax: <print>report
where 'report' is one of the following:
- JFormFormID - Application Form ID to print…
- A "Formatted String"
- A Report Generator Item
NOTE: This operation can only be used with the com.jFormTK
Assignment Statement. Generally used to perform a
Conditional Print operation.
Example: "field4.setPostIf("this<=field3",
"this=field3*field3",
"<print>this");
If field4 less than or equal to field3
Then Set field4 = the square of field3
Else Print the current JFormForm Sub-Class Form
[see "this" Note Below].
<show> Syntax: <show>report
where 'report' is one of the following:
- AppTrace
- Registry
- A Report Generator Item
NOTE: This operation can only be used with the com.jFormTK
Assignment Statement. Generally used to perform a
Conditional Print operation.
Example: "field4.setPostIf("field4<=field3",
"field4=field3*field3",
"<show>"Unexpected Result"+LF
+"'field4' Value is greater than 'field3'!");
If field4 less than or equal to field3
Then Set field4 = the square of field3

Else Display a Util.message with the given message…

<u> Reference a com.jFormTK.Util Utility Method
Syntax: <u>method
where 'method' is the name of a com.jFormTK.Util
method in the 'utilMethods' List.
Example: "<c>term1=<u>getNumberOfWords(A B C D)"
Set the AppCommonDB 'term1' element to the number of words
in the String "A B C D" using the Util.getNumberOfWords
method.
<v> Set 'value' to the appended "Numeric" value.
- Used to identify constants in Assignment Statements

Syntax: <v>numericValue
where 'numericValue' is a String with only numeric
character.
Example: "pi=<v>3.14159265"
Set the JFormField 'pi' instance value to "3.14159265"
[see "this" Note Below].


Processing Notes:

a) If the com.jFormTK Kernel finds the "this" String where a JFormField ID is required, it changes the "this" annotation to the Field ID of the current JFormField instance. For example:

test1 = "<ab>((test1), Phone)";
AND
test1 = "<ab>((this), Phone)";
are equivalent…


b) If a "Dynamic Reference" source is determined to be a "JFormField Reference" but the perceived
JFormField ID does not match a know JFormField ID,
Then
a com.jFormTK Development Phase Soft Abort is performed…

c) If a "Dynamic Reference" source is not a "JFormField Reference" or an expected 'JValue' Prefix
    Then
       The 'JFormTKDB' is searched for a 'primitive', LAF, or Variable match…
       If a JFormTKDB match is found
       Then
          - the 'numericType' is set to 11
          - the 'value' is set to the given source with the appropriate "Primitive", "LAF Element",
            "Variabe" appendage.
       Else
          a com.jFormTK Development Phase Soft Abort is performed…
       End IF
    End IF