# Business Logic — FUW00116SF01DBean.loadModelData() [33 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.FUW00116SF.FUW00116SF01DBean` |
| Layer | View (Web Client Data Binding / Presentation Tier) |
| Module | `FUW00116SF` (Package: `eo.web.webview.FUW00116SF`) |

## 1. Role

### FUW00116SF01DBean.loadModelData()

This method serves as the **data loading dispatcher** for the `FUW00116SF` screen bean, implementing the X33V framework's `X33VDataTypeBeanInterface.loadModelData(String key, String subkey)` contract. In the K-Opticom web client architecture, this method is invoked by the presentation framework to **retrieve typed data values and their state metadata** for UI data binding, enabling screen fields to populate themselves from the bean's internal model during page rendering or post-back processing.

The method implements a **key-based routing pattern**: it examines the incoming `key` parameter (the item name / 項目名) and dispatches to one of two data domains — **"送信先メールアドレス" (Sender Email Address)** or **"メールアドレス設定フィールドコード" (Email Address Setting Field Code)** — based on the value of `key`. For each domain, it further branches on the `subkey` parameter, returning either the **data value** (via the `value` subkey) or the **state status** (via the `state` subkey). This two-level dispatch allows the framework to decouple field identity from data vs. metadata queries.

As a **shared utility method** called by many downstream screen beans across the FUW module suite (e.g., `FUW00912SFBean`, `FUW00926SFBean`, `FUW00959SFBean`, `FUW00964SFBean`), this method is a foundational building block for the email address management screen's data binding infrastructure. It does not perform any database or service component calls — all state is held in instance fields (`mlad_value`, `mlad_state`, `mlad_set_field_cd_value`, `mlad_set_field_cd_state`) and returned directly via getter delegation.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["loadModelData(key, subkey)"])
    NULL_CHECK{key or subkey
is null?}
    MAIL_KEY["key == 送信先メールアドレス"]
    MAIL_VAL["subkey == value"]
    MAIL_ST["subkey == state"]
    MAIL_RET_VAL["return getMlad_value()"]
    MAIL_RET_ST["return getMlad_state()"]
    FIELD_KEY["key == メールアドレス設定フィールドコード"]
    FIELD_VAL["subkey == value"]
    FIELD_ST["subkey == state"]
    FIELD_RET_VAL["return getMlad_set_field_cd_value()"]
    FIELD_RET_ST["return getMlad_set_field_cd_state()"]
    RETURN_NULL["return null"]
    END_NODE(["Return / Next"])

    START --> NULL_CHECK
    NULL_CHECK -->|"Yes"| RETURN_NULL
    RETURN_NULL --> END_NODE
    NULL_CHECK -->|"No"| MAIL_KEY
    MAIL_KEY -->|"Yes"| MAIL_VAL
    MAIL_KEY -->|"No"| FIELD_KEY
    MAIL_VAL -->|"Yes"| MAIL_RET_VAL
    MAIL_RET_VAL --> END_NODE
    MAIL_VAL -->|"No"| MAIL_ST
    MAIL_ST -->|"Yes"| MAIL_RET_ST
    MAIL_RET_ST --> END_NODE
    MAIL_ST -->|"No"| RETURN_NULL
    FIELD_KEY -->|"Yes"| FIELD_VAL
    FIELD_KEY -->|"No"| RETURN_NULL
    FIELD_VAL -->|"Yes"| FIELD_RET_VAL
    FIELD_RET_VAL --> END_NODE
    FIELD_VAL -->|"No"| FIELD_ST
    FIELD_ST -->|"Yes"| FIELD_RET_ST
    FIELD_RET_ST --> END_NODE
    FIELD_ST -->|"No"| RETURN_NULL
```

**Processing flow:**

1. **Null guard (L128–131):** If either `key` or `subkey` is `null`, the method immediately returns `null` — no further processing occurs. This prevents `NullPointerException` in downstream framework code.

2. **Branch: "送信先メールアドレス" (Sender Email Address) (L136–144):** When `key` equals the Japanese string `"送信先メールアドレス"`, the method dispatches based on `subkey`:
   - **subkey = "value"** (case-insensitive): Returns the email address data via `getMlad_value()`, which reads the `mlad_value` instance field.
   - **subkey = "state"** (case-insensitive): Returns the email address state metadata via `getMlad_state()`, which reads the `mlad_state` instance field.
   - **Any other subkey:** Falls through to the final `return null`.

3. **Branch: "メールアドレス設定フィールドコード" (Email Address Setting Field Code) (L148–154):** When `key` equals the Japanese string `"メールアドレス設定フィールドコード"`, the method similarly dispatches:
   - **subkey = "value" (case-insensitive):** Returns the field code value via `getMlad_set_field_cd_value()`, reading `mlad_set_field_cd_value`.
   - **subkey = "state" (case-insensitive):** Returns the field code state via `getMlad_set_field_cd_state()`, reading `mlad_set_field_cd_state`.
   - **Any other subkey:** Falls through to the final `return null`.

4. **Default fallback (L157):** For any unrecognized `key` value, or unrecognized `subkey` within a recognized `key`, the method returns `null`.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `key` | `String` | The item name (項目名) that identifies which data domain to access. Valid values are `"送信先メールアドレス"` (Sender Email Address) and `"メールアドレス設定フィールドコード"` (Email Address Setting Field Code). Determines which pair of instance fields (`mlad_value`/`mlad_state` vs. `mlad_set_field_cd_value`/`mlad_set_field_cd_state`) the method will query. |
| 2 | `subkey` | `String` | The sub-key (サブキー) that specifies whether to return the data value or the state metadata. Accepts `"value"` or `"state"` (case-insensitive comparison). When `"value"`, returns the actual field data; when `"state"`, returns the state status (typically set during data loading/validation). |

**Instance fields read by this method:**

| Field | Type | Description |
|-------|------|-------------|
| `mlad_value` | `String` | Sender email address data value (initialized to `""`) |
| `mlad_state` | `String` | Sender email address state metadata (e.g., validation/error status) |
| `mlad_set_field_cd_value` | `String` | Email address setting field code data value (initialized to `""`) |
| `mlad_set_field_cd_state` | `String` | Email address setting field code state metadata |

## 4. CRUD Operations / Called Services

### Pre-computed evidence from code analysis graph:

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `FUW00116SF01DBean.getMlad_set_field_cd_state` | FUW00116SF01DBean | - | Reads instance field `mlad_set_field_cd_state` (getter delegation) |
| R | `FUW00116SF01DBean.getMlad_set_field_cd_value` | FUW00116SF01DBean | - | Reads instance field `mlad_set_field_cd_value` (getter delegation) |
| R | `FUW00116SF01DBean.getMlad_state` | FUW00116SF01DBean | - | Reads instance field `mlad_state` (getter delegation) |
| R | `FUW00116SF01DBean.getMlad_value` | FUW00116SF01DBean | - | Reads instance field `mlad_value` (getter delegation) |

**Classification notes:**

- All four method calls are **Read (R)** operations — they are simple Java bean getter delegations that return instance field values. No database, service component, or external system interaction occurs.
- This method operates entirely in-memory, reading data that was previously loaded into the bean by a calling screen or data-loading routine (typically via `setMlad_*` setter methods or the `storeModelData` method).

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Screen: FUW00912SF | `FUW00912SFBean.loadModelData(key, subkey)` -> delegates to listed bean's `loadModelData(subkey)` | `getMlad_*` [R] in-memory fields |
| 2 | Screen: FUW00926SF | `FUW00926SFBean.loadModelData(key, subkey)` -> delegates to listed bean's `loadModelData(keyElement, subkey)` | `getMlad_*` [R] in-memory fields |
| 3 | Screen: FUW00959SF | `FUW00959SFBean.loadModelData(key, subkey)` -> delegates to listed bean's `loadModelData(keyElement, subkey)` | `getMlad_*` [R] in-memory fields |
| 4 | Screen: FUW00964SF | `FUW00964SFBean.loadModelData(key, subkey)` -> delegates to listed bean's `loadModelData(keyElement, subkey)` | `getMlad_*` [R] in-memory fields |
| 5 | Screen: FUW00927SF | `FUW00927SFBean.loadModelData(key, subkey)` -> delegates to listed bean's `loadModelData(subkey)` | `getMlad_*` [R] in-memory fields |
| 6 | Screen: FUW00901SF | `FUW00901SFBean.loadModelData(key, subkey)` -> delegates to listed bean's `loadModelData(keyElement, subkey)` | `getMlad_*` [R] in-memory fields |
| 7 | Screen: FUW00919SF | `FUW00919SFBean.loadModelData(key, subkey)` -> delegates to listed bean's `loadModelData(subkey)` | `getMlad_*` [R] in-memory fields |
| 8 | Screen: FUW00931SF | `FUW00931SFBean.loadModelData(key, subkey)` -> delegates to listed bean's `loadModelData(keyElement, subkey)` | `getMlad_*` [R] in-memory fields |

**Caller context:**

- This method is primarily called by the **X33V web framework** during screen rendering — the framework iterates over listed data types and invokes `loadModelData` to populate UI fields with their current values and states.
- The `storeModelData` method (L159–166 in the source) is also present in `FUW00116SF01DBean` and serves as the complementary setter, storing data into instance fields for later retrieval by `loadModelData`.
- The search across 30+ bean files shows this pattern is ubiquitous across the FUW module suite, confirming `loadModelData` as a standard data-binding contract in the X33V framework.

## 6. Per-Branch Detail Blocks

### Block 1 — IF (null guard) `(key == null || subkey == null)` (L128–131)

> Guard clause: returns null if either parameter is null to prevent downstream NullPointerException.

| # | Type | Code |
|---|------|------|
| 1 | IF | `if (key == null || subkey == null)` // Guard: reject null parameters |
| 2 | RETURN | `return null;` // Return null when key or subkey is null |

### Block 2 — Local Variable (L133)

> Computes the index of the first forward-slash character in `key` for potential future use (though currently unused in this method).

| # | Type | Code |
|---|------|------|
| 1 | SET | `int separaterPoint = key.indexOf("/");` // Find position of "/" in key |

### Block 3 — IF-ELSE-IF (key routing) `("送信先メールアドレス" / "メールアドレス設定フィールドコード")` (L136–157)

> The core routing logic: dispatches to the appropriate data domain based on the `key` parameter value.

#### Block 3.1 — IF `"送信先メールアドレス"` (Sender Email Address) (L136)

**Block 3.1 — [IF] `key.equals("送信先メールアドレス")` [key = "送信先メールアドレス" (Sender Email Address)] (L136)**

> When the key identifies the sender email address domain, branch into value or state based on subkey.

| # | Type | Code |
|---|------|------|
| 1 | IF | `if (key.equals("送信先メールアドレス"))` // Process per-item: data type is String for "Sender Email Address" |

##### Block 3.1.1 — IF (value subkey) (L137–139)

**Block 3.1.1 — [IF] `subkey.equalsIgnoreCase("value")` [subkey = "value"] (L137)**

> Returns the sender email address data value when subkey is "value".

| # | Type | Code |
|---|------|------|
| 1 | IF | `if (subkey.equalsIgnoreCase("value"))` // Case-insensitive comparison for subkey |
| 2 | CALL | `getMlad_value()` // Calls getter for `mlad_value` instance field |
| 3 | RETURN | `return getMlad_value();` // Returns the sender email address data |

##### Block 3.1.2 — ELSE-IF (state subkey) (L140–143)

**Block 3.1.2 — [ELSE-IF] `subkey.equalsIgnoreCase("state")` [subkey = "state"] (L140)**

> Returns the sender email address state metadata when subkey is "state".

| # | Type | Code |
|---|------|------|
| 1 | ELSE-IF | `else if (subkey.equalsIgnoreCase("state"))` // Case-insensitive comparison for subkey |
| 2 | CALL | `getMlad_state()` // Calls getter for `mlad_state` instance field |
| 3 | RETURN | `return getMlad_state();` // Returns the sender email address state |

##### Block 3.1.3 — ELSE FALLTHROUGH (L144)

**Block 3.1.3 — [ELSE] unmatched subkey (implicit) (L144)**

> When subkey is neither "value" nor "state" within the sender email address domain, fall through to the final null return.

| # | Type | Code |
|---|------|------|
| 1 | FALLTHROUGH | (implicit) // No else branch; falls through to L157 |

#### Block 3.2 — ELSE-IF `"メールアドレス設定フィールドコード"` (Email Address Setting Field Code) (L148)

**Block 3.2 — [ELSE-IF] `key.equals("メールアドレス設定フィールドコード")` [key = "メールアドレス設定フィールドコード" (Email Address Setting Field Code)] (L148)**

> When the key identifies the email address setting field code domain, branch into value or state based on subkey.

| # | Type | Code |
|---|------|------|
| 1 | ELSE-IF | `else if (key.equals("メールアドレス設定フィールドコード"))` // Process per-item: data type is String for "Email Address Setting Field Code" |

##### Block 3.2.1 — IF (value subkey) (L149–151)

**Block 3.2.1 — [IF] `subkey.equalsIgnoreCase("value")` [subkey = "value"] (L149)**

> Returns the field code value when subkey is "value".

| # | Type | Code |
|---|------|------|
| 1 | IF | `if (subkey.equalsIgnoreCase("value"))` // Case-insensitive comparison for subkey |
| 2 | CALL | `getMlad_set_field_cd_value()` // Calls getter for `mlad_set_field_cd_value` instance field |
| 3 | RETURN | `return getMlad_set_field_cd_value();` // Returns the field code data value |

##### Block 3.2.2 — ELSE-IF (state subkey) (L152–154)

**Block 3.2.2 — [ELSE-IF] `subkey.equalsIgnoreCase("state")` [subkey = "state"] (L152)**

> Returns the field code state metadata when subkey is "state".

| # | Type | Code |
|---|------|------|
| 1 | ELSE-IF | `else if (subkey.equalsIgnoreCase("state"))` // Case-insensitive comparison for subkey |
| 2 | CALL | `getMlad_set_field_cd_state()` // Calls getter for `mlad_set_field_cd_state` instance field |
| 3 | RETURN | `return getMlad_set_field_cd_state();` // Returns the field code state |

##### Block 3.2.3 — ELSE FALLTHROUGH (L155)

**Block 3.2.3 — [ELSE] unmatched subkey (implicit) (L155)**

> When subkey is neither "value" nor "state" within the field code domain, fall through to the final null return.

| # | Type | Code |
|---|------|------|
| 1 | FALLTHROUGH | (implicit) // No else branch; falls through to L157 |

#### Block 3.3 — Default Fallback (L157)

**Block 3.3 — [DEFAULT] unmatched key (implicit else) (L157)**

> For any key that doesn't match either recognized domain, or any unrecognized subkey, return null. The Japanese comment states "no matching property found, return null."

| # | Type | Code |
|---|------|------|
| 1 | ELSE | `return null;` // No matching property exists; return null |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `mlad` | Field prefix | Mail List Address Data — internal bean field prefix for email address-related data items in the X33V data type system |
| `mlad_value` | Field | Sender email address data — stores the actual email address string value |
| `mlad_state` | Field | Sender email address state — stores metadata about the email address (e.g., validation status, error state) |
| `mlad_set_field_cd` | Field prefix | Mail List Address Setting Field Code — bean field prefix for email address configuration field code items |
| `mlad_set_field_cd_value` | Field | Email address setting field code data — stores the configured field code value for email address settings |
| `mlad_set_field_cd_state` | Field | Email address setting field code state — stores metadata about the field code configuration state |
| `key` | Parameter | Item name (項目名) — the business identifier for a screen field, mapping to a specific data domain |
| `subkey` | Parameter | Sub-key (サブキー) — distinguishes between value (data) and state (metadata) for a given item |
| `"送信先メールアドレス"` | Constant string | Sender Email Address — the Japanese display name for the email address data domain (item ID: `mlad`) |
| `"メールアドレス設定フィールドコード"` | Constant string | Email Address Setting Field Code — the Japanese display name for the field code configuration domain (item ID: `mlad_set_field_cd`) |
| `X33V` | Acronym | Fujitsu Futurity X33V — the web application framework used by K-Opticom for building JavaServer Faces-based screens |
| `X33VDataTypeBeanInterface` | Interface | Framework interface that defines the `loadModelData(String key, String subkey)` contract for data type beans |
| `X33VListedBeanInterface` | Interface | Framework interface for beans that hold list-based (repeating) data items |
| `storeModelData` | Method | Complementary setter method that stores data into instance fields, counterpart to `loadModelData` |
| `FUW00116SF` | Module code | Screen module code — the K-Opticom screen module identifier for email address management functionality |
| `separaterPoint` | Field | Index of "/" in key — computed but unused; likely reserved for future hierarchical key parsing (e.g., "domain/subitem") |
