# Business Logic — FUW00114SF03DBean.typeModelData() [33 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.FUW00114SF.FUW00114SF03DBean` |
| Layer | View Bean / UI Framework (X33V framework, web presentation layer) |
| Module | `FUW00114SF` (Package: `eo.web.webview.FUW00114SF`) |

## 1. Role

### FUW00114SF03DBean.typeModelData()

This method serves as a **data type introspection utility** for the X33V web framework's typed-data binding system. Its purpose is to return the Java runtime type (`Class<?>`) for a named field ("key") within the customer mail detail list component of the FUW00114SF screen module. The FUW00114SF module manages customer-facing email information — specifically the "Customer Mail Detail List" (お客様向けメール詳細一覧リスト) — and this bean is the nested data-type-bean class for that repeating list.

The method implements a **routing/dispatch pattern** with explicit key matching against a small set of known field identifiers. For the two fields currently registered — "Email Detail Code" (メール詳細コード) and "Detail Body Non-standard Replacement String" (詳細本文非定型置換文字列) — it always returns `String.class` regardless of whether the subkey is `"value"` or `"state"`. This reflects the fact that both fields are String-typed properties in the underlying X33V bean infrastructure.

Its **role in the larger system** is to enable the X33V framework to perform type-safe data binding at runtime. The framework calls `typeModelData()` to determine which type converter, editor, or validator to apply when rendering, editing, or serializing form fields on the web page. It is a shared utility called by the parent bean's `typeModelData()` which handles the top-level key resolution before dispatching to nested bean type queries. This method acts as a terminal type-lookup leaf — it does not call any services, databases, or business components.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["typeModelData params"])
    CHECK_NULL[key is null]
    RETURN_NULL1(["return null"])
    FIND_SEP[Find separator in key]
    CHECK_MAIL_DTL[Key is Mail Detail Code]
    CHECK_VAL1[subkey is value]
    RETURN_STRING1(["return String.class"])
    CHECK_STATE1[subkey is state]
    RETURN_STATE1(["return String.class"])
    CHECK_DTL_TEXT[Key is Detail Body Text]
    CHECK_VAL2[subkey is value]
    RETURN_STRING2(["return String.class"])
    CHECK_STATE2[subkey is state]
    RETURN_STATE2(["return String.class"])
    RETURN_NULL2(["return null"])

    START --> CHECK_NULL
    CHECK_NULL -->|true| RETURN_NULL1
    CHECK_NULL -->|false| FIND_SEP
    FIND_SEP --> CHECK_MAIL_DTL
    CHECK_MAIL_DTL -->|true| CHECK_VAL1
    CHECK_MAIL_DTL -->|false| CHECK_DTL_TEXT
    CHECK_VAL1 -->|true| RETURN_STRING1
    CHECK_VAL1 -->|false| CHECK_STATE1
    CHECK_STATE1 -->|true| RETURN_STATE1
    CHECK_STATE1 -->|false| CHECK_DTL_TEXT
    CHECK_DTL_TEXT -->|true| CHECK_VAL2
    CHECK_DTL_TEXT -->|false| RETURN_NULL2
    CHECK_VAL2 -->|true| RETURN_STRING2
    CHECK_VAL2 -->|false| CHECK_STATE2
    CHECK_STATE2 -->|true| RETURN_STATE2
    CHECK_STATE2 -->|false| RETURN_NULL2
```

**Processing Summary:**

| Step | Operation | Description |
|------|-----------|-------------|
| 1 | Null Guard | If `key` or `subkey` is null, immediately return `null`. (key,subkeyがnullの場合、nullを返す) |
| 2 | Separator Search | Locate the first `/` character in `key` for potential nested key resolution. |
| 3a | Branch: Mail Detail Code | If `key` equals "メール詳細コード" (mail_dtl_cd), check subkey. |
| 3b | Branch: Detail Body Text | If `key` equals "詳細本文非定型置換文字列" (dtl_text_htk_ckam_moji), check subkey. |
| 3c | Subkey: value | For both keys, if `subkey` (case-insensitive) equals "value", return `String.class`. |
| 3d | Subkey: state | For both keys, if `subkey` (case-insensitive) equals "state", return `String.class`. |
| 4 | Default | If no matching key or subkey found, return `null`. (条件に一致するプロパティが存在しない場合は、nullを返す) |

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `key` | `String` | The field identifier (項目名) within the Customer Mail Detail List data bean. This represents the business name of a specific field in the mail detail form — currently "Email Detail Code" or "Detail Body Non-standard Replacement String". It determines which field's type metadata is being queried. |
| 2 | `subkey` | `String` | A sub-identifier that refines the type query. Two values are recognized: `"value"` (the data value type of the field) and `"state"` (the validation/state indicator type). The comparison is case-insensitive. |

**Instance fields / external state read:**
- No instance fields are read. This method is self-contained and stateless — it performs pure key-to-type lookup without accessing any bean properties or external resources.

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| *(none)* | — | — | — | This method does not invoke any service components, database operations, or business components. It is a pure type-lookup utility. |

**Note:** The `separaterPoint` variable is computed but never used in the logic path for this class. In the parent `FUW00114SFBean.typeModelData()`, the separator logic routes nested bean lookups. Here at the `FUW00114SF03DBean` level, only direct string comparison on `key` is performed.

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Screen:FUW00114SF (FUW00114SFBean) | `FUW00114SFBean.typeModelData(gamenId, key, subkey)` -> `FUW00114SFBean.typeModelData(key, subkey)` -> `FUW00114SF03DBean.typeModelData(key, subkey)` | *(no terminal calls — pure type lookup)* |

**Explanation:** The `FUW00114SFBean` (the parent view bean for the Customer Mail Detail List screen) delegates `typeModelData()` calls to its nested beans. When the framework queries the type for an element within the `cust_mail_dtl_cd_list_list` data structure, the main bean detects that the data-type-bean class is `FUW00114SF03DBean` and dispatches the `typeModelData()` call to it. This is the sole caller path — this bean operates as a leaf in the X33V bean hierarchy.

## 6. Per-Branch Detail Blocks

**Block 1** — IF `(key == null || subkey == null)` (L242)

> Null guard: returns null if either parameter is null.
> (key,subkeyがnullの場合、nullを返す)

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

**Block 2** — EXEC `(separator search)` (L245)

> Computes the position of the first `/` character in key for potential nested key routing.
> (Note: `separaterPoint` is unused in this specific bean — the routing logic uses direct string equality.)

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

**Block 3** — IF/ELSE-IF/ELSE `(key equals check)` (L248)

> Top-level field identification via exact string match. Two recognized field keys exist.

**Block 3.1** — IF-IF-ELSE-IF (`key = "メール詳細コード"` / Mail Detail Code) (L248)

> First recognized field: Email Detail Code. Returns String.class for both value and state subkeys.
> データタイプがStringの項目"メール詳細コード"(項目ID:mail_dtl_cd)

| # | Type | Code |
|---|------|------|
| 1 | IF | `key.equals("メール詳細コード")` [KEY="メール詳細コード"] |
| 2 | IF | `subkey.equalsIgnoreCase("value")` [SUBKEY="value"] |
| 3 | RETURN | `return String.class;` |
| 4 | ELSE-IF | `subkey.equalsIgnoreCase("state")` [SUBKEY="state"] |
| 5 | RETURN | `return String.class;` |
| 6 | ELSE | Falls through to next key check |

**Block 3.2** — ELSE-IF (`key = "詳細本文非定型置換文字列"` / Detail Body Non-standard Replacement String) (L257)

> Second recognized field: Detail Body Non-standard Replacement String. Returns String.class for both value and state subkeys.
> データタイプがStringの項目"詳細本文非定型置換文字列"(項目ID:dtl_text_htk_ckam_moji)

| # | Type | Code |
|---|------|------|
| 1 | ELSE-IF | `key.equals("詳細本文非定型置換文字列")` [KEY="詳細本文非定型置換文字列"] |
| 2 | IF | `subkey.equalsIgnoreCase("value")` [SUBKEY="value"] |
| 3 | RETURN | `return String.class;` |
| 4 | ELSE-IF | `subkey.equalsIgnoreCase("state")` [SUBKEY="state"] |
| 5 | RETURN | `return String.class;` |
| 6 | ELSE | Falls through to default return |

**Block 4** — RETURN `(default / no match)` (L266)

> No matching key or subkey was found. Returns null.
> (条件に一致するプロパティが存在しない場合は、nullを返す。)

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

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| メール詳細コード | Field | Email Detail Code — the identifier for a customer-facing email detail record in the mailing system |
| 詳細本文非定型置換文字列 | Field | Detail Body Non-standard Replacement String — a variable text string inserted into the body of customer-facing emails (e.g., dynamic placeholders like customer name, date, amount) |
| `mail_dtl_cd` | Field | Mail Detail Code — the internal column/field ID corresponding to メール詳細コード |
| `dtl_text_htk_ckam_moji` | Field | Detail Text Customer Custom Characters — the internal column/field ID corresponding to 詳細本文非定型置換文字列 |
| subkey "value" | Field | The data value type of a field — what Java type holds the actual field data |
| subkey "state" | Field | The validation/state indicator type — the Java type used to track field validation status |
| X33V | Acronym | Fujitsu Futurity Web Client Framework v3.x — the enterprise web application framework providing typed data binding, view beans, and list management |
| X33VDataTypeBeanInterface | Interface | X33V interface for beans that can report their field types at runtime via `typeModelData()` |
| X33VDataTypeList | Class | X33V container class for dynamically-sized lists of typed bean instances |
| X33VDataTypeStringBean | Class | X33V wrapper class for String-typed data fields within X33V lists |
| FUW00114SF | Module | Customer Mail Detail Management — the screen module responsible for viewing/managing customer-facing email details |
| Customer Mail Detail List | Business term | The repeating list structure (お客様向けメール詳細一覧リスト) containing individual customer email detail records |
| 項目名 (key) | Term | Item name / field name — the human-readable identifier used to look up field metadata |
| サブキー (subkey) | Term | Subkey — a refinement parameter that specifies whether to query the data value type or the validation state type |
