---

# Business Logic — CRW03407SF01DBean.typeModelData() [107 LOC]

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

## 1. Role

### CRW03407SF01DBean.typeModelData()

The `typeModelData` method serves as a **data type resolution dispatcher** for the CRW03407SF screen component, which handles external connection URL history management (対応履歴外部接続). It maps field identifiers — composed of a `key` (field name) and an optional `subkey` (field property or list index) — to their corresponding Java runtime types (`Class<?>`). This enables the view layer to dynamically determine the data model type for each form field without hardcoding type checks throughout the screen logic.

The method supports **three data categories**: (1) the URL number index field (`対応履歴外部接続URL番号インデックス`), which exposes scalar properties (`value` as `String`, `enable` as `Boolean`, `state` as `String`); (2) the URL list (`対応履歴外部接続URLリスト`), which is a `String`-typed array-like collection where `*` returns `Integer.class` (for element count) and numeric indices delegate to `X33VDataTypeStringBean`; (3) the URL name list (`対応履歴外部接続URL名リスト`), following the same index-based delegation pattern.

The method implements a **routing/dispatch design pattern**: it branches on the `key` string value, and for list-type keys, further dispatches by parsing an index from the subkey-separated path and forwarding the `subkey` to the individual list element's own `typeModelData` method. Its **role in the larger system** is that of a shared data-model introspection utility — it allows the framework to query "what type does this field expect?" at runtime, supporting dynamic form rendering, data binding, and client-side type checks within the CRW03407SF screen's detail view.

```mermaid
flowchart TD
    START(["typeModelData key subkey"])
    NULL_CHECK{key null<br/>or subkey null}
    INDEX{key indexOf<br/>slash found}
    BRANCH1{key equals<br/>URL番号インデックス}
    SUBVAL{subkey equalsIgnoreCase<br/>value}
    SUBENB{subkey equalsIgnoreCase<br/>enable}
    SUBSTA{subkey equalsIgnoreCase<br/>state}
    BRANCH2{key equals<br/>URLリスト}
    WILD{key equals<br/>asterisk}
    PARSE_INT{Integer.valueOf<br/>parse success}
    BOUNDS{tmpIndex in range}
    RETURN_NULL(["return null"])
    RETURN_INT(["return Integer.class"])
    RETURN_STR1(["return String.class"])
    RETURN_BOOL(["return Boolean.class"])
    DEL1[X33VDataTypeStringBean<br/>get index<br/>typeModelData subkey]
    BRANCH3{key equals<br/>URL名リスト}

    START --> NULL_CHECK
    NULL_CHECK -->|yes| RETURN_NULL
    NULL_CHECK -->|no| INDEX
    INDEX --> BRANCH1
    BRANCH1 -->|yes| SUBVAL
    BRANCH1 -->|no| BRANCH2
    SUBVAL -->|yes| RETURN_STR1
    SUBVAL -->|no| SUBENB
    SUBENB -->|yes| RETURN_BOOL
    SUBENB -->|no| SUBSTA
    SUBSTA -->|yes| RETURN_STR1
    SUBSTA -->|no| BRANCH2
    BRANCH2 -->|yes| WILD
    BRANCH2 -->|no| BRANCH3
    WILD -->|yes| RETURN_INT
    WILD -->|no| PARSE_INT
    PARSE_INT -->|no| RETURN_NULL
    PARSE_INT -->|yes| BOUNDS
    BOUNDS -->|no| RETURN_NULL
    BOUNDS -->|yes| DEL1
    DEL1 --> RETURN_NULL
    BRANCH3 -->|yes| WILD
```

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["typeModelData key subkey"])
    NULL_CHECK{key null<br/>or subkey null}
    INDEX{key indexOf<br/>slash found}
    BRANCH1{key equals<br/>URL番号インデックス}
    SUBVAL{subkey equalsIgnoreCase<br/>value}
    SUBENB{subkey equalsIgnoreCase<br/>enable}
    SUBSTA{subkey equalsIgnoreCase<br/>state}
    BRANCH2{key equals<br/>URLリスト}
    WILD{key equals<br/>asterisk}
    PARSE_INT{Integer.valueOf<br/>parse success}
    BOUNDS{tmpIndex in range}
    RETURN_NULL(["return null"])
    RETURN_INT(["return Integer.class"])
    RETURN_STR1(["return String.class"])
    RETURN_BOOL(["return Boolean.class"])
    DEL1[X33VDataTypeStringBean<br/>get index<br/>typeModelData subkey]
    BRANCH3{key equals<br/>URL名リスト}

    START --> NULL_CHECK
    NULL_CHECK -->|yes| RETURN_NULL
    NULL_CHECK -->|no| INDEX
    INDEX --> BRANCH1
    BRANCH1 -->|yes| SUBVAL
    BRANCH1 -->|no| BRANCH2
    SUBVAL -->|yes| RETURN_STR1
    SUBVAL -->|no| SUBENB
    SUBENB -->|yes| RETURN_BOOL
    SUBENB -->|no| SUBSTA
    SUBSTA -->|yes| RETURN_STR1
    SUBSTA -->|no| BRANCH2
    BRANCH2 -->|yes| WILD
    BRANCH2 -->|no| BRANCH3
    WILD -->|yes| RETURN_INT
    WILD -->|no| PARSE_INT
    PARSE_INT -->|no| RETURN_NULL
    PARSE_INT -->|yes| BOUNDS
    BOUNDS -->|no| RETURN_NULL
    BOUNDS -->|yes| DEL1
    DEL1 --> RETURN_NULL
    BRANCH3 -->|yes| WILD
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `key` | `String` | The field identifier (項目名). Specifies which data field's type to resolve. For scalar fields, it is a descriptive name (e.g., "対応履歴外部接続URL番号インデックス"). For array/list fields, it uses a slash-delimited path format: `"対応履歴外部接続URLリスト/0"`, where the part after "/" is the index. |
| 2 | `subkey` | `String` | The sub-property or element index within the field. For the URL number index field, it specifies the property: `"value"` (the URL number value), `"enable"` (whether the field is editable), or `"state"` (the field's display state). For list fields, it is forwarded to the individual list element's `typeModelData` method. |

**Instance fields read by this method:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `l0_taiorrk_out_url_no_list` | `List<? extends X33VDataTypeStringBean>` | The external connection URL number list (対応履歴外部接続URL番号リスト). Each element is a String-typed bean representing one entry's URL number value. |
| `l0_taiorrk_out_url_list` | `List<? extends X33VDataTypeStringBean>` | The external connection URL list (対応履歴外部接続URLリスト). Each element is a String-typed bean representing one entry's URL value. |
| `l0_taiorrk_out_url_nm_list` | `List<? extends X33VDataTypeStringBean>` | The external connection URL name list (対応履歴外部接続URL名リスト). Each element is a String-typed bean representing one entry's URL name value. |

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `X33VDataTypeStringBean.typeModelData(String)` | X33VDataTypeStringBean | - | Delegates type resolution to an individual list element's type model data method. Called when accessing a specific index of a URL list or URL name list. |

This method performs **no direct CRUD operations**. It is a pure type-resolution utility — it reads from in-memory list collections and returns Java `Class<?>` type descriptors. No database access, no service component calls, no entity operations occur within this method.

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Class: CRW03407SF01DBean | `CRW03407SF01DBean.typeModelData` | `X33VDataTypeStringBean.typeModelData [R] in-memory list` |

The pre-computed call graph indicates this method is called within the same class (`CRW03407SF01DBean`). No external screen classes (KKSV*) or batch entry points directly reference this method. It is an internal utility used by the screen's own bean logic for data type introspection.

## 6. Per-Branch Detail Blocks

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

> Null check guard: if either parameter is null, return null immediately. This prevents NPE when downstream logic accesses the parameters.

| # | Type | Code |
|---|------|------|
| 1 | SET | `int separaterPoint = key.indexOf("/")` |
| 2 | RETURN | `return null` // key or subkey is null |

---

**Block 2** — [IF] `(key.equals("対応履歴外部接続URL番号インデックス"))` — URL Number Index Scalar (L434)

> This branch resolves the type for the "URL number index" scalar field. It exposes three sub-properties: `value` (the URL number string), `enable` (editability flag), and `state` (display state).

| # | Type | Code |
|---|------|------|
| 1 | IF (nested) | `subkey.equalsIgnoreCase("value")` — returns `String.class` (value = the URL number as a string) |
| 2 | ELSE-IF (nested) | `subkey.equalsIgnoreCase("enable")` — returns `Boolean.class` (enable = whether the field is editable) |
| 3 | ELSE-IF (nested) | `subkey.equalsIgnoreCase("state")` — returns `String.class` (state = the field's state/status string) |
| 4 | COMMENT | // subkeyが"state"の場合、ステータスを返す (Returns status when subkey is "state") |

---

**Block 3** — [ELSE-IF] `(key.equals("対応履歴外部接続URLリスト"))` — URL List Array (L448)

> This branch handles the URL list field, which is a String-typed array-like collection (項目ID: l0_taiorrk_out_url). It supports wildcard (`*`) access to get list size type, and indexed access to get individual element types.

| # | Type | Code |
|---|------|------|
| 1 | SET | `key = key.substring(separaterPoint + 1)` // keyの次の要素を取得 (Get the next element after the first "/"). Extracts the index portion from "URLリスト/0". |
| 2 | IF (nested) | `key.equals("*")` — returns `Integer.class` (wildcard = return the list element count type) |
| 3 | SET | `Integer tmpIndexInt = null` |
| 4 | TRY (nested) | `tmpIndexInt = Integer.valueOf(key)` — parse the key as an integer index |
| 5 | CATCH | `catch(NumberFormatException e)` — returns `null` // インデックス値が数値文字列でない場合はnullを返す (Return null if index value is not a numeric string) |
| 6 | IF (nested) | `tmpIndexInt == null` — returns `null` |
| 7 | SET | `int tmpIndex = tmpIndexInt.intValue()` |
| 8 | IF (nested) | `tmpIndex < 0 \|\| tmpIndex >= l0_taiorrk_out_url_list.size()` — returns `null` // インデックス値がリスト個数-1を超えるとnull (Return null if index exceeds list size) |
| 9 | RETURN | `((X33VDataTypeStringBean)l0_taiorrk_out_url_list.get(tmpIndex)).typeModelData(subkey)` — cast list element to `X33VDataTypeStringBean` and delegate type resolution |

---

**Block 4** — [ELSE-IF] `(key.equals("対応履歴外部接続URL名リスト"))` — URL Name List Array (L480)

> This branch handles the URL name list field (項目ID: l0_taiorrk_out_url_nm), following the exact same pattern as Block 3 but operating on the URL name list collection.

| # | Type | Code |
|---|------|------|
| 1 | SET | `key = key.substring(separaterPoint + 1)` // keyの次の要素を取得 (Get the next element after the first "/"). Extracts the index portion from "URL名リスト/0". |
| 2 | IF (nested) | `key.equals("*")` — returns `Integer.class` (wildcard = return the list element count type) |
| 3 | SET | `Integer tmpIndexInt = null` |
| 4 | TRY (nested) | `tmpIndexInt = Integer.valueOf(key)` — parse the key as an integer index |
| 5 | CATCH | `catch(NumberFormatException e)` — returns `null` // インデックス値が数値文字列でない場合はnullを返す (Return null if index value is not a numeric string) |
| 6 | IF (nested) | `tmpIndexInt == null` — returns `null` |
| 7 | SET | `int tmpIndex = tmpIndexInt.intValue()` |
| 8 | IF (nested) | `tmpIndex < 0 \|\| tmpIndex >= l0_taiorrk_out_url_nm_list.size()` — returns `null` // インデックス値がリスト個数-1を超えるとnull (Return null if index exceeds list size) |
| 9 | RETURN | `((X33VDataTypeStringBean)l0_taiorrk_out_url_nm_list.get(tmpIndex)).typeModelData(subkey)` — cast list element to `X33VDataTypeStringBean` and delegate type resolution |

---

**Block 5** — [DEFAULT RETURN] (L529)

> No matching key found — return null.

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

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| 対応履歴外部接続URL番号インデックス | Field | URL Number Index in External Connection History — the scalar field holding the URL number sequence/index value |
| 対応履歴外部接続URLリスト | Field | URL List in External Connection History — an array-like collection of URL values (項目ID: l0_taiorrk_out_url) |
| 対応履歴外部接続URL名リスト | Field | URL Name List in External Connection History — an array-like collection of URL name values (項目ID: l0_taiorrk_out_url_nm) |
| 対応履歴外部接続URL番号 | Field | URL Number in External Connection History — the URL number identifier (項目ID: l0_taiorrk_out_url_no) |
| `value` | Subkey | The URL number string value of an index field |
| `enable` | Subkey | Boolean flag indicating whether the field is editable/enabled |
| `state` | Subkey | String status indicating the display or validation state of the field |
| `l0_taiorrk_out_url_no_list` | Instance field | Internal list storing URL number entries for the external connection history |
| `l0_taiorrk_out_url_list` | Instance field | Internal list storing URL value entries for the external connection history |
| `l0_taiorrk_out_url_nm_list` | Instance field | Internal list storing URL name entries for the external connection history |
| X33VDataTypeStringBean | Class | A String-typed data bean that implements `typeModelData(String)` for sub-property type resolution. Used as the element type for all three URL list collections. |
| typeModelData | Method | Data type resolution method — maps a field key (and optional subkey) to a Java `Class<?>` runtime type. |
| Screen CRW03407SF | Screen | The external connection URL history screen component that manages display and input of URL-related data. |

---
