# Business Logic — FUW00114SF02DBean.loadModelData() [23 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.FUW00114SF.FUW00114SF02DBean` |
| Layer | Web View Bean / Data Type Bean (Web Layer — X33 Framework) |
| Module | `FUW00114SF` (Package: `eo.web.webview.FUW00114SF`) |

## 1. Role

### FUW00114SF02DBean.loadModelData()

This method serves as a **key-based data retrieval dispatcher** for the `FUW00114SF02DBean` data type bean, which is part of the K-Opticom web application's X33 Framework data binding system. In business terms, it provides a unified, map-style interface for loading typed view data — specifically, the "Main Text Non-Structured Placeholder Character" (本文非定型置換文字), which represents **custom free-form text content used in customer-facing mail correspondence**. The method implements a **dispatch/routing pattern**: it accepts a `key` (item identifier) and `subkey` (data field specifier), validates both parameters, and routes the request to the appropriate getter method based on the subkey value. This design follows the X33 framework convention where data type beans expose a `loadModelData` entry point so that the framework can programmatically request specific pieces of data by key/subkey during page render, serialization, or state restoration. When the incoming key does not match the expected item or the subkey does not resolve to a known field ("value" or "state"), the method safely returns `null`, making it tolerant of unknown or malformed lookups. The method has no conditional branches based on service type constants — it operates as a straightforward routing gateway over the bean's own fields.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["loadModelData key, subkey"])
    CHECK_NULL{"key or subkey<br/>is null?"}
    KEY_MATCH{"key equals<br/>本文非定型置換文字?"}
    SUBKEY_VALUE{"subkey equals<br/>value (case-insensitive)?"}
    SUBKEY_STATE{"subkey equals<br/>state (case-insensitive)?"}
    RETURN_NULL_1["Return null"]
    RETURN_VALUE["Return getText_htk_ckam_moji_value"]
    RETURN_STATE["Return getText_htk_ckam_moji_state"]
    RETURN_NULL_2["Return null"]
    END_NODE(["End"])

    START --> CHECK_NULL
    CHECK_NULL -->|Yes| RETURN_NULL_1
    CHECK_NULL -->|No| KEY_MATCH
    KEY_MATCH -->|No| RETURN_NULL_2
    KEY_MATCH -->|Yes| SUBKEY_VALUE
    SUBKEY_VALUE -->|Yes| RETURN_VALUE
    SUBKEY_VALUE -->|No| SUBKEY_STATE
    SUBKEY_STATE -->|Yes| RETURN_STATE
    SUBKEY_STATE -->|No| RETURN_NULL_2
    RETURN_NULL_1 --> END_NODE
    RETURN_VALUE --> END_NODE
    RETURN_STATE --> END_NODE
    RETURN_NULL_2 --> END_NODE
```

**Branch summary:**

| Branch | Condition | Outcome |
|--------|-----------|---------|
| Null-guard | `key == null` OR `subkey == null` | Returns `null` early (defensive guard) |
| Key mismatch | `key` != `"本文非定型置換文字"` | Returns `null` — no matching item |
| Subkey = "value" | `subkey.equalsIgnoreCase("value")` | Returns the text value via `getText_htk_ckam_moji_value()` |
| Subkey = "state" | `subkey.equalsIgnoreCase("state")` | Returns the text state via `getText_htk_ckam_moji_state()` |
| Unknown subkey | Subkey not "value" or "state" | Returns `null` — unrecognized field |

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `key` | `String` | **Item name** (項目名) — the business identifier for the data type bean item being queried. In this method's scope, it must equal `"本文非定型置換文字"` (Main Text Non-Structured Placeholder Character), which represents a customer-facing mail template's free-text body field. This key identifies the specific data item within the X33 data binding framework. |
| 2 | `subkey` | `String` | **Sub-key** (サブキー) — a secondary identifier that disambiguates which facet of the data item to retrieve. Valid values are `"value"` (returns the actual text content) or `"state"` (returns the metadata/state of the text field). The comparison is case-insensitive, allowing flexible invocation. |

**Instance fields read by this method:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `text_htk_ckam_moji_value` | `String` | The actual text content of the main non-structured placeholder character field. Initialized to `""` (empty string) by default. |
| `text_htk_ckam_moji_state` | `String` | The state/metadata of the main non-structured placeholder character field. Used to track whether the field has been modified, is required, etc. |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `getText_htk_ckam_moji_value` | FUW00114SF02DBean | - (in-memory field) | Returns the `text_htk_ckam_moji_value` field (a `protected String`). This is a simple field getter — no database or service call involved. |
| R | `getText_htk_ckam_moji_state` | FUW00114SF02DBean | - (in-memory field) | Returns the `text_htk_ckam_moji_state` field (a `protected String`). This is a simple field getter — no database or service call involved. |

This method performs **no external service calls, no database access, and no create/update/delete operations**. It is a pure in-memory data routing method that delegates to its own getter methods. The data it returns originates from the bean's own fields, which are populated by the X33 framework during page load or by prior setter calls from the owning screen bean (`FUW00114SFBean`).

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Frame: X33 Framework getBean dispatch | `FUW00114SFBean.getBean(key)` -> `new FUW00114SF02DBean()` -> (framework invokes `loadModelData`) | In-memory field read (`text_htk_ckam_moji_value`, `text_htk_ckam_moji_state`) |
| 2 | Screen: FUW00114SF (Customer Mail Correspondence) | `FUW00114SFBean` (Data Type Bean List initialization) -> framework dispatch -> `FUW00114SF02DBean.loadModelData` | In-memory field read |

**Notes on callers:**
- The `FUW00114SFBean.getBean(String key)` method instantiates `FUW00114SF02DBean` when the key matches `"お客様向けメール本文非定型文字リスト"` (Customer-facing Mail Main Non-Structured Text List). The X33 framework then uses `loadModelData` to retrieve data by key/subkey from the bean instance.
- `loadModelData` itself has **no direct callers** in the codebase — it is called indirectly through the X33 framework's data binding mechanism. It is an entry point for framework-side dispatch, not a method invoked directly from business logic code.
- There are no CBS (Common Business Service) or SC (Service Component) callers for this method.

## 6. Per-Branch Detail Blocks

**Block 1** — [IF] `(key == null || subkey == null)` (L108)

> Null-guard: If either the item name (`key`) or sub-key (`subkey`) is null, return null immediately. This prevents NullPointerException on subsequent operations.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `key.indexOf("/")` — computes separator position (stored in local variable, result unused in this branch; may be a vestigial calculation) [-> unused local `separaterPoint`] |
| 2 | RETURN | `return null;` // Returns null when key or subkey is null |

**Block 2** — [IF] `(key.equals("本文非定型置換文字"))` (L113)

> Key match block: Checks whether the incoming key corresponds to the "Main Text Non-Structured Placeholder Character" item. This is the primary business filter — only data for this specific mail template text field is served through this method.

**Block 2.1** — [IF] `(subkey.equalsIgnoreCase("value"))` (L114)

> Retrieves the actual text content of the placeholder character field. The `value` subkey maps to the business data — the free-form text that appears in customer correspondence.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `getText_htk_ckam_moji_value()` [R: returns `text_htk_ckam_moji_value` field] |

**Block 2.2** — [ELSE-IF] `(subkey.equalsIgnoreCase("state"))` (L116)

> Retrieves the state/metadata of the placeholder character field. When the subkey is `"state"`, the method returns the state flag (スates) instead of the text value. This state is used to track field status (e.g., modified, required, hidden). //subkeyが"state"の場合、ステータスを返す。

| # | Type | Code |
|---|------|------|
| 1 | CALL | `getText_htk_ckam_moji_state()` [R: returns `text_htk_ckam_moji_state` field] |

**Block 2.3** — [ELSE] (implicit, L119)

> When the key matches but the subkey is neither "value" nor "state", fall through to the end of the method.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return null;` // No matching property found for this key/subkey combination |

**Block 3** — [EXPLICIT FALL-THROUGH RETURN] (L119)

> Default return: if the key does not match `"本文非定型置換文字"`, return null. This covers all unrecognized item names. //条件に合致するプロパティが存在しない場合は、nullを返す。

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return null;` // No property matches the given key |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `text_htk_ckam_moji_value` | Field | Main text non-structured placeholder character value — the actual free-form text content used in customer-facing mail correspondence |
| `text_htk_ckam_moji_state` | Field | Main text non-structured placeholder character state — metadata tracking the field's status (e.g., whether it is modified, required, or in a specific UI state) |
| `text_htk_ckam_moji_update` | Field | Main text non-structured placeholder character update flag — tracks whether this field has been updated since last load/set |
| 本文非定型置換文字 (Honbun Teitei Chioka Moji) | Field Name | Main Text Non-Structured Placeholder Character — a free-form text area in mail templates where variable/custom content can be inserted; "非定型" means non-structured/free-form, "置換文字" means placeholder character |
| 項目名 (Koumoku-me) | Field Name | Item name — the business identifier for a data item in the X33 data binding framework |
| サブキー (Sabu-kii) | Field Name | Sub-key — a secondary identifier used to disambiguate which facet of a data item to retrieve |
| X33 Framework | Technology | Fujitsu Futurity X33 — a web application framework providing data binding, view beans, and page lifecycle management for K-Opticom's web portal |
| Data Type Bean | Pattern | A bean class implementing `X33VDataTypeBeanInterface` that encapsulates typed data for a single UI element or data row; instances can be created per-item in a list |
| FUW00114SF | Module | Customer Mail Correspondence screen module — handles creation and management of mail correspondence sent to customers |
| スates (State) | Field Name | (From comment: ステータス) — the status/metadata of a data field, used by the framework for validation and UI state management |
