# Business Logic — FUW00954SFBean.typeModelData() [54 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.FUW00954SF.FUW00954SFBean` |
| Layer | Bean (View Data Model) — `eo.web.webview` package, part of the webview tier that supplies type metadata to the presentation layer |
| Module | `FUW00954SF` (Package: `eo.web.webview.FUW00954SF`) |

## 1. Role

### FUW00954SFBean.typeModelData()

The `typeModelData` method is a **type resolution dispatcher** that determines the Java type (`Class<?>`) of a data value based on a composite key and an optional subkey. It is used by the webview framework to determine how to render or validate form fields at runtime — for example, whether a field should be rendered as a text input, a checkbox, or a select list. The method implements a **routing/dispatch pattern**: it inspects the structure of the `key` parameter and dispatches to the appropriate type-handling branch.

The method supports multiple data access patterns: (1) direct field access with simple keys, (2) hierarchical path access using `/` delimiters (e.g., `root/item/field`), (3) **shared info view** items identified by a `//` prefix (delegated to the parent class's `typeCommonInfoData`), (4) repeated-list items via wildcard `*` subkeys, and (5) **shared info view repeated lists** via `//` prefix with `*` subkey. This enables the UI framework to resolve the type for any field regardless of whether it is a top-level field, a nested path, a repeated list element, or part of a shared info section.

Currently, the method has concrete type mappings only for the `"確認の種類"` (Confirmation Type / "kakunin_shurui") field: its `"value"` subkey maps to `String.class`, its `"enable"` subkey maps to `Boolean.class`, and its `"state"` subkey maps to `String.class`. All other field combinations currently return `null`, meaning the framework will fall back to a default type resolution strategy. This method serves as the **central type metadata source** for the `FUW00954SF` screen, allowing dynamic, data-driven form rendering without hard-coded view logic.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["typeModelData key, subkey"])
    START --> CHECK_NULL["key is null?"]
    CHECK_NULL -->|"Yes"| RETURN_NULL["return null"]
    CHECK_NULL -->|"No"| CHECK_SUBKEY["subkey is null?"]
    CHECK_SUBKEY -->|"Yes"| EMPTY_SUBKEY["subkey = empty string"]
    CHECK_SUBKEY -->|"No"| CHECK_SEPARATE["indexOf // in key"]
    EMPTY_SUBKEY --> CHECK_SEPARATE
    CHECK_SEPARATE -->|"key starts with //"| DELEGATE["super.typeCommonInfoData key"]
    CHECK_SEPARATE -->|"key is not shared info"| EXTRACT_KEY["indexOf / in key"]
    DELEGATE --> END_RETURN(["Return / Next"])
    EXTRACT_KEY --> EXTRACT_CHECK["indexOf / > 0?"]
    EXTRACT_CHECK -->|"Yes"| KEY_ELEM["keyElement = substring 0 to /"]
    EXTRACT_CHECK -->|"No"| KEY_ELEM_ORIG["keyElement = key"]
    KEY_ELEM --> MATCH_FIELD["keyElement equals 確認の種類?"]
    KEY_ELEM_ORIG --> MATCH_FIELD
    MATCH_FIELD -->|"Yes"| MATCH_SUBKEY["subkey equals value?"]
    MATCH_SUBKEY -->|"Yes"| RET_STRING["return String.class"]
    MATCH_SUBKEY -->|"No"| SUBKEY_ENABLE["subkey equals enable?"]
    SUBKEY_ENABLE -->|"Yes"| RET_BOOL["return Boolean.class"]
    SUBKEY_ENABLE -->|"No"| SUBKEY_STATE["subkey equals state?"]
    SUBKEY_STATE -->|"Yes"| RET_STRING2["return String.class"]
    SUBKEY_STATE -->|"No"| RETURN_NULL2["return null"]
    MATCH_FIELD -->|"No"| RETURN_NULL2
    RET_STRING --> END_RETURN
    RET_BOOL --> END_RETURN
    RET_STRING2 --> END_RETURN
    RETURN_NULL --> END_RETURN
    RETURN_NULL2 --> END_RETURN
```

**CRITICAL — Constant Resolution:**
No constants are referenced in this method — all string literals are direct comparisons against Japanese field names and subkey identifiers (`"value"`, `"enable"`, `"state"`, `"確認の種類"`). The `//` separator pattern is a convention for shared info views, resolved via `key.indexOf("//")`.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `key` | `String` | The field name (項目名) used to identify a UI data element. It follows a composite key pattern: a simple field name (e.g., `"確認の種類"`), a hierarchical path separated by `/` (e.g., `"root/0/item"`), or a shared info view prefix `//` (e.g., `"//fieldName"`). The key determines which branch of type resolution is executed. |
| 2 | `subkey` | `String` | An optional sub-identifier for the field, such as `"value"` (the field's data value), `"enable"` (whether the field is editable), or `"state"` (the field's display state). When `null`, it is replaced with an empty string so that downstream string comparisons do not throw NPE. For repeated-list items, this can be an index (from `X33VDataTypeList`) or a wildcard `*`. |

**Instance fields / external state read:**
- No instance fields are read. The method is stateless and only reads its parameters and delegates to `super.typeCommonInfoData(key)` for shared info view keys.

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `JKKAdEditCC.substring` | JKKAdEditCC | - | Calls `substring` in `JKKAdEditCC` |
| - | `JKKAdEdit.substring` | JKKAdEdit | - | Calls `substring` in `JKKAdEdit` |
| - | `JKKTelnoInfoAddMapperCC.substring` | JKKTelnoInfoAddMapperCC | - | Calls `substring` in `JKKTelnoInfoAddMapperCC` |
| - | `JDKejbStringEdit.substring` | JDKejbStringEdit | - | Calls `substring` in `JDKejbStringEdit` |

### Method-level analysis:

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `super.typeCommonInfoData(key)` | - | - | Delegates to the parent class's shared info view type resolution method. No SC or entity interaction directly visible in this method. |
| - | `String.substring(int, int)` | - | - | Extracts the first element from a hierarchical key (e.g., `key.substring(0, separaterPoint)` to get `"確認の種類"` from `"確認の種類/0/field"`). |
| - | `String.indexOf(String)` | - | - | Searches for `//` prefix (shared info view indicator) and `/` separator (hierarchical path indicator) within the key string. |
| - | `String.equalsIgnoreCase(String)` | - | - | Case-insensitive comparison of `subkey` against `"value"`, `"enable"`, and `"state"` literals. |
| - | `String.equals(Object)` | - | - | Exact comparison of `keyElement` against `"確認の種類"` (Confirmation Type). |

**Classification:** This method performs **no CRUD operations**. It is a pure type-resolution utility — a read-only metadata lookup that returns a `Class<?>` without reading or writing any database or entity data. All its operations are String manipulation and conditional dispatch.

## 5. Dependency Trace

No screen/batch entry points found within 8 hops. Direct callers found: 1 methods.
Terminal operations from this method: `substring` [-], `substring` [-], `substring` [-], `substring` [-]

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | `FUW00954SFBean` (self-reference / internal dispatcher) | `FUW00954SFBean.typeModelData` | `typeCommonInfoData [R] -`, `substring [N/A] -` |

**Note:** The `FUW00954SFBean.typeModelData()` method is called internally by the `FUW00954SF` screen's type resolution infrastructure. The pre-computed caller data shows only a single internal reference to `typeModelData` within the `FUW00954SFBean` class. No screen or batch entry points (e.g., `KKSVxxxx` classes) directly invoke this method; it is a utility method used by the webview framework during form rendering.

## 6. Per-Branch Detail Blocks

**Block 1** — IF (null-check) `(key == null)` (L293)

> Null-guard: if the caller passes a null key, the method returns null immediately. The comment states: 「keyがnullの場合、null返す」 (If key is null, return null).

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

**Block 2** — ELSE-IF (null-check) `(subkey == null)` (L301)

> If the key is non-null but the subkey is null, replace it with an empty string. The comment states: 「subkeyがnullの場合、空文字列に」 (If subkey is null, set to empty string). This prevents NullPointerException on subsequent `equalsIgnoreCase` calls.

| # | Type | Code |
|---|------|------|
| 1 | SET | `subkey = new String("");` // 「subkeyがnullの場合、空文字列に」 (If subkey is null, set to empty string) |

**Block 3** — IF (shared info view prefix) `(separaterPoint == 0)` (L316)

> Check if the key starts with `//`, which indicates a **shared info view** (共有情報ビュー) item. The variable `separaterPoint` is set by `key.indexOf("//")` on line 311. The comment states: 「keyが共有情報ビューに関する指定か否かチェック」 (Check whether key is a specification related to shared info view). If the key starts with `//`, delegate to the parent class's `typeCommonInfoData` method to resolve the type.

| # | Type | Code |
|---|------|------|
| 1 | SET | `int separaterPoint = key.indexOf("//");` // 「keyが共有情報ビューに関する指定か否かチェック」 (Check whether key is a specification related to shared info view) |
| 2 | CALL | `super.typeCommonInfoData(key);` // Delegate to parent for shared info view type resolution |

**Block 4** — IF-ELSE (hierarchical path extraction) `(separaterPoint > 0)` (L323)

> After the shared info check, look for a `/` separator to handle hierarchical keys (ルート指定). The comment states: 「keyの値の最初の要素を取得」 (Get the first element of the key value). If `/` is found at a position > 0, extract the first segment. Otherwise, the entire key is the field name. This supports paths like `"確認の種類/0/item"` by extracting `"確認の種類"` as the base field.

| # | Type | Code |
|---|------|------|
| 1 | SET | `separaterPoint = key.indexOf("/");` // 「キーがルート指定（"項目a/0/項目b"のような）の場合を想定し、区切り符号（ここで"/"）を検索する」 (Assume key is a root specification like "fieldA/0/fieldB", search for the separator "/") |
| 2 | IF | `separaterPoint > 0` — hierarchical key path detected |
| 2.1 | SET | `keyElement = key.substring(0, separaterPoint);` // Extract first path element |
| 3 | ELSE | `separaterPoint <= 0` — simple key, no hierarchy |
| 3.1 | SET | `keyElement = key;` // Entire key is the field name |

**Block 5** — IF-ELSE-IF-ELSE (field-specific type matching) `(keyElement.equals("確認の種類"))` (L330)

> The method now maps specific fields to their Java types. Currently, only one field is configured: `"確認の種類"` (Confirmation Type / Kakunin Shurui). For this field, three subkeys are supported:
> - `"value"` (大文字小文字を区別せずに比較) → `String.class` — the confirmation type's data value
> - `"enable"` → `Boolean.class` — whether the confirmation type field is enabled
> - `"state"` (ステータスを返す) → `String.class` — the display state of the confirmation type field
> The comment on `"state"` says: 「subkeyが"state"の場合、ステータスを返す」 (When subkey is "state", return the status).
> All other fields (and any unrecognized subkey of `"確認の種類"`) fall through to the final `return null`.

| # | Type | Code |
|---|------|------|
| 1 | IF | `keyElement.equals("確認の種類")` — match Confirmation Type field |
| 1.1 | IF | `subkey.equalsIgnoreCase("value")` |
| 1.1.1 | RETURN | `return String.class;` |
| 1.2 | ELSE-IF | `subkey.equalsIgnoreCase("enable")` |
| 1.2.1 | RETURN | `return Boolean.class;` |
| 1.3 | ELSE-IF | `subkey.equalsIgnoreCase("state")` — 「subkeyが"state"の場合、ステータスを返す」 (When subkey is "state", return the status) |
| 1.3.1 | RETURN | `return String.class;` |
| 1.4 | ELSE | (unrecognized subkey for 確認の種類) |
| 1.4.1 | RETURN | `return null;` |
| 2 | ELSE | (keyElement does not match "確認の種類") |
| 2.1 | RETURN | `return null;` |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `確認の種類` | Field | Confirmation Type — a UI field that determines the type of confirmation or validation applied in the screen. Its value, enable, and state subkeys are mapped to String, Boolean, and String types respectively. |
| `kakunin_shurui` | Field (Romanized) | The hiragana/romanized form of "確認の種類" — Confirmation Type, used as an internal identifier. |
| `key` | Parameter | Field name (項目名) — a composite identifier that encodes the field's identity, hierarchical path, and whether it belongs to a shared info view. |
| `subkey` | Parameter | Sub-identifier for a field — specifies which aspect of the field is being queried (e.g., `"value"` for data, `"enable"` for editability, `"state"` for display state). |
| `//` prefix | Convention | Shared info view indicator (共有情報ビューのプレフィックス) — keys starting with `//` denote fields that belong to the shared information view section and are handled by the parent class. |
| `typeCommonInfoData` | Method | Shared info view type resolver — a parent class method that resolves the `Class<?>` for fields belonging to the shared information view. |
| `X33VDataTypeList` | Class | Data type list for views — a list that holds the order of views for each item, used for repeated-list subkey indices. |
| 共有情報ビュー | Japanese term | Shared Info View — a UI section containing fields that are shared across multiple screens or contexts, whose type resolution is delegated to the parent class. |
| ルート指定 | Japanese term | Root specification — a hierarchical key path format (e.g., `"fieldA/0/fieldB"`) that encodes nested data structure positions. |
| `String.class` | Java type | Java String — used for text data fields. |
| `Boolean.class` | Java type | Java Boolean — used for on/off toggle fields. |

---
