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

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.FUW00156SF.FUW00156SF03DBean` |
| Layer | Web View / Data Bean (View layer, part of the X33 framework data type bean) |
| Module | `FUW00156SF` (Package: `eo.web.webview.FUW00156SF`) |

## 1. Role

### FUW00156SF03DBean.loadModelData()

This method implements the `X33VDataTypeBeanInterface.loadModelData()` contract for the **Customer Mail Sender List** (`お客様向けメール送信先リスト`) data type bean within the FUW00156SF web screen module. It acts as a **key-based routing dispatch** that resolves which piece of model data to return based on a composite `key`/`subkey` identifier pair.

The method handles **two data types**, each of which are String-typed form fields in the web view: the **Sender Email Address** (`送信先メールアドレス`) and the **Email Address Setting Field Code** (`メールアドレス設定フィールドコード`). For each data type, it further dispatches by `subkey` to either the **value** (`value`) — the actual data payload — or the **validation state** (`state`) — the field-level validation status string.

This is a **shared utility dispatcher** within the X33 framework pattern: the parent screen bean (`FUW00156SFBean`) creates instances of `FUW00156SF03DBean` as sub-items in the customer mail sender list (item ID: `cust_mlad_list`). The framework calls `loadModelData()` on each instance to populate the view model during page rendering or postback processing. It has **no database or service component calls** — it purely reads local instance state fields and returns them as `Object`.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["loadModelData key, subkey"])
    NULL_CHECK{key == null or<br/>subkey == null}
    SEPARATE["int separaterPoint = key.indexOf"]

    MKEY1{key equals<br/>送信先メールアドレス<br/>Sender email address}
    MVAL{subkey equals<br/>value}
    MSTATE{subkey equals<br/>state}

    FKEY1{key equals<br/>メールアドレス設定フィールドコード<br/>Email addr set field code}
    FVAL{subkey equals<br/>value}
    FSTATE{subkey equals<br/>state}

    RETURN_NULL["return null"]

    START --> NULL_CHECK
    NULL_CHECK -->|true| RETURN_NULL
    NULL_CHECK -->|false| SEPARATE

    SEPARATE --> MKEY1
    MKEY1 -->|true| MVAL
    MKEY1 -->|false| FKEY1

    MVAL -->|true| MVAL_RET["return getMlad_value"]
    MVAL -->|false| MSTATE
    MSTATE -->|true| MSTATE_RET["return getMlad_state"]
    MSTATE -->|false| RETURN_NULL

    FKEY1 -->|true| FVAL
    FKEY1 -->|false| RETURN_NULL

    FVAL -->|true| FVAL_RET["return getMlad_set_field_cd_value"]
    FVAL -->|false| FSTATE
    FSTATE -->|true| FSTATE_RET["return getMlad_set_field_cd_state"]
    FSTATE -->|false| RETURN_NULL

    MVAL_RET --> END(["End"])
    MSTATE_RET --> END
    FVAL_RET --> END
    FSTATE_RET --> END
    RETURN_NULL --> END
```

**CRITICAL — Constant Resolution:**

| Constant in Code | Actual Value | Business Meaning |
|-----------------|-------------|------------------|
| `"送信先メールアドレス"` | `"送信先メールアドレス"` | Sender email address — the field for entering a customer-facing mail recipient address |
| `"メールアドレス設定フィールドコード"` | `"メールアドレス設定フィールドコード"` | Email address setting field code — the field code identifier for mail address configuration |
| `"value"` | `"value"` | Subkey requesting the actual data value |
| `"state"` | `"state"` | Subkey requesting the validation state string |

Note: The `separaterPoint` variable (line 133) is computed but never used in this method. It may be vestigial or reserved for future key-path routing (e.g., `"key/subkey"` format).

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `key` | `String` | The item name (項目名) that identifies which data type this call is targeting. Valid values are `"送信先メールアドレス"` (sender email address data type) or `"メールアドレス設定フィールドコード"` (email address setting field code data type). Controls which branch of the dispatch logic is taken. |
| 2 | `subkey` | `String` | The sub-key that specifies which aspect of the data to retrieve. Valid values are `"value"` (the actual data payload) or `"state"` (the validation state string). Case-insensitive comparison is used (`equalsIgnoreCase`). |

**Instance fields read by this method:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `mlad_value` | `String` | The sender email address value — stores the actual email address string for the customer mail sender list item. Default: `""` |
| `mlad_state` | `String` | The sender email address validation state — stores the validation status (e.g., error message, valid/invalid flag) for the sender email field. Default: `""` |
| `mlad_set_field_cd_value` | `String` | The email address setting field code value — stores the actual field code string used for mail address configuration. Default: `""` |
| `mlad_set_field_cd_state` | `String` | The email address setting field code validation state — stores the validation status for the field code configuration. Default: `""` |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `FUW00156SF03DBean.getMlad_value` | FUW00156SF03DBean | - | Calls `getMlad_value()` — returns `mlad_value` instance field (sender email address value) |
| R | `FUW00156SF03DBean.getMlad_state` | FUW00156SF03DBean | - | Calls `getMlad_state()` — returns `mlad_state` instance field (sender email validation state) |
| R | `FUW00156SF03DBean.getMlad_set_field_cd_value` | FUW00156SF03DBean | - | Calls `getMlad_set_field_cd_value()` — returns `mlad_set_field_cd_value` instance field (field code value) |
| R | `FUW00156SF03DBean.getMlad_set_field_cd_state` | FUW00156SF03DBean | - | Calls `getMlad_set_field_cd_state()` — returns `mlad_set_field_cd_state` instance field (field code validation state) |

**Classification:** All four called methods are **local getter methods** (Read operations) within the same bean class. They access **no database tables** or external services — they simply return local instance fields populated during earlier lifecycle phases of the bean (e.g., during `setModelData` calls from the X33 framework).

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Screen: FUW00156SFBean | `FUW00156SFBean` creates `FUW00156SF03DBean` instances → X33 framework calls `loadModelData(key, subkey)` on each bean in the customer mail sender list (`cust_mlad_list`) | `getMlad_value [R] -`, `getMlad_state [R] -`, `getMlad_set_field_cd_value [R] -`, `getMlad_set_field_cd_state [R] -` |

**Notes:**
- The method is invoked by the X33 framework's data binding mechanism. The parent screen bean (`FUW00156SFBean`) registers `FUW00156SF03DBean` as the data type bean class for the `cust_mlad_list` (customer mail sender list) view item.
- When the framework needs to load data for rendering or postback handling, it calls `loadModelData()` with the appropriate `key` and `subkey` parameters on each list item's `FUW00156SF03DBean` instance.
- No other direct callers were found in the codebase for the FUW00156SF module.

## 6. Per-Branch Detail Blocks

### Block 1 — IF (null check) (L127)

Null guard: returns `null` if either parameter is null, preventing downstream `NullPointerException` on `key.equals()` comparison.

> key,subkeyがnullの場合、nullを返す (If key or subkey is null, return null)

| # | Type | Code |
|---|------|------|
| 1 | IF | `if (key == null || subkey == null)` |
| 2 | RETURN | `return null;` |

### Block 2 — ASSIGN (separaterPoint index) (L133)

Computes the position of the first `/` character in `key`. This variable is computed but never used — it appears to be reserved for future key-path routing support.

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

### Block 3 — IF-ELSE-IF (key dispatch — Sender Email Address) (L136)

Processes the sender email address data type.

> データタイプがStringの項目"送信先メールアドレス"(項目ID:mlad) (Data type is the String field "Sender email address" (Item ID: mlad))

| # | Type | Code |
|---|------|------|
| 1 | IF | `if (key.equals("送信先メールアドレス"))` |

#### Block 3.1 — IF (subkey == "value") (L137)

Returns the sender email address value from the local instance field.

| # | Type | Code |
|---|------|------|
| 1 | IF | `if (subkey.equalsIgnoreCase("value"))` |
| 2 | CALL | `return getMlad_value();` |

#### Block 3.2 — ELSE-IF (subkey == "state") (L140)

Returns the sender email address validation state.

> subkeyが"state"の場合、ステータスを返す。 (If subkey is "state", return the status.)

| # | Type | Code |
|---|------|------|
| 1 | ELSE-IF | `else if (subkey.equalsIgnoreCase("state"))` |
| 2 | CALL | `return getMlad_state();` |

#### Block 3.3 — ELSE-ELSE (implicit fallthrough) (L143)

If `key` matches sender email but `subkey` is neither `"value"` nor `"state"`, the method falls through to the final `return null;`.

### Block 4 — ELSE-IF (key dispatch — Email Address Setting Field Code) (L146)

Processes the email address setting field code data type.

> データタイプがStringの項目"メールアドレス設定フィールドコード"(項目ID:mlad_set_field_cd) (Data type is the String field "Email address setting field code" (Item ID: mlad_set_field_cd))

| # | Type | Code |
|---|------|------|
| 1 | ELSE-IF | `else if (key.equals("メールアドレス設定フィールドコード"))` |

#### Block 4.1 — IF (subkey == "value") (L147)

Returns the field code value from the local instance field.

| # | Type | Code |
|---|------|------|
| 1 | IF | `if (subkey.equalsIgnoreCase("value"))` |
| 2 | CALL | `return getMlad_set_field_cd_value();` |

#### Block 4.2 — ELSE-IF (subkey == "state") (L150)

Returns the field code validation state.

> subkeyが"state"の場合、ステータスを返す。 (If subkey is "state", return the status.)

| # | Type | Code |
|---|------|------|
| 1 | ELSE-IF | `else if (subkey.equalsIgnoreCase("state"))` |
| 2 | CALL | `return getMlad_set_field_cd_state();` |

#### Block 4.3 — ELSE-ELSE (implicit fallthrough) (L153)

If `key` matches field code but `subkey` is neither `"value"` nor `"state"`, falls through to the final `return null;`.

### Block 5 — ELSE (no matching key) (L156)

Returns `null` when no matching key is found.

> 条件に合致するプロパティが存在しない場合は、nullを返す。 (If no matching property exists, return null.)

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return null;` |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `mlad` | Field | Mail LADder — internal field naming prefix for the sender email address data type. Derived from the Japanese "メール" (mail) and "ラダー" (ladder/layer). |
| `mlad_value` | Field | Sender email address value — the actual email address string stored for a customer mail sender list item. |
| `mlad_state` | Field | Sender email address validation state — the validation/error status string for the sender email address field. |
| `mlad_set_field_cd` | Field | Mail LADder Set Field Code — the field code identifier for configuring email address settings in the customer mail form. |
| `mlad_set_field_cd_value` | Field | Email address setting field code value — the actual field code string for mail configuration. |
| `mlad_set_field_cd_state` | Field | Email address setting field code validation state — the validation status for the field code configuration. |
| `送信先メールアドレス` | Field (Japanese) | Sender email address — the recipient email address field in customer-facing mail forms. |
| `メールアドレス設定フィールドコード` | Field (Japanese) | Email address setting field code — the configuration field code that identifies which email address setting is being referenced. |
| `loadModelData` | Method | X33 framework data loading method — part of the `X33VDataTypeBeanInterface` contract. Called by the framework to retrieve data for a specific item/subkey from a data type bean. |
| `X33VDataTypeBeanInterface` | Interface | Fujitsu Futurity X33 framework interface — defines the contract for data type beans that participate in the view data binding model. |
| `cust_mlad_list` | Field (Item ID) | Customer Mail LADder List — the view item identifier for the customer-facing mail sender list in the web screen. |
| `FUW00156SF` | Module | Screen module code — the web screen module handling customer mail operations (likely "Form Utility Web 00156 Screen Function"). |
| `subkey` | Parameter | Sub-key — a secondary identifier used to select which aspect of data to load (e.g., `"value"` for data, `"state"` for validation state). |
| X33 | Acronym | Fujitsu Futurity Web X33 — the proprietary enterprise web application framework used for the K-Opticom customer portal. |
