# Business Logic — FUW00921SF01DBean.typeModelData() [39 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.FUW00921SF.FUW00921SF01DBean` |
| Layer | View / Data Bean (webview) |
| Module | `FUW00921SF` (Package: `eo.web.webview.FUW00921SF`) |

## 1. Role

### FUW00921SF01DBean.typeModelData()

This method is a **data type resolver** within the X33V web view framework. In the K-Opticom telecom ordering system, the customer confirmation document screen (`FUW00921SF`) uses a dynamic bean-based view system where UI fields are defined at runtime rather than hardcoded. The `typeModelData` method answers the question: *"What is the Java type of a given data field?"* — returning `Class<?>` objects (`String.class`, `Boolean.class`, etc.) so the framework can perform type-safe binding during rendering and validation.

The method handles two specific business data types: **Customer Confirmation Document Code List** (`お客様確認書類コードリスト`) and **Customer Confirmation Document Name List** (`お客様確認書類名称リスト`). These correspond to UI list items that allow customers to select which confirmation documents they need and view the names of those documents. Each list item exposes sub-properties (`value`, `enable`, `state`), and the method resolves the Java type for each sub-property.

The method implements the **routing/dispatch pattern**: it receives a `key` (item name) and `subkey` (sub-property name) and dispatches to the appropriate type resolution branch. It also implements the **strategy** pattern, as different subkey values ("value", "enable", "state") map to different return types. This method is a **shared utility** called by the parent `FUW00921SFBean.typeModelData()` dispatcher when processing the "お客様確認書類" (Customer Confirmation Document) screen fields.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["typeModelData key subkey"])
    START --> CHECK_NULL{"key null<br/>subkey null?"}
    CHECK_NULL -->|Yes| RETURN_NULL(["return null"])
    CHECK_NULL -->|No| FIND_SEP["separaterPoint<br/>key indexOf '/'"]
    FIND_SEP --> CHECK_KEY1{"key equals<br/>"お客様<br/>確認<br/>書類<br/>コード<br/>リスト"}
    CHECK_KEY1 -->|Yes| CHECK_SUB1{"subkey<br/>equalsIgnoreCase"}
    CHECK_SUB1 -->|"value"| RET_STR1["return<br/>String.class"]
    CHECK_SUB1 -->|"enable"| RET_BOOL1["return<br/>Boolean.class"]
    CHECK_SUB1 -->|"state"| RET_STR1_2["return<br/>String.class"]
    CHECK_KEY1 -->|No| CHECK_KEY2{"key equals<br/>"お客様<br/>確認<br/>書類<br/>名称<br/>リスト"}
    CHECK_KEY2 -->|Yes| CHECK_SUB2{"subkey<br/>equalsIgnoreCase"}
    CHECK_SUB2 -->|"value"| RET_STR2["return<br/>String.class"]
    CHECK_SUB2 -->|"enable"| RET_BOOL2["return<br/>Boolean.class"]
    CHECK_SUB2 -->|"state"| RET_STR2_2["return<br/>String.class"]
    CHECK_KEY2 -->|No| RETURN_NULL2(["return null"])
    RETURN_NULL --> END(["END"])
    RET_STR1 --> END
    RET_BOOL1 --> END
    RET_STR1_2 --> END
    RET_STR2 --> END
    RET_BOOL2 --> END
    RET_STR2_2 --> END
    RETURN_NULL2 --> END
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `key` | `String` | Item name (項目名) that identifies which data field's type is being requested. For this method, it accepts two specific values: `"お客様確認書類コードリスト"` (Customer Confirmation Document Code List) and `"のお客様確認書類名称リスト"` (Customer Confirmation Document Name List). These keys identify UI list fields on the customer confirmation document selection screen. |
| 2 | `subkey` | `String` | Sub-key (サブキー) that specifies which property of the identified field the caller needs the type for. Valid values are: `"value"` (the data value), `"enable"` (whether the field is enabled/disabled), and `"state"` (the field state/status). The comparison is case-insensitive (`equalsIgnoreCase`). |

**External state / instance fields read:** None. This method is stateless — it does not read any instance fields or external state. It only uses local variables (`separaterPoint`) which are computed from the input parameters.

## 4. CRUD Operations / Called Services

This method performs **no CRUD operations** and calls **no external services**. It is a pure type-resolver utility method that only returns `Class<?>` type references based on conditional logic.

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| N/A | (none) | — | — | This method contains no data access, no database calls, and no service component invocations. |

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Bean:FUW00921SFBean | `FUW00921SFBean.typeModelData(String key, String subkey)` (L6177) → calls `FUW00921SF01DBean.typeModelData(key, subkey)` (L6370, when key equals "お客様確認書類") | none (pure type resolver) |

**Notes on caller analysis:**
- `FUW00921SFBean` is the parent screen bean that orchestrates all list-type fields for the FUW00921SF screen. When a caller invokes `typeModelData` on the parent bean with `key = "お客様確認書類"` (Customer Confirmation Document), the parent bean routes to the `FUW00921SF01DBean.typeModelData` method via an `else-if` dispatch chain.
- No direct external callers were found — all access flows through the `FUW00921SFBean` dispatcher.
- The screen `FUW00921SF` is part of the K-Opticom telecom customer service ordering system (webview module).

## 6. Per-Branch Detail Blocks

**Block 1** — IF (null check) `(key == null || subkey == null)` (L271–273)

> Returns null early if either parameter is null. The Japanese comment states: "key,subkeyがnullの場合、nullを返す" (If key or subkey is null, return null).

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return null;` // key,subkeyがnullの場合、nullを返す (If key or subkey is null, return null) |

**Block 2** — EXEC (separator search) (L276)

> Searches for a '/' character in the key. This value is stored but not used within this method — it appears to be scaffolding for future or subclass usage.

| # | Type | Code |
|---|------|------|
| 1 | SET | `separaterPoint = key.indexOf("/")` // position of '/' separator in key |

**Block 3** — IF-ELSEIF (key dispatch — Customer Confirmation Document Code List) `(key.equals("お客様確認書類コードリスト"))` (L279–291)

> Processes items whose data type is String. The Japanese comment states: "データタイプがStringの項目\"お客様確認書類コードリスト\"(項目ID:confirm_document_cd_list)" (Item whose data type is String: "Customer Confirmation Document Code List" (Item ID: confirm_document_cd_list)).

| # | Type | Code |
|---|------|------|
| 1 | IF | `if(subkey.equalsIgnoreCase("value"))` |
| 2 | RETURN | `return String.class;` |
| 3 | ELSE-IF | `else if(subkey.equalsIgnoreCase("enable"))` |
| 4 | RETURN | `return Boolean.class;` |
| 5 | ELSE-IF | `else if(subkey.equalsIgnoreCase("state"))` //subkeyが"state"の場合、ステータスを返す (If subkey is "state", return the status) |
| 6 | RETURN | `return String.class;` |

**Block 3.1** — IF branch: subkey equals "value"

> Resolves the "value" sub-property of the customer confirmation document code list item. The `value` represents the actual document code string stored in the data model.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return String.class;` // Data value type for document code |

**Block 3.2** — ELSE-IF branch: subkey equals "enable"

> Resolves the "enable" sub-property indicating whether the document code list item is enabled or disabled in the UI.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return Boolean.class;` // Boolean flag for item enable/disable |

**Block 3.3** — ELSE-IF branch: subkey equals "state"

> Resolves the "state" sub-property that carries the state/status information of the document code list item.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return String.class;` // subkeyが"state"の場合、ステータスを返す (If subkey is "state", return status) |

**Block 4** — ELSE-IF (key dispatch — Customer Confirmation Document Name List) `(key.equals("お客様確認書類名称リスト"))` (L294–306)

> Processes items whose data type is String. The Japanese comment states: "データタイプがStringの項目\"お客様確認書類名称リスト\"(項目ID:confirm_document_nm_list)" (Item whose data type is String: "Customer Confirmation Document Name List" (Item ID: confirm_document_nm_list)).

| # | Type | Code |
|---|------|------|
| 1 | IF | `if(subkey.equalsIgnoreCase("value"))` |
| 2 | RETURN | `return String.class;` |
| 3 | ELSE-IF | `else if(subkey.equalsIgnoreCase("enable"))` |
| 4 | RETURN | `return Boolean.class;` |
| 5 | ELSE-IF | `else if(subkey.equalsIgnoreCase("state"))` //subkeyが"state"の場合、ステータスを返す (If subkey is "state", return the status) |
| 6 | RETURN | `return String.class;` |

**Block 4.1** — IF branch: subkey equals "value"

> Resolves the "value" sub-property of the customer confirmation document name list item. The `value` represents the actual document name string stored in the data model.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return String.class;` // Data value type for document name |

**Block 4.2** — ELSE-IF branch: subkey equals "enable"

> Resolves the "enable" sub-property indicating whether the document name list item is enabled or disabled in the UI.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return Boolean.class;` // Boolean flag for item enable/disable |

**Block 4.3** — ELSE-IF branch: subkey equals "state"

> Resolves the "state" sub-property that carries the state/status information of the document name list item.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return String.class;` // subkeyが"state"の場合、ステータスを返す (If subkey is "state", return status) |

**Block 5** — ELSE (no matching key found) (L308)

> When no matching key is found for the provided key value. The Japanese comment states: "条件に合致するプロパティが存在しない場合は、nullを返す" (If no matching property exists, return null).

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return null;` // 条件に合致するプロパティが存在しない場合は、nullを返す (If no matching property exists, return null) |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `typeModelData` | Method | Data type resolver — returns the Java Class type for a named UI field property, used by the X33V web view framework for type-safe data binding |
| `key` | Parameter | Item name (項目名) that identifies which data field is being queried |
| `subkey` | Parameter | Sub-property name (サブキー) within a data field (e.g., "value", "enable", "state") |
| `お客様確認書類コードリスト` | Business term | Customer Confirmation Document Code List — a UI list where customers select which confirmation documents apply to them; each item has a code identifier |
| `お客様確認書類名称リスト` | Business term | Customer Confirmation Document Name List — a UI list displaying the names/titles of the selected confirmation documents |
| `value` | Subkey | The actual data value of a field (e.g., the document code string) |
| `enable` | Subkey | Boolean flag indicating whether a UI field is enabled or disabled |
| `state` | Subkey | Status/state string of a field (e.g., visible, hidden, required) |
| `separaterPoint` | Local variable | Index of the '/' character in the key, used to split composite keys (not actively used in this method body) |
| FUW00921SF | Screen/Module | Customer confirmation document selection screen in the K-Opticom telecom ordering system |
| X33VDataType | Framework | K-Opticom's web view data type framework — provides bean-based view components for dynamic UI rendering |
| `String.class` | Return type | Java class representing text/string data |
| `Boolean.class` | Return type | Java class representing boolean (true/false) data |
| `null` | Return value | Returned when key/subkey are null or no matching data type is found |

---
