# Business Logic — FUW00114SF03DBean.storeModelData() [31 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.FUW00114SF.FUW00114SF03DBean` |
| Layer | Data Bean / View Model (Web Client presentation-layer data carrier) |
| Module | `FUW00114SF` (Package: `eo.web.webview.FUW00114SF`) |

## 1. Role

### FUW00114SF03DBean.storeModelData()

This method is the central model-data dispatching mechanism for the `FUW00114SF03DBean` data bean, which serves as a typed data carrier for customer-facing mail detail items (項目ID: `cust_mail_dtl_cd_list`) in the K-Opticom telecom service ordering system. Its business role is to accept arbitrary key-subkey-value tuples and route incoming data to the appropriate typed field setter — effectively functioning as a polymorphic data-binding bridge between the generic X33V data-view framework and the bean's strongly-typed fields. It handles two business data types: "Mail Detail Code" (メール明細コード), which represents the classification code for customer mail notification items, and "Custom Replacement Text in Body" (明細本文非定型置換文字), which represents dynamic placeholder text that can be inserted into service detail letters. The method uses a simple key-subkey matching pattern (the routing/dispatch design pattern) to direct incoming data, where `subkey` values `"value"` and `"state"` control whether the incoming data is stored as the field's value or its display/edit state flag. The `isSetAsString` parameter is accepted for API compatibility but is unused in this implementation, suggesting it exists to satisfy a common interface signature shared across multiple data bean implementations.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["storeModelData key, subkey, in_value, isSetAsString"])
    CHECK_NULL["key == null check"]
    RETURN_NULL(["Return early / exit"])
    COMPUTE_SEP["int separaterPoint = key.indexOf('/')"]
    CHECK_MAIL{key equals 'メール明細コード'?}
    CHECK_SUB_VALUE1{subkey equalsIgnoreCase 'value'?}
    SET_MAIL_VALUE["setMail_dtl_cd_value((String)in_value)"]
    CHECK_SUB_STATE1{subkey equalsIgnoreCase 'state'?}
    SET_MAIL_STATE["setMail_dtl_cd_state((String)in_value)"]
    CHECK_DETAIL{key equals '明細本文非定型置換文字'?}
    CHECK_SUB_VALUE2{subkey equalsIgnoreCase 'value'?}
    SET_DETAIL_VALUE["setDtl_text_htk_ckam_moji_value((String)in_value)"]
    CHECK_SUB_STATE2{subkey equalsIgnoreCase 'state'?}
    SET_DETAIL_STATE["setDtl_text_htk_ckam_moji_state((String)in_value)"]
    END_METHOD(["Return / Next"])

    START --> CHECK_NULL
    CHECK_NULL -->|true| RETURN_NULL
    CHECK_NULL -->|false| COMPUTE_SEP
    COMPUTE_SEP --> CHECK_MAIL
    CHECK_MAIL -->|true| CHECK_SUB_VALUE1
    CHECK_MAIL -->|false| CHECK_DETAIL
    CHECK_SUB_VALUE1 -->|true| SET_MAIL_VALUE
    CHECK_SUB_VALUE1 -->|false| CHECK_SUB_STATE1
    CHECK_SUB_STATE1 -->|true| SET_MAIL_STATE
    CHECK_SUB_STATE1 -->|false| END_METHOD
    CHECK_DETAIL -->|true| CHECK_SUB_VALUE2
    CHECK_DETAIL -->|false| END_METHOD
    CHECK_SUB_VALUE2 -->|true| SET_DETAIL_VALUE
    CHECK_SUB_VALUE2 -->|false| CHECK_SUB_STATE2
    CHECK_SUB_STATE2 -->|true| SET_DETAIL_STATE
    CHECK_SUB_STATE2 -->|false| END_METHOD
    SET_MAIL_VALUE --> END_METHOD
    SET_MAIL_STATE --> END_METHOD
    SET_DETAIL_VALUE --> END_METHOD
    SET_DETAIL_STATE --> END_METHOD
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `key` | `String` | The business field name (item name / 項目名) that identifies which data type the incoming value belongs to. Currently supports two values: `"メール明細コード"` (Mail Detail Code — a classification code for customer mail notification items) and `"明細本文非定型置換文字"` (Custom Replacement Text in Body — dynamic placeholder text for service detail letters). Case-sensitive comparison. |
| 2 | `subkey` | `String` | The sub-field name that identifies which property of the keyed field to populate. Accepts `"value"` (to set the actual data value) or `"state"` (to set the display/edit state flag). Case-insensitive comparison (`equalsIgnoreCase`). |
| 3 | `in_value` | `Object` | The actual data payload being stored. Cast to `String` at the point of assignment. Represents the typed value for either the field's data value or its state flag. |
| 4 | `isSetAsString` | `boolean` | Flag indicating whether to set a String-typed value into a Long-type item's Value property. Accepted for interface compatibility but not used in this implementation (always `false` in call chains). |

**Instance fields read/written by this method:**

| Field | Type | Access | Business Description |
|-------|------|--------|---------------------|
| `mail_dtl_cd_value` | `String` | SET | Mail detail code value — the classification code for customer mail notification items |
| `mail_dtl_cd_state` | `String` | SET | Mail detail code state — display/edit state flag for the mail detail code field |
| `dtl_text_htk_ckam_moji_value` | `String` | SET | Custom replacement text value — the dynamic placeholder text for service detail letters |
| `dtl_text_htk_ckam_moji_state` | `String` | SET | Custom replacement text state — display/edit state flag for the custom replacement text field |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `FUW00114SF03DBean.setMail_dtl_cd_value` | - | - | Calls `setMail_dtl_cd_value` in `FUW00114SF03DBean` — sets the mail detail code value field |
| - | `FUW00114SF03DBean.setMail_dtl_cd_state` | - | - | Calls `setMail_dtl_cd_state` in `FUW00114SF03DBean` — sets the mail detail code state flag |
| - | `FUW00114SF03DBean.setDtl_text_htk_ckam_moji_value` | - | - | Calls `setDtl_text_htk_ckam_moji_value` in `FUW00114SF03DBean` — sets the custom replacement text value field |
| - | `FUW00114SF03DBean.setDtl_text_htk_ckam_moji_state` | - | - | Calls `setDtl_text_htk_ckam_moji_state` in `FUW00114SF03DBean` — sets the custom replacement text state flag |

This method performs **no database or service component operations**. It is a pure in-memory data dispatching method that routes incoming values to typed field setters on the same bean. The setters are simple property assignments (U — Update) on the bean's internal state, not external persistence operations. All data flowing through this method remains within the presentation-layer data bean and is used to populate the model state that feeds back to the JSF view.

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Screen: FUW00114SF03DBean (self) | `FUW00114SF03DBean.storeModelData(String, String, Object)` (3-param overload) -> `storeModelData(String, String, Object, boolean)` | `setMail_dtl_cd_value` [U], `setMail_dtl_cd_state` [U], `setDtl_text_htk_ckam_moji_value` [U], `setDtl_text_htk_ckam_moji_state` [U] |
| 2 | Screen: FUW00114SF03DBean (self) | `FUW00114SF03DBean.storeModelData(String, String, Object, boolean)` (4-param overload) -> `storeModelData(String, String, Object, boolean)` | `setMail_dtl_cd_value` [U], `setMail_dtl_cd_state` [U], `setDtl_text_htk_ckam_moji_value` [U], `setDtl_text_htk_ckam_moji_state` [U] |

**Caller context:** The primary external caller is `FUW00114SFBean.java` (the container bean for screen `FUW00114SF`), which uses `FUW00114SF03DBean` as a data type bean for the "Customer Mail Detail List" (お客様向けメール明細一覧リスト) item. The bean is instantiated via `getInvokeCBS` routing and then populated with data through the `storeModelData` method chain. The self-callers are overloaded variants of the same method that delegate down to the 4-parameter implementation.

## 6. Per-Branch Detail Blocks

**Block 1** — [IF] `(null check)` (L196)

Guard clause: if either `key` or `subkey` is null, processing is terminated early (処理を中止). This prevents NullPointerException when the caller passes incomplete routing data.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `return` // key or subkey is null — stop processing (key,subkeyがnullの場合、処理を中止) |

---

**Block 2** — [SET] `(separator computation)` (L199)

Computes the position of the first `/` character in `key`, likely for future sub-key routing logic. Currently unused in the method body.

| # | Type | Code |
|---|------|------|
| 1 | SET | `int separaterPoint = key.indexOf('/')` // Find separator position in key (unused in current logic) |

---

**Block 3** — [IF] `(key equals 'メール明細コード')` — Mail Detail Code dispatch (L202)

This branch handles the "Mail Detail Code" data type (データタイプがStringの項目"メール明細コード"(項目ID:mail_dtl_cd)). It routes based on `subkey` to either the value setter or the state setter.

**Block 3.1** — [IF] `(subkey equalsIgnoreCase 'value')` (L203)

Routes incoming data to the mail detail code value field. The `in_value` is cast to `String` and assigned as the actual mail detail code data.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `setMail_dtl_cd_value((String)in_value)` // Set the mail detail code value (subkeyが"value"の場合、値を設定) |

---

**Block 3.2** — [ELSE-IF] `(subkey equalsIgnoreCase 'state')` — Mail Detail Code state (L206)

Routes incoming data to the mail detail code state flag. The `in_value` is cast to `String` and assigned as the display/edit state flag for the mail detail code field.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `setMail_dtl_cd_state((String)in_value)` // Set the mail detail code state (subkeyが"state"の場合、ステータスを返す) |

---

**Block 4** — [ELSE-IF] `(key equals '明細本文非定型置換文字')` — Custom Replacement Text dispatch (L211)

This branch handles the "Custom Replacement Text in Body" data type (データタイプがStringの項目"明細本文非定型置換文字"(項目ID:dtl_text_htk_ckam_moji)). It routes based on `subkey` to either the value setter or the state setter.

**Block 4.1** — [IF] `(subkey equalsIgnoreCase 'value')` (L212)

Routes incoming data to the custom replacement text value field. The `in_value` is cast to `String` and assigned as the actual placeholder text data.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `setDtl_text_htk_ckam_moji_value((String)in_value)` // Set the custom replacement text value (subkeyが"value"の場合、値を設定) |

---

**Block 4.2** — [ELSE-IF] `(subkey equalsIgnoreCase 'state')` — Custom Replacement Text state (L215)

Routes incoming data to the custom replacement text state flag. The `in_value` is cast to `String` and assigned as the display/edit state flag for the custom replacement text field.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `setDtl_text_htk_ckam_moji_state((String)in_value)` // Set the custom replacement text state (subkeyが"state"の場合、ステータスを返す) |

---

**Block 5** — [ELSE (implicit)] `(unrecognized key)` (L219)

If `key` does not match either recognized data type, the method falls through without performing any action. This acts as an implicit no-op for unrecognized keys, which prevents errors from being thrown while also silently ignoring data for keys the bean does not recognize.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return` // Implicit return — method ends with no effect for unrecognized keys |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `mail_dtl_cd` | Field | Mail Detail Code — classification code for customer mail notification items; determines the type/category of mail sent to customers |
| `mail_dtl_cd_value` | Field | The actual data value stored in the mail detail code field |
| `mail_dtl_cd_state` | Field | The display/edit state flag for the mail detail code field (e.g., visible, hidden, editable, disabled) |
| `dtl_text_htk_ckam_moji` | Field | Custom Replacement Text in Body — non-standard replacement character/placeholder text inserted into service detail letter content |
| `dtl_text_htk_ckam_moji_value` | Field | The actual data value stored in the custom replacement text field |
| `dtl_text_htk_ckam_moji_state` | Field | The display/edit state flag for the custom replacement text field |
| `cust_mail_dtl_cd_list` | Field | Customer Mail Detail List — the item ID for the list of customer-facing mail detail items; data type bean class is `FUW00114SF03DBean` |
| X33V framework | Technical | Fujitsu Futurity X33V web client framework — the underlying MVC framework providing data binding, bean interfaces, and view model infrastructure |
| `X33VDataTypeBeanInterface` | Technical | Interface for typed data beans in the X33V framework; defines the contract for `storeModelData` and field getter/setter methods |
| `X33VListedBeanInterface` | Technical | Interface for beans that can participate in list-based data structures within the X33V framework |
| `FUW00114SF` | Module | Service detail mail screen module — the screen module handling customer-facing mail detail configuration and display |
| メール明細コード | Japanese | Mail Detail Code — a String field representing the classification code for customer mail notifications; controls which mail template and content is sent |
| 明細本文非定型置換文字 | Japanese | Custom Replacement Text in Body — a String field representing dynamic placeholder text that can be substituted into service detail letter content |
| 処理を中止 | Japanese | Terminate processing — the null-check guard clause that stops method execution when routing data is incomplete |
| ステータスを返す | Japanese | Return the state — comment describing that when `subkey` is "state", the method sets the display/edit state flag rather than the data value |
| 項目名 | Japanese | Item name / field name — the business-level identifier used to select which data type the incoming value belongs to |
| サブキー | Japanese | Sub-key — the secondary identifier that specifies which property (value or state) of the keyed field to populate |
| K-Opticom | Business term | NTT East's fiber-optic internet service brand; the system this codebase supports |
| FTTH | Business term | Fiber To The Home — the broadband internet service technology this system manages |
