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

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.FUW00114SF.FUW00114SF01DBean` |
| Layer | Web / Data Binding Bean (webview package — serves as a data type resolver for view-layer model binding) |
| Module | `FUW00114SF` (Package: `eo.web.webview.FUW00114SF`) |

## 1. Role

### FUW00114SF01DBean.typeModelData()

The `typeModelData` method is a **data type resolution dispatcher** that maps field-level identifiers (a key and subkey pair) to their corresponding Java runtime types. It implements the routing/dispatch pattern commonly used in enterprise web frameworks where the view layer needs to know the expected data type of a model attribute at runtime — for validation, binding, or schema generation purposes.

The method handles **two distinct business fields**: (1) **Email Address** (項目ID: `mlad`) — representing the "送信先メールアドレス" (Destination Email Address) field used in customer communication forms, and (2) **Email Address Setting Field Code** (項目ID: `mlad_set_field_cd`) — representing the configuration field code for email address settings. For each field, two subkey variants are recognized: `value` (the actual data value) and `state` (the validation/presentation state flag). In both cases, the resolved type is `String.class`.

This is a **shared utility method** implemented by beans that expose model data to the web view layer. It follows a convention shared across the codebase — many `*DBean` and `*Bean` classes (e.g., `FUW00912SFBean`, `FUW00926SFBean`, `FUW00959SFBean`) implement their own variant of `typeModelData`, often delegating to or mirroring this pattern. The method is called during model iteration to perform **data type verification** (項目名を生成し、データタイプビューアにtypeModelDataの戻り値を返す — "generate the item name and return the typeModelData result to the data type viewer").

If neither the key nor the key/subkey combination matches a known field definition, the method returns `null`, allowing the caller to handle unknown fields gracefully.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["typeModelData key, subkey"])
    
    START --> COND_NULL["Are key or subkey null?"]
    
    COND_NULL -- "Yes" --> RET_NULL1["Return null"]
    COND_NULL -- "No" --> COMPUTE_SEP["Compute separaterPoint = key.indexOf('/')"]
    
    COMPUTE_SEP --> COND_MLA["key equals '送信先メールアドレス' (Destination Email Address)"]
    COMPUTE_SEP --> COND_MASC["key equals 'メールアドレス設定フィールドコード' (Email Address Setting Field Code)"]
    
    COND_MLA -- "Yes" --> COND_SUBKEY_VALUE1{"subkey equals 'value'?"}
    COND_MLA -- "No" --> COND_MASC
    
    COND_SUBKEY_VALUE1 -- "Yes" --> RET_STRING1["Return String.class"]
    COND_SUBKEY_VALUE1 -- "No" --> COND_SUBKEY_STATE1{"subkey equals 'state'?"}
    
    COND_SUBKEY_STATE1 -- "Yes" --> RET_STRING_STATE1["Return String.class"]
    COND_SUBKEY_STATE1 -- "No" --> RET_NULL2["Return null"]
    
    COND_MASC -- "Yes" --> COND_SUBKEY_VALUE2{"subkey equals 'value'?"}
    COND_MASC -- "No" --> RET_NULL3["Return null"]
    
    COND_SUBKEY_VALUE2 -- "Yes" --> RET_STRING2["Return String.class"]
    COND_SUBKEY_VALUE2 -- "No" --> COND_SUBKEY_STATE2{"subkey equals 'state'?"}
    
    COND_SUBKEY_STATE2 -- "Yes" --> RET_STRING_STATE2["Return String.class"]
    COND_SUBKEY_STATE2 -- "No" --> RET_NULL4["Return null"]
    
    RET_NULL1 --> END_NODE(["End"])
    RET_NULL2 --> END_NODE
    RET_NULL3 --> END_NODE
    RET_NULL4 --> END_NODE
    RET_STRING1 --> END_NODE
    RET_STRING_STATE1 --> END_NODE
    RET_STRING_STATE2 --> END_NODE
```

**Processing Summary:**

1. **Null guard** — If either `key` or `subkey` is `null`, immediately return `null` (null-safe early exit).
2. **Separator computation** — Compute `separaterPoint` by locating the `/` character in `key` (this value is computed but not used in the current logic — likely reserved for future key-format expansion).
3. **Branch 1: Email Address field** — If `key` matches `"送信先メールアドレス"` (Destination Email Address, project ID: `mlad`), delegate to subkey handling:
   - subkey `value` (case-insensitive) → `String.class`
   - subkey `state` (case-insensitive) → `String.class` (returns status flag type)
4. **Branch 2: Email Address Setting Field Code** — If `key` matches `"メールアドレス設定フィールドコード"` (Email Address Setting Field Code, project ID: `mlad_set_field_cd`), delegate to subkey handling:
   - subkey `value` (case-insensitive) → `String.class`
   - subkey `state` (case-insensitive) → `String.class` (returns status flag type)
5. **Fallback** — If no key matches, return `null` (no matching property found).

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `key` | `String` | **Field identifier** — the business field name (項目名) used to identify which model attribute's type is being queried. Accepted values: `"送信先メールアドレス"` (Destination Email Address, internal project ID: `mlad`) or `"メールアドレス設定フィールドコード"` (Email Address Setting Field Code, internal project ID: `mlad_set_field_cd`). Controls which field's type resolution path is taken. |
| 2 | `subkey` | `String` | **Sub-field identifier** — distinguishes between the data `value` and the validation/presentation `state` of the field. Case-insensitive comparison is used. When `null`, the method returns `null` without further processing. |

**External state / instance fields read:** None. This method is stateless — it operates solely on its parameters and does not read any instance fields.

## 4. CRUD Operations / Called Services

This method performs **no CRUD operations** and calls **no service components (SC/CBS)**. It is a pure data-resolution utility that returns type metadata without side effects.

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| *(none)* | — | — | — | This method is a pure dispatcher with no data access. |

## 5. Dependency Trace

The `typeModelData(String key, String subkey)` method on `FUW00114SF01DBean` has **no callers found** in the codebase. This is expected for `*DBean` classes in this architecture — they typically serve as data model components called indirectly through framework-level bean resolution rather than direct invocation from other business code.

However, the same-named `typeModelData` method exists across many other bean classes in the codebase (e.g., `FUW00912SFBean`, `FUW00926SFBean`, `FUW00959SFBean`, `FUW00964SFBean`), and those classes are called by their respective screens during model iteration. The call pattern in those callers is:

```java
// From FUW00912SFBean and similar
return ((X33VDataTypeStringBean)list.get(index)).typeModelData(subkey);
// or
return ((X33VDataTypeBeanInterface)beanList.get(index)).typeModelData(keyElement, subkey);
```

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | *(none — no direct callers found)* | — | — |
| 2 | N/A | This method is called indirectly through framework-level model binding and type inspection, not through explicit call chains. | — |

## 6. Per-Branch Detail Blocks

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

> Guard clause: if either parameter is null, return null immediately. This prevents NPE and handles incomplete field specifications.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return null;` // key or subkey is null — no type resolution possible |

**Block 2** — [EXEC] `(key.indexOf("/"))` (L253)

> Compute the index of the `/` separator in the key. This value is stored in `separaterPoint` but is not used in any subsequent branch — likely reserved for future key-format expansion (e.g., supporting hierarchical keys like `"field/subfield"`).

| # | Type | Code |
|---|------|------|
| 1 | SET | `int separaterPoint = key.indexOf("/");` // compute separator index (unused in current logic) |

**Block 3** — [IF/ELSE-IF] `(key.equals("送信先メールアドレス"))` (L256)

> **Condition:** `key.equals("送信先メールアドレス")` [送信先メールアドレス = "送信先メールアドレス" (Destination Email Address, project ID: mlad)]
>
> Business meaning: This branch handles type resolution for the **destination email address** field. It covers both the raw value (`value`) and the validation/presentation state (`state`) of the email address input.

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

> subkey is `"value"` (case-insensitive) — the caller wants the data type of the email address field's actual value.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return String.class;` // Email address value is a string |

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

> **Condition:** `subkey.equalsIgnoreCase("state")` [state = "state"]
>
> subkey is `"state"` (case-insensitive) — the caller wants the type of the state/validation flag associated with the email address field. As noted in the Japanese comment: `subkeyが"state"の場合、ステータスを返す` (When subkey is "state", returns the status).

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return String.class;` // Email address state is also a string |

**Block 3.3** — [ELSE (implicit)] — subkey is neither `"value"` nor `"state"`

| # | Type | Code |
|---|------|------|
| 1 | *(fall-through to Block 6)* | — |

**Block 4** — [ELSE-IF] `(key.equals("メールアドレス設定フィールドコード"))` (L264)

> **Condition:** `key.equals("メールアドレス設定フィールドコード")` [メールアドレス設定フィールドコード = "メールアドレス設定フィールドコード" (Email Address Setting Field Code, project ID: mlad_set_field_cd)]
>
> Business meaning: This branch handles type resolution for the **email address setting field code** field. Same subkey structure as Block 3 — supports both `value` and `state` subkeys.

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

> subkey is `"value"` (case-insensitive) — the caller wants the data type of the setting field code's value.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return String.class;` // Field code value is a string |

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

> **Condition:** `subkey.equalsIgnoreCase("state")` [state = "state"]
>
> subkey is `"state"` (case-insensitive) — the caller wants the type of the state flag for the setting field code. As noted in the Japanese comment: `subkeyが"state"の場合、ステータスを返す` (When subkey is "state", returns the status).

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return String.class;` // Field code state is also a string |

**Block 4.3** — [ELSE (implicit)] — subkey is neither `"value"` nor `"state"`

| # | Type | Code |
|---|------|------|
| 1 | *(fall-through to Block 6)* | — |

**Block 5** — [ELSE (implicit)] — No key matches either known field

> No matching key found in either Block 3 or Block 4 conditions. The Japanese comment states: `条件に合致するプロパティが存在しない場合は、nullを返す` (If no property matches the condition, return null).

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

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `key` | Parameter | Field identifier — the business field name (項目名) used to look up a model attribute's data type |
| `subkey` | Parameter | Sub-field identifier — distinguishes between the data `value` and the validation/presentation `state` of a field |
| `送信先メールアドレス` | Japanese field | Destination Email Address — the email address field used in customer communication forms. Internal project ID: `mlad` |
| `メールアドレス設定フィールドコード` | Japanese field | Email Address Setting Field Code — the configuration code field for email address settings. Internal project ID: `mlad_set_field_cd` |
| `separaterPoint` | Field | Separator index — the position of `/` in the key string. Currently unused; reserved for future hierarchical key support |
| `state` | Subkey value | Validation/presentation state flag — indicates the status of a field (e.g., whether it passed validation, needs display formatting, or has an error). Always resolved as `String.class` |
| `value` | Subkey value | Actual data value of a field — the primary data content of the model attribute |
| DBean | Pattern | Data Bean — a view-layer bean that holds data and type information for model binding, as opposed to the main Action/Service bean |
| X33VDataTypeBeanInterface | Pattern | Data type bean interface — the shared interface that all data type beans implement, defining the `typeModelData` contract |
| 項目 (koumoku) | Japanese term | Field / item — a named data element in the model/view data structure |
