# Business Logic — CRW03407SF03DBean.typeModelData() [85 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.CRW03407SF.CRW03407SF03DBean` |
| Layer | Controller (webview / Presentation Bean — implements X33V framework interfaces `X33VDataTypeBeanInterface`, `X33VListedBeanInterface`) |
| Module | `CRW03407SF` (Package: `eo.web.webview.CRW03407SF`) |

## 1. Role

### CRW03407SF03DBean.typeModelData()

This method serves as the X33V framework's type-resolution callback for the CRW03407SF screen's data-binding layer. The X33V framework (Fujitsu's web client generation tool) calls `typeModelData` at runtime to determine the Java data type of each UI-bound field before it renders or validates input. The method implements a **routing/dispatch pattern**: it receives a `key` (the Japanese field label) and a `subkey` (the metadata property name), then returns the appropriate `Class<?>` — either `String.class`, `Boolean.class`, or `null` when the field is not configured.

Six distinct UI field categories are handled, each corresponding to a detail-grid column definition on the screen. For the first four fields (Detail Index, Campaign Code, Campaign Name, Applicable Month), the method supports three subkey variants: `value` (the field's data value as String), `enable` (whether the field is editable as Boolean), and `state` (a status/state string). The last two fields (Row Style Class, Row Style ID) are read-only styling properties and only support `value` and `state` subkeys — no `enable` subkey.

If either parameter is `null`, or if the `key` does not match any of the six registered field labels, the method returns `null`, signaling to the X33V framework that the field should be skipped. This method performs **no CRUD operations**, no external service calls, and no side effects — it is a pure, stateless type-dispatch lookup.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["typeModelData key, subkey"])
    CHECK_NULL{"key or subkey
is null?"}
    SEP{"key contains '/'
(separator)?"}

    CHECK_DETAILS{"key equals
'明細インデックス'?"}
    SUB_DETAILS{"subkey equals
'value'/'enable'/'state'?"}

    CHECK_CAMPCODE{"key equals
'キャンペーンコード'?"}
    SUB_CAMPCODE{"subkey equals
'value'/'enable'/'state'?"}

    CHECK_CAMNAME{"key equals
'キャンペーン名'?"}
    SUB_CAMNAME{"subkey equals
'value'/'enable'/'state'?"}

    CHECK_MONTH{"key equals
'適用月'?"}
    SUB_MONTH{"subkey equals
'value'/'enable'/'state'?"}

    CHECK_STYLECLASS{"key equals
'行スタイルクラス'?"}
    SUB_STYLECLASS{"subkey equals
'value'/'state'?"}

    CHECK_STYLEID{"key equals
'行スタイルID'?"}
    SUB_STYLEID{"subkey equals
'value'/'state'?"}

    RETURN_NULL(["return null"])

    START --> CHECK_NULL
    CHECK_NULL -->|Yes| RETURN_NULL
    CHECK_NULL -->|No| SEP
    SEP -->|No| CHECK_DETAILS
    SEP -->|Yes| CHECK_DETAILS

    CHECK_DETAILS -->|Yes| SUB_DETAILS
    SUB_DETAILS -->|value| RET_STR_V["return String.class"]
    SUB_DETAILS -->|enable| RET_BOOL["return Boolean.class"]
    SUB_DETAILS -->|state| RET_STR_S["return String.class"]

    CHECK_DETAILS -->|No| CHECK_CAMPCODE
    CHECK_CAMPCODE -->|Yes| SUB_CAMPCODE
    SUB_CAMPCODE -->|value| RET_STR_V2["return String.class"]
    SUB_CAMPCODE -->|enable| RET_BOOL2["return Boolean.class"]
    SUB_CAMPCODE -->|state| RET_STR_S2["return String.class"]

    CHECK_CAMPCODE -->|No| CHECK_CAMNAME
    CHECK_CAMNAME -->|Yes| SUB_CAMNAME
    SUB_CAMNAME -->|value| RET_STR_V3["return String.class"]
    SUB_CAMNAME -->|enable| RET_BOOL3["return Boolean.class"]
    SUB_CAMNAME -->|state| RET_STR_S3["return String.class"]

    CHECK_CAMNAME -->|No| CHECK_MONTH
    CHECK_MONTH -->|Yes| SUB_MONTH
    SUB_MONTH -->|value| RET_STR_V4["return String.class"]
    SUB_MONTH -->|enable| RET_BOOL4["return Boolean.class"]
    SUB_MONTH -->|state| RET_STR_S4["return String.class"]

    CHECK_MONTH -->|No| CHECK_STYLECLASS
    CHECK_STYLECLASS -->|Yes| SUB_STYLECLASS
    SUB_STYLECLASS -->|value| RET_STR_V5["return String.class"]
    SUB_STYLECLASS -->|state| RET_STR_S5["return String.class"]

    CHECK_STYLECLASS -->|No| CHECK_STYLEID
    CHECK_STYLEID -->|Yes| SUB_STYLEID
    SUB_STYLEID -->|value| RET_STR_V6["return String.class"]
    SUB_STYLEID -->|state| RET_STR_S6["return String.class"]

    CHECK_STYLEID -->|No| RETURN_NULL
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `key` | `String` | The Japanese field label of the data binding field on the X33V screen. Determines which of the six registered field categories the type lookup should resolve. Valid values: `明細インデックス` (Detail Index, internal grid row identifier), `キャンペーンコード` (Campaign Code, the service campaign identifier displayed as `l2_dsp_campaign_cd`), `キャンペーン名` (Campaign Name, the service campaign name displayed as `l2_wrib_svc_nm`), `適用月` (Applicable Month, the service term start month displayed as `l2_wrib_svc_tstaymd`), `行スタイルクラス` (Row Style Class, CSS class for row styling displayed as `l2_line_style_class`), `行スタイルID` (Row Style ID, CSS ID for row styling displayed as `l2_line_style_id`). Also accepts a slash-separated format like `key/index` for indexed field access. |
| 2 | `subkey` | `String` | The metadata property name within the matched field category. For most fields, valid values are `value` (returns the data type for the field's primary data, i.e. `String.class`), `enable` (returns the data type for the field's enabled/disabled state, i.e. `Boolean.class`), or `state` (returns the data type for the field's state/status, i.e. `String.class`). For the two row-styling fields (`行スタイルクラス`, `行スタイルID`), only `value` and `state` subkeys are supported — no `enable` variant. |

**Instance fields read by this method:** None. The method is purely stateless — it performs string comparisons and returns `Class<?>` objects without accessing any instance fields.

## 4. CRUD Operations / Called Services

This method performs **no CRUD operations**. It does not call any Service Components (SC), Call Back Services (CBS), DAOs, or database layer methods. It is a pure, read-only type-dispatch utility with no side effects.

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

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Screen:CCW00203SF | `CCW00203SFBean.typeModelData(gamenId, key, subkey)` -> `typeModelData(key, subkey)` -> `CRW03407SF03DBean.typeModelData` | *(none — pure type lookup)* |

**Note:** This method is a framework callback invoked by the X33V framework infrastructure at runtime. The only direct code-level caller found is `CCW00203SFBean`, which provides a three-argument overload (`gamenId`, `key`, `subkey`) that delegates to the two-argument `typeModelData(key, subkey)` method. The `gamenId` parameter is unused (marked as `予備` / "reserved" in Javadoc). It is expected that the X33V view framework also invokes this method directly via reflection or interface dispatch during screen initialization and data-binding resolution.

## 6. Per-Branch Detail Blocks

**Block 1** — IF (null check) `(key == null || subkey == null)` (L493)

> Returns null if either parameter is null — early guard against invalid calls.

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

**Block 2** — EXEC (separator check) `key.indexOf("/")` (L496)

> Computes the position of the '/' separator in the key for slash-separated field identification format. The result is stored in `separaterPoint` but the variable is not used within this method's scope — the slash logic is documented in the parent class javadoc for the framework contract.

| # | Type | Code |
|---|------|------|
| 1 | SET | `int separaterPoint = key.indexOf("/");` // locate slash separator in key [L496] |

**Block 3** — IF-ELSE chain (key routing) (L500–L567)

> Core dispatch logic: branches on the Japanese field label to determine the data type mapping. Each top-level IF/ELSE-IF checks a specific key.

**Block 3.1** — IF [key equals `明細インデックス` (Detail Index)] (L500)

> Matches the detail index field, which serves as the internal row identifier for the detail grid.

| # | Type | Code |
|---|------|------|
| 1 | IF (nested) | `subkey.equalsIgnoreCase("value")` -> `return String.class;` [L501-502] |
| 2 | ELSE-IF | `subkey.equalsIgnoreCase("enable")` -> `return Boolean.class;` [L503-504] |
| 3 | ELSE-IF | `subkey.equalsIgnoreCase("state")` -> `return String.class;` // Returns state status when subkey is "state" (subkeyが"state"の場合、ステータスを返す。) [L505-507] |

**Block 3.2** — ELSE-IF [key equals `キャンペーンコード` (Campaign Code)] (L510)

> Matches the campaign code field, displayed as the internal field `l2_dsp_campaign_cd`. Used for display/identification of promotional campaigns in service records.

| # | Type | Code |
|---|------|------|
| 1 | IF (nested) | `subkey.equalsIgnoreCase("value")` -> `return String.class;` [L511-512] |
| 2 | ELSE-IF | `subkey.equalsIgnoreCase("enable")` -> `return Boolean.class;` [L513-514] |
| 3 | ELSE-IF | `subkey.equalsIgnoreCase("state")` -> `return String.class;` // Returns state status when subkey is "state" (subkeyが"state"の場合、ステータスを返す。) [L515-517] |

**Block 3.3** — ELSE-IF [key equals `キャンペーン名` (Campaign Name)] (L520)

> Matches the campaign name field, displayed as the internal field `l2_wrib_svc_nm`. Holds the display name of a promotional service campaign.

| # | Type | Code |
|---|------|------|
| 1 | IF (nested) | `subkey.equalsIgnoreCase("value")` -> `return String.class;` [L521-522] |
| 2 | ELSE-IF | `subkey.equalsIgnoreCase("enable")` -> `return Boolean.class;` [L523-524] |
| 3 | ELSE-IF | `subkey.equalsIgnoreCase("state")` -> `return String.class;` // Returns state status when subkey is "state" (subkeyが"state"の場合、ステータスを返す。) [L525-527] |

**Block 3.4** — ELSE-IF [key equals `適用月` (Applicable Month)] (L530)

> Matches the applicable month field, displayed as the internal field `l2_wrib_svc_tstaymd`. Represents the start month (YYYYMM format) of the service term for a campaign.

| # | Type | Code |
|---|------|------|
| 1 | IF (nested) | `subkey.equalsIgnoreCase("value")` -> `return String.class;` [L531-532] |
| 2 | ELSE-IF | `subkey.equalsIgnoreCase("enable")` -> `return Boolean.class;` [L533-534] |
| 3 | ELSE-IF | `subkey.equalsIgnoreCase("state")` -> `return String.class;` // Returns state status when subkey is "state" (subkeyが"state"の場合、ステータスを返す。) [L535-537] |

**Block 3.5** — ELSE-IF [key equals `行スタイルクラス` (Row Style Class)] (L540)

> Matches the row style CSS class field, displayed as the internal field `l2_line_style_class`. Used to apply CSS styling classes to detail grid rows. **No `enable` subkey** — rows are styled but not directly toggled.

| # | Type | Code |
|---|------|------|
| 1 | IF (nested) | `subkey.equalsIgnoreCase("value")` -> `return String.class;` [L541-542] |
| 2 | ELSE-IF | `subkey.equalsIgnoreCase("state")` -> `return String.class;` // Returns state status when subkey is "state" (subkeyが"state"の場合、ステータスを返す。) [L543-545] |

**Block 3.6** — ELSE-IF [key equals `行スタイルID` (Row Style ID)] (L548)

> Matches the row style CSS ID field, displayed as the internal field `l2_line_style_id`. Used to assign a unique CSS ID to detail grid rows for targeted styling. **No `enable` subkey** — rows are styled but not directly toggled.

| # | Type | Code |
|---|------|------|
| 1 | IF (nested) | `subkey.equalsIgnoreCase("value")` -> `return String.class;` [L549-550] |
| 2 | ELSE-IF | `subkey.equalsIgnoreCase("state")` -> `return String.class;` // Returns state status when subkey is "state" (subkeyが"state"の場合、ステータスを返す。) [L551-553] |

**Block 4** — RETURN (default) (L557)

> No matching key found in the condition chain. Returns null to indicate the field is not configured in this bean.

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

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `key` | Parameter | Field name — the Japanese label used to identify which X33V data-binding field to resolve the type for |
| `subkey` | Parameter | Sub-key — the metadata property name (`value`, `enable`, `state`) within a field, specifying which aspect of the field's type metadata to return |
| `l2_detail_index` | Field | Detail index — internal row identifier for the detail grid in the X33V view bean. Corresponds to screen fields for record positioning. |
| `l2_dsp_campaign_cd` | Field | DSP campaign code — display/service campaign code identifier. Used to track promotional campaigns in service records. |
| `l2_wrib_svc_nm` | Field | WRIB service name — campaign/service name displayed on the screen. "WRIB" is an internal service abbreviation. |
| `l2_wrib_svc_tstaymd` | Field | WRIB service term start month — the start month (YYYYMM format) of the service term for a campaign. "tstaymd" = term stay month date. |
| `l2_line_style_class` | Field | Row style CSS class — the CSS class name applied to detail grid rows for visual styling (e.g., highlighted, alternate-row coloring). |
| `l2_line_style_id` | Field | Row style CSS ID — the unique CSS ID assigned to individual detail grid rows for targeted styling via JavaScript or CSS selectors. |
| X33V | Framework | Fujitsu's X33V web client generation framework — a Java EE-based view framework that handles data binding, screen rendering, and form validation. Implements interfaces `X33VDataTypeBeanInterface` and `X33VListedBeanInterface` for type-aware binding. |
| `X33VDataTypeBeanInterface` | Interface | X33V framework interface requiring `typeModelData` implementation. Called at runtime to resolve the Java type of each bound field. |
| `X33VListedBeanInterface` | Interface | X33V framework interface for beans that represent list/detail grid rows. |
| `value` | Subkey | Returns the data type for the field's primary data value (always `String.class` in this method). |
| `enable` | Subkey | Returns the data type for the field's enabled/disabled toggle state (always `Boolean.class` in this method). Not available for row-style fields. |
| `state` | Subkey | Returns the data type for the field's status/state indicator (always `String.class` in this method). |
| 明細インデックス | Japanese field | Detail Index — internal row identifier for the detail grid. Used for record ordering and manipulation. |
| キャンペーンコード | Japanese field | Campaign Code — the service campaign/promotion code displayed to operators. Maps to `l2_dsp_campaign_cd`. |
| キャンペーン名 | Japanese field | Campaign Name — the human-readable name of a service campaign/promotion. Maps to `l2_wrib_svc_nm`. |
| 適用月 | Japanese field | Applicable Month — the effective start month of a service term. Maps to `l2_wrib_svc_tstaymd`. |
| 行スタイルクラス | Japanese field | Row Style Class — CSS class name for styling detail grid rows. Maps to `l2_line_style_class`. |
| 行スタイルID | Japanese field | Row Style ID — CSS ID for uniquely identifying detail grid rows for styling. Maps to `l2_line_style_id`. |
