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

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.FUW00116SF.FUW00116SF02DBean` |
| Layer | Webview (Data Bean / View Type Bean) |
| Module | `FUW00116SF` (Package: `eo.web.webview.FUW00116SF`) |

## 1. Role

### FUW00116SF02DBean.loadModelData()

This method is the data retrieval entry point for the `FUW00116SF02DBean` view-type bean, implementing the `X33VDataTypeBeanInterface.loadModelData()` contract. It functions as a **routing/dispatch utility** that maps a pair of string identifiers — a **key** (item name) and **subkey** (data type specifier) — to the corresponding business data owned by this bean.

The method handles a single data type: **"Custom Free-Form Replacement Text"** (`本文非定型置換文字`), which is a customer-specific free-text field used for replacing or substituting text content in customer-oriented mail correspondence (e.g., personalized message bodies in customer communication emails). This field allows operators to inject dynamic, free-form Japanese text into mail templates at runtime, enabling personalized customer communications.

The design pattern used is **conditional dispatch**: the method examines the `key` parameter to determine which data category the caller is requesting, and then examines the `subkey` parameter to determine whether to return the **text value** (`value`) or the **input validation state** (`state`). This two-level routing (key -> subkey) is a common pattern in the 33V data-type bean framework, allowing a single bean to expose multiple facets of its data model through a uniform interface.

This method serves as a **shared data accessor** — it is called by the parent `FUW00116SFBean` when iterating over a list of `cust_htk_moji_list` items, and is expected to be called by the view layer during page rendering (e.g., JSP binding) to retrieve the model data for data-binding components.

Branch summary:
- **Null guard**: If either `key` or `subkey` is null, returns `null` immediately.
- **Data type match**: If `key` equals `"本文非定型置換文字"` and `subkey` equals `"value"` (case-insensitive), delegates to `getText_htk_ckam_moji_value()` to return the actual text content.
- **State match**: If `key` equals `"本文非定型置換文字"` and `subkey` equals `"state"` (case-insensitive), delegates to `getText_htk_ckam_moji_state()` to return the validation/input state.
- **No match**: If `key` does not match or `subkey` does not match `"value"` / `"state"`, returns `null`.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["loadModelData key, subkey"])
    START --> CHECK_NULL["Check: key == null || subkey == null"]

    CHECK_NULL -- "true" --> RETURN_NULL["Return null"]
    CHECK_NULL -- "false" --> CHECK_KEY["Check: key equals
\"本文非定型置換文字\""]

    CHECK_KEY -- "false" --> RETURN_NULL2["Return null"]

    CHECK_KEY -- "true" --> CHECK_SUBKEY["Check: subkey
equalsIgnoreCase \"value\""]

    CHECK_SUBKEY -- "true" --> CALL_VALUE["Call getText_htk_ckam_moji_value()"]
    CALL_VALUE --> RETURN_VALUE["Return String value"]

    CHECK_SUBKEY -- "false" --> CHECK_STATE["Check: subkey
equalsIgnoreCase \"state\""]

    CHECK_STATE -- "true" --> CALL_STATE["Call getText_htk_ckam_moji_state()"]
    CALL_STATE --> RETURN_STATE["Return String state"]

    CHECK_STATE -- "false" --> RETURN_NULL3["Return null"]
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `key` | `String` | The **item name** (項目名) that identifies which data category the caller is requesting. In this bean, the only recognized key is `"本文非定型置換文字"` — representing the "Custom Free-Form Replacement Text" field, a customer-specific free-text area used in customer mail correspondence templates for personalized message substitution. |
| 2 | `subkey` | `String` | The **sub-key** (サブキー) that refines the request to a specific data facet of the identified item. Recognized values are `"value"` (returns the actual text content / 実際の文字列) and `"state"` (returns the validation state / 入力状態 — e.g., whether the field has pass/fail validation). The comparison is case-insensitive (`equalsIgnoreCase`), making the subkey lookup tolerant of different casing conventions. |

**External state / instance fields read**: None directly — this method delegates all state access to the getter methods `getText_htk_ckam_moji_value()` and `getText_htk_ckam_moji_state()`, which themselves access the bean's internal `text_htk_ckam_moji` field and its validation result field respectively.

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `FUW00116SF02DBean.getText_htk_ckam_moji_value` | FUW00116SF02DBean | - | Returns the String value of `text_htk_ckam_moji` — the custom free-form replacement text content |
| R | `FUW00116SF02DBean.getText_htk_ckam_moji_state` | FUW00116SF02DBean | - | Returns the validation state String for `text_htk_ckam_moji` — indicates whether input validation passed or failed |

**CRUD Classification**: Both called methods are **Read (R)** operations. They simply retrieve bean properties — the text value itself and its validation state indicator. No database or service component calls are made at this layer; the data was previously loaded into the bean by a service component during the screen's data-load phase.

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Screen: FUW00116SF | `FUW00116SFBean` → `cust_htk_moji_list_list[i].loadModelData(key, subkey)` | `getText_htk_ckam_moji_value [R] text_htk_ckam_moji` |
| 2 | Screen: FUW00116SF | `FUW00116SFBean` → `getJsflist_typelist_cust_htk_moji_list()` → `cust_htk_moji_list_list[i].loadModelData("お客様向けメール本文非定型文字列リスト", "value")` | `getText_htk_ckam_moji_value [R] text_htk_ckam_moji` |
| 3 | Screen: FUW00116SF | `FUW00116SFBean` (view-layer binding) → JSP data-binding via `X33VDataTypeBeanInterface` → `loadModelData(key, subkey)` | `getText_htk_ckam_moji_value [R] text_htk_ckam_moji` |
| 4 | Screen: FUW00116SF | `FUW00116SFBean` (view-layer binding) → JSP data-binding via `X33VDataTypeBeanInterface` → `loadModelData(key, subkey)` | `getText_htk_ckam_moji_state [R] text_htk_ckam_moji_err` |

**Caller details**:
- **Caller #1-2**: `FUW00116SFBean.java` iterates over the `cust_htk_moji_list_list` (a list of `X33VDataTypeBeanInterface` items where each item is an `FUW00116SF02DBean` instance). It calls `loadModelData()` to retrieve data for list-bound form elements like dropdowns and repeating sections.
- **Caller #3-4**: The view layer (JSP pages) accesses `FUW00116SF02DBean` instances through the `X33VDataTypeBeanInterface` polymorphism, calling `loadModelData()` to bind data to UI components such as text input fields.

## 6. Per-Branch Detail Blocks

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

> Null guard: If either parameter is null, the method returns null immediately without further processing. This prevents NullPointerException and follows the defensive programming convention of the 33V framework, where invalid parameters result in null rather than throwing exceptions.

| # | Type | Code |
|---|------|------|
| 1 | IF | `if (key == null || subkey == null)` // Null check for both parameters |
| 2 | RETURN | `return null;` // Return null if either parameter is null (防御的チェック: 引数null時はnullを返す) |

**Block 2** — [STATEMENT] `int separaterPoint = key.indexOf("/");` (L102)

> Computes the position of the first forward-slash (`/`) in the key. This variable is computed but **never used** in the current method — it appears to be dead code or a vestigial field from a previous design that may have supported slash-delimited hierarchical keys (e.g., `"category/subkey"`). It is retained for potential future use or backward compatibility.

| # | Type | Code |
|---|------|------|
| 1 | SET | `int separaterPoint = key.indexOf("/");` // Dead code — variable computed but never consumed |

**Block 3** — [IF] `(key.equals("本文非定型置換文字"))` (L104-105)

> Item-specific dispatch: checks whether the requested key matches `"本文非定型置換文字"` (Custom Free-Form Replacement Text). This is a hardcoded literal — the string represents a customer-oriented mail template free-text field used for personalized message content. The Japanese comment explains: "処理を items ごとかに入れる。データタイプがStringの項目"本文非定型置換文字"(項目ID: text_htk_ckam_moji)" — meaning "Insert processing per item. This is a String-type item 'Custom Free-Form Replacement Text' (item ID: text_htk_ckam_moji)".

| # | Type | Code |
|---|------|------|
| 1 | IF | `if (key.equals("本文非定型置換文字"))` // Matches the custom free-form replacement text data type |

**Block 3.1** — [IF] `(subkey.equalsIgnoreCase("value"))` (L105)

> Data facet dispatch for value retrieval. The `equalsIgnoreCase` call means both `"value"`, `"VALUE"`, and `"Value"` are accepted. This block delegates to `getText_htk_ckam_moji_value()` which returns the actual text content stored in the bean's `text_htk_ckam_moji` field. The Japanese comment says: "データタイプがStringの項目"本文非定型置換文字"(項目ID: text_htk_ckam_moji)" — confirming this is the String-typed custom replacement text field.

| # | Type | Code |
|---|------|------|
| 1 | IF | `if (subkey.equalsIgnoreCase("value"))` // Request the text value itself |
| 2 | CALL | `return getText_htk_ckam_moji_value();` // Delegate to getter — returns the custom text content |

**Block 3.2** — [IF] `(subkey.equalsIgnoreCase("state"))` (L107-108)

> Data facet dispatch for validation state retrieval. Case-insensitive matching for the `"state"` subkey. This block delegates to `getText_htk_ckam_moji_state()` which returns the validation state String for the `text_htk_ckam_moji` field — indicating whether the input has passed or failed its validation rules (e.g., character count limits, encoding checks). The Japanese comment: `subkeyが"state"の場合、ステータスを返す。` → "(When subkey is 'state', return the status.)"

| # | Type | Code |
|---|------|------|
| 1 | ELSE-IF | `else if (subkey.equalsIgnoreCase("state"))` // Request the input validation state |
| 2 | CALL | `return getText_htk_ckam_moji_state();` // Delegate to state getter — returns validation result |

**Block 4** — [ELSE / FALL-THROUGH] `(no matching condition)` (L112)

> Default return: when `key` does not match `"本文非定型置換文字"`, or when `key` matches but `subkey` is neither `"value"` nor `"state"`, the method returns `null`. The Japanese comment: `条件に一致するプロパティが存在しない場合は、nullを返す。` → "(If no property matches the condition, return null.)"

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return null;` // No matching data type or subkey — return null |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `本文非定型置換文字` | Japanese field name | Custom Free-Form Replacement Text — a customer-specific free-text field used for injecting dynamic, personalized text content into customer mail templates |
| `text_htk_ckam_moji` | Field | Text custom replacement character — the internal field name storing the actual free-form replacement text content |
| `text_htk_ckam_moji_err` | Field | Text custom replacement character error — the internal field storing the validation error state for the replacement text |
| `cust_htk_moji_list` | Field | Customer custom text list — the list identifier for customer-oriented mail custom replacement text items |
| `X33VDataTypeBeanInterface` | Interface | 33V View Data Type Bean Interface — the framework interface that all view-type data beans must implement, including `loadModelData()` and `listKoumokuIds()` |
| `X33VDataTypeList` | Class | 33V View Data Type List — a collection class holding items that implement `X33VDataTypeBeanInterface` |
| `loadModelData` | Method | Load Model Data — the standard 33V interface method for retrieving data by item key and subkey from a view-type bean |
| `key` | Parameter | Item name — identifies the data category/type being requested |
| `subkey` | Parameter | Sub-key — refines the request to a specific data facet (value, state, etc.) |
| `getText_htk_ckam_moji_value` | Method | Get text custom replacement character value — returns the String content of the custom replacement text field |
| `getText_htk_ckam_moji_state` | Method | Get text custom replacement character state — returns the validation state String for the custom replacement text field |
| HTK | Acronym | Custom / Replacement — abbreviates "hitai" (custom/personalized) and "kanji" (character/replace), used in field naming for custom text replacement features |
| CKAM | Acronym | Character / AM — abbreviates character data handling; appears in `ckam_moji` field names referring to character-based custom data |
| 33V | Acronym | Fujitsu's enterprise web application framework (33 View) — provides the data bean architecture, view-type interfaces, and screen flow engine |
| `FUW00116SF` | Module | Screen module code — the customer mail customization screen module handling customer-specific mail template and content management |
| SF | Suffix | Screen Function — suffix used in screen module naming convention indicating a screen-level functional module |
