# Business Logic -- FUW00114SF02DBean.typeModelData() [23 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.FUW00114SF.FUW00114SF02DBean` |
| Layer | Web / View (Framework Bean -- part of the Fujitsu Futurity X33 web framework tier) |
| Module | `FUW00114SF` (Package: `eo.web.webview.FUW00114SF`) |

## 1. Role

### FUW00114SF02DBean.typeModelData()

This method serves as a **type resolution router** within the K-Opticom web application framework (Fujitsu Futurity X33). Its business purpose is to map a field name (`key`) and sub-key (`subkey`) pair to the corresponding Java data type (`Class<?>`) for the "本文非定型置換文字" (Freestyle Replacement Text) data item -- a field used in the FUW00114SF screen for flexible, free-form text substitution (e.g., custom message body content or user-defined text templates).

The method implements a **routing/dispatch design pattern**: given a string-based field identifier, it determines the appropriate type so that the X33 framework's dynamic data binding mechanism can correctly initialize or validate the associated form field at runtime. Currently, it only resolves types for the freestyle replacement text item, which has two sub-properties: a `value` subkey (returning the text content as `String.class`) and a `state` subkey (returning the edit/state status as `String.class`).

It acts as a **shared utility** within the web layer -- the X33 framework likely calls this method during view initialization or data loading to dynamically discover the type of each field defined on the page. If the key does not match a known field, or if the subkey is unrecognized, the method returns `null`, signaling to the framework that no type mapping exists (which may cause the framework to use a default or skip the field).

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["typeModelData(key, subkey)"])

    START --> COND_NULL["key == null || subkey == null"]

    COND_NULL --> Yes1["Yes"]
    COND_NULL --> No1["No"]
    Yes1 --> RET_NULL_1["return null"]
    No1 --> FIND_SLASH["int separaterPoint = key.indexOf('/')"]

    FIND_SLASH --> COND_KEY{key equals 本文非定型置換文字}

    COND_KEY -->|Yes| COND_SUB_VALUE{subkey equals value}
    COND_KEY -->|No| RET_NULL_2["return null"]

    COND_SUB_VALUE -->|Yes| RET_STRING_VALUE["return String.class"]
    COND_SUB_VALUE -->|No| COND_SUB_STATE{subkey equals state}

    COND_SUB_STATE -->|Yes| RET_STRING_STATE["return String.class"]
    COND_SUB_STATE -->|No| RET_NULL_2
```

**Processing steps:**

1. **Null guard:** If either `key` or `subkey` is null, return null immediately. (項目名とサブキーがnullの場合、nullを返す)
2. **Separator scan:** Compute the index of `/` in `key`. The result is stored in `separaterPoint` but is currently unused -- it may have been intended for future hierarchical key parsing.
3. **Key dispatch:** Check if `key` exactly equals "本文非定型置換文字" (Freestyle Replacement Text). This is the only field name currently handled by this method.
4. **Subkey dispatch (when key matches):**
   - If `subkey` equals "value" (case-insensitive), return `String.class` -- the data type for the replacement text content.
   - If `subkey` equals "state" (case-insensitive), return `String.class` -- the data type for the field's state/metadata.
   - (subkeyが"state"の場合、ステータスを返す)
5. **Fallback:** If no condition matches, return null -- no type mapping found for this key/subkey pair.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `key` | `String` | Field name / item identifier. Represents the business field being queried for its type. Currently only "本文非定型置換文字" (Freestyle Replacement Text) is recognized. This is the primary dispatch key for the routing logic. |
| 2 | `subkey` | `String` | Sub-field identifier within the main key. Distinguishes between the content property (`value` -- the actual text) and the metadata/status property (`state`). Case-insensitive comparison is used. |

**No instance fields or external state are read by this method.** It is a pure function depending solely on its two input parameters.

## 4. CRUD Operations / Called Services

This method performs **no database or service component calls**. It is a pure type-resolution utility with no data access operations.

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| -- | -- | -- | -- | -- |

## 5. Dependency Trace

No callers were found in the codebase for `typeModelData()`. This method is likely invoked **indirectly through the X33 framework's reflection-based bean initialization** mechanism (via the `X33VViewBaseBean` parent class) rather than through explicit Java method calls in the codebase. The Futurity X33 framework's `X33VDataTypeList` and `X33VListedBeanInterface` imports on lines 4-6 of the class suggest this method is part of a framework callback contract that the framework itself invokes during view model loading.

## 6. Per-Branch Detail Blocks

**Block 1** -- IF (null guard) (L199)

> Null check on input parameters. If either parameter is null, return null. (key,subkeyがnullの場合、nullを返す)

| # | Type | Code |
|---|------|------|
| 1 | IF | `if(key == null || subkey == null)` |
| 2 | RETURN | `return null;` |

**Block 2** -- EXEC (separator scan) (L202)

> Compute the index of `/` within the key string. The result is stored but unused in the current implementation.

| # | Type | Code |
|---|------|------|
| 1 | SET | `int separaterPoint = key.indexOf("/");` |

**Block 3** -- IF (key dispatch for 本文非定型置換文字) (L206)

> Dispatch on the field name "本文非定型置換文字" (Freestyle Replacement Text). This is the only field currently recognized. (項目ごとに処理を入れる。)

| # | Type | Code |
|---|------|------|
| 1 | IF | `if(key.equals("本文非定型置換文字"))` |
| 2 | -- | -- |

**Block 3.1** -- IF (subkey = "value") (L207)

> When the subkey is "value", the method returns the type for the replacement text content.

| # | Type | Code |
|---|------|------|
| 1 | IF | `if(subkey.equalsIgnoreCase("value"))` |
| 2 | RETURN | `return String.class;` |

**Block 3.2** -- ELSE IF (subkey = "state") (L210)

> When the subkey is "state", return the type for the field's state/metadata. (subkeyが"state"の場合、ステータスを返す)

| # | Type | Code |
|---|------|------|
| 1 | ELSE IF | `else if(subkey.equalsIgnoreCase("state"))` |
| 2 | RETURN | `return String.class;` |

**Block 3.3** -- implicit ELSE (unrecognized subkey)

> If neither "value" nor "state" matches, execution falls through past this if-block.

**Block 4** -- RETURN (fallback) (L214)

> If no condition matched, return null. (条件に合致するプロパティが存在しない場合は、nullを返す。)

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return null;` |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `本文非定型置換文字` | Field | Freestyle Replacement Text -- a free-form text substitution field used in the FUW00114SF screen, allowing dynamic text content replacement in documents or messages |
| X33 Framework | Technical | Fujitsu Futurity X33 -- a Java-based web application framework used for building K-Opticom's web screens, providing bean lifecycle management and dynamic data binding |
| `key` | Parameter | Field name identifier used by the framework to locate and type-check form fields |
| `subkey` | Parameter | Sub-field identifier distinguishing properties (e.g., content vs. state) of a field |
| DBean | Technical | Design Bean -- a view-tier bean in the X33 framework that defines the data structure and type model for a screen's form fields |
| `value` | Subkey | The data content property of a field -- the actual text or data value |
| `state` | Subkey | The status/metadata property of a field -- typically used to track edit state, validation state, or lifecycle status |
