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

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.FUW00116SF.FUW00116SF03DBean` |
| Layer | Web View Bean (Controller / Presentation Layer) |
| Module | `FUW00116SF` (Package: `eo.web.webview.FUW00116SF`) |

## 1. Role

### FUW00116SF03DBean.typeModelData()

This method serves as a **data type resolver** within the web view presentation layer, enabling dynamic type-ahead and form-binding infrastructure for the Futurity X33 web framework. It answers the question: "Given a field name (key) and a sub-property name (subkey), what Java class should the framework use to model this data?" The method implements the `X33VDataTypeBeanInterface.typeModelData` contract, which is invoked by the X33 framework's bean introspection mechanism during view rendering and data binding.

The method handles two **service data categories**: (1) **Mail Detail Code** (メール明細コード) — representing a mail/notice detail identifier field, and (2) **Detail Body Non-Standard Replacement Character** (明細本文非定型置換文字) — representing a configurable replacement character used in body text processing. Both categories are modeled as `String` type data, reflecting that they carry textual information in the business domain.

The method uses a **routing/dispatch design pattern**: it branches on the `key` parameter to determine which data category is being queried, then further dispatches on the `subkey` to determine which sub-property's type is needed (`value` for the actual data, `state` for validation/conversion state). This dual-level dispatch supports the framework's convention of storing both the data value and its transformation metadata in separate bean fields.

In the larger system, this method is a **shared utility called by many screens** — it is invoked by the X33 framework's bean introspection machinery whenever a view page needs to understand the data type of a field for proper input rendering, data conversion, and form-backing. Multiple other modules (FUW00912SF, FUW00926SF, FUW00959SF, FUW00964SF) each define their own `typeModelData` implementations following the same pattern, confirming this is a standard X33 framework integration method.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["typeModelData key, subkey"])
    COND_NULL{"key == null<br/>|| subkey == null"}
    SEP["int separaterPoint = key.indexOf('/')"]
    COND_MAIL{"key equals<br/>'メール明細コード'"}
    MAIL_VALUE{"subkey equalsIgnoreCase<br/>'value'"}
    MAIL_STATE{"subkey equalsIgnoreCase<br/>'state'"}
    MAIL_RETURN["return String.class"]
    COND_DTL{"key equals<br/>'明細本文非定型置換文字'"}
    DTL_VALUE{"subkey equalsIgnoreCase<br/>'value'"}
    DTL_STATE{"subkey equalsIgnoreCase<br/>'state'"}
    DTL_RETURN["return String.class"]
    DEFAULT["return null"]

    START --> COND_NULL
    COND_NULL -->|true| DEFAULT
    COND_NULL -->|false| SEP
    SEP --> COND_MAIL
    COND_MAIL -->|true| MAIL_VALUE
    COND_MAIL -->|false| COND_DTL
    MAIL_VALUE -->|true| MAIL_RETURN
    MAIL_VALUE -->|false| MAIL_STATE
    MAIL_STATE -->|true| MAIL_RETURN
    MAIL_STATE -->|false| DEFAULT
    COND_DTL -->|true| DTL_VALUE
    COND_DTL -->|false| DEFAULT
    DTL_VALUE -->|true| DTL_RETURN
    DTL_VALUE -->|false| DTL_STATE
    DTL_STATE -->|true| DTL_RETURN
    DTL_STATE -->|false| DEFAULT
```

**Processing flow:**

1. **Null guard** (L246-L249): If either `key` or `subkey` is null, immediately return `null` to prevent NullPointerException.
2. **Separator detection** (L251): Compute the position of "/" within the key. This value is stored in `separaterPoint` but **never used** — this is dead code (likely a remnant from a previous iteration where key parsing was planned).
3. **Mail Detail Code branch** (L255-L265): If `key` equals "メール明細コード" (Mail Detail Code), check whether `subkey` is "value" (returns `String.class` for the actual data) or "state" (returns `String.class` for the conversion/validation state metadata).
4. **Detail Body Replacement Character branch** (L269-L279): If `key` equals "明細本文非定型置換文字" (Detail Body Non-Standard Replacement Character), similarly check for "value" or "state" subkeys.
5. **Default fallback** (L282): If no condition matches, return `null` — indicating no typed data is associated with this key/subkey combination.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `key` | `String` | **Field name** — identifies which business data category the caller is querying. Valid values: "メール明細コード" (Mail Detail Code — a field holding a mail/notice identifier) or "明細本文非定型置換文字" (Detail Body Non-Standard Replacement Character — a configurable replacement character used in detail body text processing). The key determines which processing branch is taken. |
| 2 | `subkey` | `String` | **Sub-property name** — specifies which sub-field within the identified category is being queried. Valid values: "value" (the actual data value of the field) or "state" (the conversion/validation state metadata associated with the field). Case-insensitive comparison is used. |

**Instance fields read by this method:**

None. This method is a pure function — it reads no instance fields. However, the bean it belongs to declares the following related instance fields that correspond to the resolved types:

| Field Name | Type | Business Description |
|------------|------|---------------------|
| `mail_dtl_cd_update` | `String` | Update flag for the mail detail code field |
| `mail_dtl_cd_value` | `String` | Actual value of the mail detail code (default: empty string) |
| `mail_dtl_cd_state` | `String` | Conversion/validation state of the mail detail code (default: empty string) |
| `dtl_text_htk_ckam_moji_update` | `String` | Update flag for the detail body replacement character field |
| `dtl_text_htk_ckam_moji_value` | `String` | Actual value of the replacement character (default: empty string) |
| `dtl_text_htk_ckam_moji_state` | `String` | Conversion/validation state of the replacement character (default: empty string) |

## 4. CRUD Operations / Called Services

This method contains **no CRUD operations** and calls **no external services**. It is a pure type-introspection method that returns Java type information without reading from or writing to any data store.

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| *(none)* | — | — | — | This method performs no data access. It is a framework callback that resolves Java types for X33 view data binding. |

## 5. Dependency Trace

This method is invoked by the X33 framework's bean introspection system. The search across the codebase reveals that the `typeModelData` method signature is implemented across many screen modules (FUW00912SF, FUW00926SF, FUW00959SF, FUW00964SF), indicating this is a **standard framework integration point**. No direct callers of the `FUW00116SF03DBean.typeModelData` method were found in the FUW00116SF module itself, confirming it is called indirectly through the X33 framework's reflection-based bean introspection.

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Framework: X33 View Bean Introspection | `X33VViewBaseBean` introspection -> `X33VDataTypeBeanInterface.typeModelData` | *(none — pure type resolver)* |

**Cross-module callers (same method signature pattern):**

The following modules implement the same `typeModelData(String key, String subkey)` pattern, confirming this is a standardized X33 framework integration method:

| Module | DBean Class | Context |
|--------|-------------|---------|
| FUW00912SF | `FUW00912SF01DBean`, `FUW00912SFBean`, `FUW00912SF02DBean` | Date/year/month/day type resolution |
| FUW00926SF | `FUW00926SFBean`, `FUW00926SF01DBean`, `FUW00926SF02DBean`, `FUW00926SF03DBean` | TV/subscriber info, item code/value resolution |
| FUW00959SF | `FUW00959SFBean`, `FUW00959SF01DBean`-`FUW00959SF04DBean` | Campaign, text, and special campaign list resolution |
| FUW00964SF | `FUW00964SFBean`, `FUW00964SF01DBean`-`FUW00964SF11DBean` | Pricing, modem, and service detail info resolution |

## 6. Per-Branch Detail Blocks

### Block 1 — IF (null guard) `(L246)`

> If either key or subkey is null, return null immediately to prevent errors downstream.

| # | Type | Code |
|---|------|------|
| 1 | IF | `if (key == null || subkey == null)` |
| 2 | RETURN | `return null;` // 項目名、サブキーがnullの場合、nullを返す (Returns null if field name or subkey is null) |

### Block 2 — SET (separator position computation) `(L251)`

> Computes the position of "/" within the key. This value is assigned but **never used** — dead code.

| # | Type | Code |
|---|------|------|
| 1 | SET | `int separaterPoint = key.indexOf("/");` // 区切り位置の取得 (Acquires delimiter position — unused) |

### Block 3 — IF/ELSE-IF (main dispatch) `(L255)`

> Routes processing based on the field name. Handles two data categories: Mail Detail Code and Detail Body Non-Standard Replacement Character.

| # | Type | Code |
|---|------|------|
| 1 | IF | `if (key.equals("メール明細コード"))` [メール明細コード = "メール明細コード" (Mail Detail Code)] |
| 2 | SET | `separaterPoint` computed at L251, not used in any branch |
| 3 | ELSE-IF | `else if (key.equals("明細本文非定型置換文字"))` [明細本文非定型置換文字 = "明細本文非定型置換文字" (Detail Body Non-Standard Replacement Character)] |
| 4 | RETURN | `return null;` // 条件に一致するプロパティが存在しない場合は、nullを返す (Returns null if no matching property exists) |

#### Block 3.1 — IF/ELSE-IF (Mail Detail Code subkey dispatch) `(L255)`

> When the key is "メール明細コード" (Mail Detail Code), determine which sub-property type is requested.

| # | Type | Code |
|---|------|------|
| 1 | IF | `if (subkey.equalsIgnoreCase("value"))` [value = "value" — the actual data value] |
| 2 | RETURN | `return String.class;` // メール明細コードの値はString型 (Mail detail code value is String type) |
| 3 | ELSE-IF | `else if (subkey.equalsIgnoreCase("state"))` [state = "state" — validation/conversion state] |
| 4 | RETURN | `return String.class;` // subkeyが"state"の場合、ステータスを返す。 (When subkey is "state", returns the status) |

#### Block 3.2 — IF/ELSE-IF (Detail Body Replacement Character subkey dispatch) `(L269)`

> When the key is "明細本文非定型置換文字" (Detail Body Non-Standard Replacement Character), determine which sub-property type is requested.

| # | Type | Code |
|---|------|------|
| 1 | IF | `if (subkey.equalsIgnoreCase("value"))` [value = "value" — the actual data value] |
| 2 | RETURN | `return String.class;` // 明細本文非定型置換文字の値はString型 (Detail body replacement character value is String type) |
| 3 | ELSE-IF | `else if (subkey.equalsIgnoreCase("state"))` [state = "state" — validation/conversion state] |
| 4 | RETURN | `return String.class;` // subkeyが"state"の場合、ステータスを返す。 (When subkey is "state", returns the status) |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `mail_dtl_cd` | Field | Mail detail code — a field identifier for the mail/notice detail code in the X33 bean model |
| `dtl_text_htk_ckam_moji` | Field | Detail body non-standard replacement character — a configurable character used as a placeholder in detail body text processing (HTK = 置換, CKAM = 文字 — replacement character) |
| `mail_dtl_cd_update` | Field | Update flag for the mail detail code — indicates whether the mail detail code field has been modified |
| `mail_dtl_cd_value` | Field | Actual data value stored in the mail detail code field |
| `mail_dtl_cd_state` | Field | Conversion/validation state of the mail detail code — holds the result of data transformation or validation |
| `dtl_text_htk_ckam_moji_update` | Field | Update flag for the detail body replacement character field |
| `dtl_text_htk_ckam_moji_value` | Field | Actual data value stored in the replacement character field |
| `dtl_text_htk_ckam_moji_state` | Field | Conversion/validation state of the replacement character field |
| メール明細コード | Field (Japanese) | Mail Detail Code — identifies a specific mail/notice detail record in the system |
| 明細本文非定型置換文字 | Field (Japanese) | Detail Body Non-Standard Replacement Character — a placeholder character used in body text processing that can be configured per deployment |
| key | Parameter | Field name — the business identifier of the data field being queried |
| subkey | Parameter | Sub-property name — specifies whether `value` (the actual data) or `state` (conversion/validation metadata) is being queried |
| X33VDataTypeBeanInterface | Interface | Futurity X33 framework interface for beans that can report their data types dynamically |
| X33 | Framework | Futurity X33 — Fujitsu's web application framework providing view bean infrastructure, data binding, and type introspection |
| value | Subkey | The actual data value of a field |
| state | Subkey | The conversion/validation state metadata associated with a field — used by the framework to track whether data has been successfully transformed |
