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

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.FUW00116SF.FUW00116SF03DBean` |
| Layer | Web View Bean / Controller Data Binding |
| Module | `FUW00116SF` (Package: `eo.web.webview.FUW00116SF`) |

## 1. Role

### FUW00116SF03DBean.storeModelData()

This method acts as a **unified data injection dispatcher** within the `FUW00116SF` screen module, responsible for binding incoming UI data into the appropriate fields of a web view data bean (`FUW00116SF03DBean`). It implements a **routing/dispatch design pattern**: given a logical item name (`key`), a sub-key (`subkey`) indicating the property type (`value` or `state`), and the data (`in_value`), it routes the data to the correct setter method based on the item being handled.

Two business item types are supported: **"メール詳細コード" (Mail Detail Code)** and **"詳細本文非定型置換文字" (Detail Body Non-standard Replacement Characters)**. For each item, the method distinguishes whether the caller intends to set the data `value` or the display `state` (e.g., enabled/disabled or visible/invisible). This pattern is typical of Java EE web frameworks where form data is received as generic objects and needs to be mapped into strongly-typed domain fields on the server side.

The method plays a **shared utility role** within the `FUW00116SF` screen — it is a centralized injection point used by the screen's DBean to reconstruct model data from arbitrary key-value inputs during the request processing phase (e.g., after form submission or AJAX callbacks). It is not an entry point itself but is called by other methods within the same class to populate bean state.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["storeModelData(key, subkey, in_value, isSetAsString)"])

    START --> CHECK_NULL["key == null<br>|| subkey == null"]

    CHECK_NULL -- "true" --> EARLY_RETURN(["return / no-op"])

    CHECK_NULL -- "false" --> CALC_SEP["int separaterPoint = key.indexOf('/')"]

    CALC_SEP --> CHECK_KEY["key.equals('メール詳細コード')<br>(Mail Detail Code)"]

    CHECK_KEY -- "true" --> CHECK_SUB_KEY["subkey.equalsIgnoreCase('value')"]

    CHECK_SUB_KEY -- "true" --> SET_VALUE["setMail_dtl_cd_value((String)in_value)"]

    CHECK_SUB_KEY -- "false" --> CHECK_STATE["subkey.equalsIgnoreCase('state')"]

    CHECK_STATE -- "true" --> SET_STATE["setMail_dtl_cd_state((String)in_value)"]

    CHECK_STATE -- "false" --> END_MATCH(["End of mail_dtl_cd branch"])

    SET_VALUE --> END_MATCH
    SET_STATE --> END_MATCH

    CHECK_KEY -- "false" --> CHECK_KEY2["key.equals('詳細本文非定型置換文字')<br>(Detail Body Non-standard Replacement Characters)"]

    CHECK_KEY2 -- "true" --> CHECK_SUB_KEY2["subkey.equalsIgnoreCase('value')"]

    CHECK_SUB_KEY2 -- "true" --> SET_TEXT_VALUE["setDtl_text_htk_ckam_moji_value((String)in_value)"]

    CHECK_SUB_KEY2 -- "false" --> CHECK_STATE2["subkey.equalsIgnoreCase('state')"]

    CHECK_STATE2 -- "true" --> SET_TEXT_STATE["setDtl_text_htk_ckam_moji_state((String)in_value)"]

    CHECK_STATE2 -- "false" --> END_TEXT(["End of text branch"])

    SET_TEXT_VALUE --> END_TEXT
    SET_TEXT_STATE --> END_TEXT

    CHECK_KEY2 -- "false" --> END_KEY(["End - unmatched key"])

    END_MATCH --> FINAL(["End"])
    END_TEXT --> FINAL
    END_KEY --> FINAL
```

**Branch Summary:**

| Branch | Condition | Action |
|--------|-----------|--------|
| Early Return | `key == null \|\| subkey == null` | No-op — silently exits |
| Branch 1 | `key = "メール詳細コード"` (Mail Detail Code) | Routes to mail detail code setters |
| Branch 1a | `subkey = "value"` (case-insensitive) | `setMail_dtl_cd_value()` — sets the actual mail code value |
| Branch 1b | `subkey = "state"` (case-insensitive) | `setMail_dtl_cd_state()` — sets the display state |
| Branch 2 | `key = "詳細本文非定型置換文字"` (Detail Body Non-standard Replacement Characters) | Routes to text replacement field setters |
| Branch 2a | `subkey = "value"` (case-insensitive) | `setDtl_text_htk_ckam_moji_value()` — sets the replacement string value |
| Branch 2b | `subkey = "state"` (case-insensitive) | `setDtl_text_htk_ckam_moji_state()` — sets the display state |
| Fallback | Unmatched key | Silently ignored — no error thrown |

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `key` | `String` | The business item name that identifies which data field to populate. Controls the dispatch branch. Can be `"メール詳細コード"` (Mail Detail Code) or `"詳細本文非定型置換文字"` (Detail Body Non-standard Replacement Characters). If null, the method exits immediately. |
| 2 | `subkey` | `String` | The property sub-type within the identified item. Controls whether the data is a `value` (actual data) or a `state` (display/UI state). Compared case-insensitively. If null (or key is null), the method exits immediately. |
| 3 | `in_value` | `Object` | The raw data to inject into the bean. Cast to `String` when stored via the setter methods. Represents either the actual business value (e.g., a mail detail code string, a replacement text string) or a state flag. |
| 4 | `isSetAsString` | `boolean` | Reserved parameter indicating whether the value should be set as a String type for Long-type item properties. Currently **unused** within this method body (passed but not referenced), suggesting it is a contract parameter for interface compatibility or future expansion. |

**Instance fields / external state read:** None directly. The method operates purely as a routing dispatcher; all state mutations occur through the called setter methods on `this`.

## 4. CRUD Operations / Called Services

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

No database or SC/CBS calls are made directly by this method. It operates entirely within the view bean layer, delegating to internal setter methods.

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `FUW00116SF03DBean.setMail_dtl_cd_value` | FUW00116SF03DBean | - | Calls `setMail_dtl_cd_value((String))` on self — sets the mail detail code data value |
| - | `FUW00116SF03DBean.setMail_dtl_cd_state` | FUW00116SF03DBean | - | Calls `setMail_dtl_cd_state((String))` on self — sets the mail detail code display state |
| - | `FUW00116SF03DBean.setDtl_text_htk_ckam_moji_value` | FUW00116SF03DBean | - | Calls `setDtl_text_htk_ckam_moji_value((String))` on self — sets the detail body replacement text value |
| - | `FUW00116SF03DBean.setDtl_text_htk_ckam_moji_state` | FUW00116SF03DBean | - | Calls `setDtl_text_htk_ckam_moji_state((String))` on self — sets the detail body replacement text display state |

**Classification rationale:** All four called methods are internal setter methods (`set*`) on the same DBean class. They perform **U (Update)** operations on the bean's in-memory state — specifically, they set field values for UI display purposes. There are no calls to Service Components (SC), Common Business Services (CBS), DAOs, or database layers from this method.

## 5. Dependency Trace

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

No screen/batch entry points found within 8 hops. Direct callers found: 2 methods.
Terminal operations from this method: `setDtl_text_htk_ckam_moji_state` [-], `setDtl_text_htk_ckam_moji_value` [-], `setMail_dtl_cd_state` [-], `setMail_dtl_cd_value` [-]

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | `FUW00116SF03DBean.storeModelData()` (self-call / overloaded) | `storeModelData` (overloaded variant) -> `FUW00116SF03DBean.storeModelData(String, String, Object, boolean)` | `setMail_dtl_cd_value [U]`<br>`setMail_dtl_cd_state [U]`<br>`setDtl_text_htk_ckam_moji_value [U]`<br>`setDtl_text_htk_ckam_moji_state [U]` |
| 2 | `FUW00116SF03DBean.storeModelData()` (overloaded variant) | `storeModelData` (overloaded variant) -> `FUW00116SF03DBean.storeModelData(String, String, Object, boolean)` | `setMail_dtl_cd_value [U]`<br>`setMail_dtl_cd_state [U]`<br>`setDtl_text_htk_ckam_moji_value [U]`<br>`setDtl_text_htk_ckam_moji_state [U]` |

**Notes:** The two direct callers are overloaded `storeModelData()` methods within the same `FUW00116SF03DBean` class. These overloaded variants likely serve as convenience methods that provide default values for `in_value` or `isSetAsString`, delegating to this 4-parameter version. The terminal operations are all internal setter calls with no downstream database or service component propagation.

## 6. Per-Branch Detail Blocks

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

Early exit guard: null-check on both dispatch keys. If either is null, the method returns immediately with no side effects.

| # | Type | Code |
|---|------|------|
| 1 | CHECK | `key == null \|\| subkey == null` |
| 2 | RETURN | `return;` // 処理を中止 — Abort processing |

**Block 2** — [EXEC] (L196)

Calculate separator position. This extracts the index of the "/" character within the key for potential future use. Currently computed but **not used** in the method body.

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

**Block 3** — [IF] `(key.equals("メール詳細コード"))` [メール詳細コード="メール詳細コード"] (L199)

Dispatch block for the **Mail Detail Code** item type. This handles incoming data related to mail identification codes in the service detail.

| # | Type | Code |
|---|------|------|
| 1 | CHECK | `key.equals("メール詳細コード")` // Item type: Mail Detail Code [-> "メール詳細コード"] |
| 2 | IF (nested) | See Block 3.1 / 3.2 below |

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

Set the actual mail detail code value. Casts the generic Object parameter to String and delegates to the bean's setter.

| # | Type | Code |
|---|------|------|
| 1 | CHECK | `subkey.equalsIgnoreCase("value")` // Property type: value (case-insensitive) |
| 2 | CALL | `setMail_dtl_cd_value((String)in_value)` // Set mail detail code data value |

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

Set the display state for the mail detail code. As noted in the Japanese comment: "subkeyが"state"の場合、ステータスを返す" (When subkey is "state", returns/sets the status).

| # | Type | Code |
|---|------|------|
| 1 | CHECK | `subkey.equalsIgnoreCase("state")` // Property type: state (case-insensitive) |
| 2 | CALL | `setMail_dtl_cd_state((String)in_value)` // Set mail detail code display state |

**Block 4** — [ELSE-IF] `(key.equals("詳細本文非定型置換文字"))` [詳細本文非定型置換文字="詳細本文非定型置換文字"] (L207)

Dispatch block for the **Detail Body Non-standard Replacement Characters** item type. This handles incoming data related to custom replacement text strings used in the body of service detail documents. This is a non-standard/template-based replacement mechanism for text content.

| # | Type | Code |
|---|------|------|
| 1 | CHECK | `key.equals("詳細本文非定型置換文字")` // Item type: Detail Body Non-standard Replacement Characters [-> "詳細本文非定型置換文字"] |
| 2 | IF (nested) | See Block 4.1 / 4.2 below |

**Block 4.1** — [IF] `(subkey.equalsIgnoreCase("value"))` [subkey="value"] (L208)

Set the actual replacement character string. Casts the Object to String and delegates to the text replacement setter.

| # | Type | Code |
|---|------|------|
| 1 | CHECK | `subkey.equalsIgnoreCase("value")` // Property type: value (case-insensitive) |
| 2 | CALL | `setDtl_text_htk_ckam_moji_value((String)in_value)` // Set detail body replacement text value |

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

Set the display state for the detail body replacement characters field. Same semantics as Block 3.2 — controls the UI state (enabled/disabled, visible/hidden) of the replacement text field.

| # | Type | Code |
|---|------|------|
| 1 | CHECK | `subkey.equalsIgnoreCase("state")` // Property type: state (case-insensitive) |
| 2 | CALL | `setDtl_text_htk_ckam_moji_state((String)in_value)` // Set detail body replacement text state |

**Block 5** — [ELSE] `(unmatched key)` (L212)

If the `key` does not match any of the two known item types, the method falls through silently. No error is thrown, no data is stored. This is a **graceful degradation** design choice — unknown keys are silently ignored, which is appropriate for a dispatcher that may receive unexpected inputs from a form framework.

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| メール詳細コード | Field (Japanese) | Mail Detail Code — the identifier/code for mail service details. Used to track and display mail-related service information in the UI. |
| 詳細本文非定型置換文字 | Field (Japanese) | Detail Body Non-standard Replacement Characters — custom replacement text strings used within the body of service detail documents. "非定型" (non-standard/non-template) indicates these are ad-hoc replacements rather than predefined template variables. |
| `mail_dtl_cd` | Field | Mail Detail Code — the internal field name (English abbreviation) corresponding to the Japanese item "メール詳細コード". |
| `dtl_text_htk_ckam_moji` | Field | Detail Text Hit/Replace Character — the internal field name (English abbreviation) corresponding to "詳細本文非定型置換文字". "htk" likely stands for "hit" (hit/locate) and "ckam" for "replace" in a Japanese-abbreviated convention. |
| `value` | Property type | The actual business data value to be stored (e.g., the mail code string, the replacement text string). |
| `state` | Property type | The display/state flag for a field (e.g., whether the field is enabled, visible, or editable in the UI). |
| `isSetAsString` | Parameter | Flag indicating whether to set the value as a String type for Long-type item properties. Currently unused in this method but part of the method's public contract. |
| DBean | Abbreviation | Data Bean — a Java EE view-tier data carrier class that holds form data between the presentation layer and business logic. The `FUW00116SF03DBean` class is the data bean for screen module FUW00116SF. |
| FUW00116SF | Module | The screen/module identifier. This method belongs to the `FUW00116SF` webview module, which handles service detail operations (likely involving mail and text content management). |
| separaterPoint | Field | Temporary variable holding the index of the "/" character within the `key`. Computed but not used — possibly legacy code or preparation for future key-format parsing. |
