# KKW21502SFBean

## Purpose

`KKW21502SFBean` is the central data carrier (often called a "bean" in this codebase) for a contract management screen within a Japanese web application. It aggregates a large set of input/output fields — covering customer information, shop (store) details, contact numbers, and pricing for three distinct service channels (NET, TEL, TV) — and passes them between JSP views, XML-based screen definitions, and the backing logic. This bean is the single source of truth for the state of the 21502-series screen (SF = probably "Screen Form" or "Show Form").

## Design

This class follows the **Model-View-Controller (MVC) model** pattern, specifically acting as the **Model (data) side** of an MVC screen bean. It extends `X33VViewBaseBean` (the framework's base view bean), and implements three marker interfaces:

- `X33VListedBeanInterface` — likely signals that this bean participates in list/screen operations.
- `X31CBaseBean` — likely provides base contract or common behavior for screen beans.
- `Serializable` — enables the bean to be serialized across network tiers (e.g., from a servlet container to a business logic layer).

The class has no outbound dependencies of its own — it is a pure data structure. All logic is in separate classes (`KKW21502SFLogic`, `KKW21502SFChecker`, `KKW21502SFConst`) in the same package.

```mermaid
classDiagram
    direction TB
    KKW21502SFBean *-- X33VViewBaseBean : extends
    KKW21502SFBean ..|> X33VListedBeanInterface : implements
    KKW21502SFBean ..|> X31CBaseBean : implements
    KKW21502SFBean ..|> Serializable : implements
    class KKW21502SFBean {
        -String tran_div_value
        -String knytcs_no_value
        -String sysid_value
        -String same_kaisen_grp_skbt_no_value
        -String sohus_nm_value
        -String sohus_pcd1_value
        -String sohus_pcd2_value
        -String sohus_pcd_value
        -String sohus_pcd_hy_value
        -Boolean jyusho_search_chk1_value
        -String sohus_state_nm_value
        -String sohus_city_nm_value
        -String sohus_oaztsu_nm_value
        -String sohus_azcho_nm_value
        -String sohus_bnchigo_value
        -String sohus_adrttm_value
        -String sohus_adrrm_value
        -String hakko_ymd_value
        -String knytcs_mngo_value
        -String kei_seirt_ymd_value
        -String cust_cust_nm_value
        -String cust_keisha_ad_value
        -String ryobsy_ad_value
        -String svc_tk_sta_jiki_value
        -String net_mskm_no_value
        -String net_corse_value
        -String net_wrib_svc_value
        -String net_op_svc_value
        -String net_aply_cp_value
        -String net_knyhen_can_value
        -String tel_mskm_no_value
        -String tel_corse_value
        -String tel_wrib_svc_value
        -String tel_aply_cp_value
        -String tel1_tel_no_value
        -String tel1_op_svc_value
        -String tel2_tel_no_value
        -String tel2_op_svc_value
        -String tv_mskm_no_value
        -String tv_wrib_svc_value
        -String tv_aply_cp_value
        -String tv_op_svc_value
        -String tv1_title_value ... tv5_dtl_value
        -String tv_kynyh_jyoko_value
        -String pay_way_value
        -String net_prc_kihonprc_dtl_value
        -String net_stdard_kojihi_value
        -String net_commision_value
        -String net_prc_wribsvc_dtl_value
        -String net_prc_cp_dtl_value
        -String tel_prc_kihonprc_dtl_value
        -String tel_stdard_kojihi_value
        -String tel_commision_value
        -String tel_prc_wribsvc_dtl_value
        -String tel_prc_cp_dtl_value
        -String tv1_prc_title_value ... tv5_prc_dtl_value
        -String tv_stdard_kojihi_value
        -String tv_commision_value
        -String tv_prc_wribsvc_dtl_value
        -String tv_prc_cp_dtl_value
        -String kanuoreso_dofu_ctrl_cd_value
        -String letter_hasso_shiwake_div_value
        -String dlyd_trn_req_sbt_cd_value
        -String knytcs_kohu_way_cd_value
        -String knytcs_print_jssi_sk_cd_value
        -String knytcs_sohus_ad_cd_value
        -String knytcs_sohus_telno_value
        -String ido_div_value
        -String knytcs_print_reqymd_value
        -String upd_dtm_value
        -String teise_upd_dtm_value
        +KKW21502SFBean()
        +typeModelData(String, String, String) Class~?~
        +typeModelData(String, String) Class~?~
        +getTran_div_value() String
        +setTran_div_value(String) void
        +getKnytcs_no_value() String
        +setKnytcs_no_value(String) void
        +getSysid_value() String
        +setSysid_value(String) void
        +getSohus_nm_value() String
        +setSohus_nm_value(String) void
        +getPay_way_value() String
        +setPay_way_value(String) void
        +getDlyd_trn_req_sbt_cd_value() String
        +setDlyd_trn_req_sbt_cd_value(String) void
    }
```

```mermaid
flowchart TD
    subgraph Consumers["Consumers of KKW21502SFBean"]
        direction TB
        JSP1["KKW215020PJP.jsp"]
        JSP2["KKW215030PJP.jsp"]
        XML1["WEBGAMEN_KKW215020PJP.xml"]
        XML2["WEBGAMEN_KKW215030PJP.xml"]
        XML3["WEBGAMEN_KKW215040PJP.xml"]
    end

    JSP1 --> KKW21502SFBean
    JSP2 --> KKW21502SFBean
    XML1 --> KKW21502SFBean
    XML2 --> KKW21502SFBean
    XML3 --> KKW21502SFBean

    subgraph Package["eo.web.webview.KKW21502SF"]
        LOGIC["KKW21502SFLogic"]
        CHECKER["KKW21502SFChecker"]
        CONST["KKW21502SFConst"]
    end

    LOGIC -.uses.-> KKW21502SFBean
    CHECKER -.uses.-> KKW21502SFBean
```

## Field Groups

The 70+ fields are organized into logical groups. Below is the taxonomy:

### Transaction & Contract Identification

| Getter | Default | Purpose |
|---|---|---|
| `getTran_div_value()` | `""` | Transaction division code (e.g., new, edit, delete). |
| `getKnytcs_no_value()` | `""` | Contract number — the primary key identifier for a contract record. |
| `getSysid_value()` | `""` | System ID used to identify the source system. |
| `getSame_kaisen_grp_skbt_no_value()` | `""` | Same-kaisen group SKBT number (appears to be a grouping identifier). |
| `getJyusho_search_chk1_value()` | `false` | Boolean flag for a search checkbox (appears to be the only Boolean field). |
| `getIdo_div_value()` | `""` | Migration/division code (ido = 移行, "transition" or "migration" in Japanese). |
| `getDlyd_trn_req_sbt_cd_value()` | `"00000"` | Delayed transaction request substance code, initialized to `"00000"`. |
| `getKnytcs_print_reqymd_value()` | `""` | Contract print request date. |
| `getUpd_dtm_value()` | `""` | Update timestamp. |
| `getTeise_upd_dtm_value()` | `""` | Formal update timestamp (added via ANK-3639-00-00). |

### Shop (Store) Information

These fields describe the shop/store (`sohus` = 店舗, "shop" in Japanese):

| Getter | Default | Purpose |
|---|---|---|
| `getSohus_nm_value()` | `""` | Shop name. |
| `getSohus_pcd1_value()` | `""` | Shop postal code part 1. |
| `getSohus_pcd2_value()` | `""` | Shop postal code part 2. |
| `getSohus_pcd_value()` | `""` | Shop postal code (combined). |
| `getSohus_pcd_hy_value()` | `""` | Shop postal code with hyphen separator. |
| `getSohus_state_nm_value()` | `""` | Shop state/prefecture name. |
| `getSohus_city_nm_value()` | `""` | Shop city name. |
| `getSohus_oaztsu_nm_value()` | `""` | Shop district name (oaztsu = 大区?). |
| `getSohus_azcho_nm_value()` | `""` | Shop town/zone name. |
| `getSohus_bnchigo_value()` | `""` | Shop branch code. |
| `getSohus_adrttm_value()` | `""` | Shop address detail line 1. |
| `getSohus_adrrm_value()` | `""` | Shop address detail line 2. |
| `getKnytcs_sohus_ad_cd_value()` | `""` | Contract shop address code. |
| `getKnytcs_sohus_telno_value()` | `""` | Contract shop telephone number. |

### Customer Information

| Getter | Default | Purpose |
|---|---|---|
| `getCust_cust_nm_value()` | `""` | Customer name. |
| `getCust_keisha_ad_value()` | `""` | Customer company address. |
| `getRyobsy_ad_value()` | `""` | Business address. |
| `getKnytcs_mngo_value()` | `""` | Contract name/alias. |

### Dates

| Getter | Default | Purpose |
|---|---|---|
| `getHakko_ymd_value()` | `""` | Issue/dispatch date (hakko = 発行). |
| `getKei_seirt_ymd_value()` | `""` | Business setup date (kei_seirt = 経営設定). |

### Service Channel: NET (Internet)

| Getter | Default | Purpose |
|---|---|---|
| `getNet_mskm_no_value()` | `""` | NET membership number. |
| `getNet_corse_value()` | `""` | NET course/tier. |
| `getNet_wrib_svc_value()` | `""` | NET writing service flag. |
| `getNet_op_svc_value()` | `""` | NET optional service flag. |
| `getNet_aply_cp_value()` | `""` | NET applicable content plan. |
| `getNet_knyhen_can_value()` | `""` | Contract cancellation flag. |
| `getNet_prc_kihonprc_dtl_value()` | `""` | NET basic price detail. |
| `getNet_stdard_kojihi_value()` | `""` | NET standard charge amount. |
| `getNet_commision_value()` | `""` | NET commission amount. |
| `getNet_prc_wribsvc_dtl_value()` | `""` | NET price writing service detail. |
| `getNet_prc_cp_dtl_value()` | `""` | NET price content plan detail. |

### Service Channel: TEL (Telephone)

| Getter | Default | Purpose |
|---|---|---|
| `getTel_mskm_no_value()` | `""` | TEL membership number. |
| `getTel_corse_value()` | `""` | TEL course/tier. |
| `getTel_wrib_svc_value()` | `""` | TEL writing service flag. |
| `getTel_aply_cp_value()` | `""` | TEL applicable content plan. |
| `getTel1_tel_no_value()` | `""` | Primary telephone number. |
| `getTel1_op_svc_value()` | `""` | Primary telephone optional service. |
| `getTel2_tel_no_value()` | `""` | Secondary telephone number. |
| `getTel2_op_svc_value()` | `""` | Secondary telephone optional service. |
| `getTel_prc_kihonprc_dtl_value()` | `""` | TEL basic price detail. |
| `getTel_stdard_kojihi_value()` | `""` | TEL standard charge amount. |
| `getTel_commision_value()` | `""` | TEL commission amount. |
| `getTel_prc_wribsvc_dtl_value()` | `""` | TEL price writing service detail. |
| `getTel_prc_cp_dtl_value()` | `""` | TEL price content plan detail. |

### Service Channel: TV (Television/Video Service)

| Getter | Default | Purpose |
|---|---|---|
| `getTv_mskm_no_value()` | `""` | TV membership number. |
| `getTv_wrib_svc_value()` | `""` | TV writing service flag. |
| `getTv_aply_cp_value()` | `""` | TV applicable content plan. |
| `getTv_op_svc_value()` | `""` | TV optional service flag. |
| `getTv1_title_value()` / `getTv1_dtl_value()` | `""` | TV plan item 1 — title and detail. |
| `getTv2_title_value()` / `getTv2_dtl_value()` | `""` | TV plan item 2 — title and detail. |
| `getTv3_title_value()` / `getTv3_dtl_value()` | `""` | TV plan item 3 — title and detail. |
| `getTv4_title_value()` / `getTv4_dtl_value()` | `""` | TV plan item 4 — title and detail. |
| `getTv5_title_value()` / `getTv5_dtl_value()` | `""` | TV plan item 5 — title and detail. |
| `getTv_kynyh_jyoko_value()` | `""` | TV quantity/order count. |
| `getTv_prc_kihonprc_dtl_value()` | `""` | TV basic price detail. |
| `getTv_stdard_kojihi_value()` | `""` | TV standard charge amount. |
| `getTv_commision_value()` | `""` | TV commission amount. |
| `getTv_prc_wribsvc_dtl_value()` | `""` | TV price writing service detail. |
| `getTv_prc_cp_dtl_value()` | `""` | TV price content plan detail. |

### TV Plan Title Fields (Pricing Titles)

Each TV plan item has a pricing title field (separate from the display title):

| Getter | Default | Purpose |
|---|---|---|
| `getTv1_prc_title_value()` | `""` | TV plan 1 pricing title. |
| `getTv2_prc_title_value()` | `""` | TV plan 2 pricing title. |
| `getTv3_prc_title_value()` | `""` | TV plan 3 pricing title. |
| `getTv4_prc_title_value()` | `""` | TV plan 4 pricing title. |
| `getTv5_prc_title_value()` | `""` | TV plan 5 pricing title. |
| `getTv1_prc_dtl_value()` | `""` | TV plan 1 pricing detail. |
| `getTv2_prc_dtl_value()` | `""` | TV plan 2 pricing detail. |
| `getTv3_prc_dtl_value()` | `""` | TV plan 3 pricing detail. |
| `getTv4_prc_dtl_value()` | `""` | TV plan 4 pricing detail. |
| `getTv5_prc_dtl_value()` | `""` | TV plan 5 pricing detail. |

### Pricing & Payment

| Getter | Default | Purpose |
|---|---|---|
| `getPay_way_value()` | `""` | Payment method/code. |

### Additional Control Flags

| Getter | Default | Purpose |
|---|---|---|
| `getKanuoreso_dofu_ctrl_cd_value()` | `""` | Control code (likely for Kanuro/So Dofu functionality). |
| `getLetter_hasso_shiwake_div_value()` | `""` | Letter dispatch division code. |
| `getKnytcs_kohu_way_cd_value()` | `""` | Contract update method code. |
| `getKnytcs_print_jssi_sk_cd_value()` | `""` | Contract print software skill code. |
| `getSvc_tk_sta_jiki_value()` | `""` | Service start date. |

## Key Methods

### Constructor

```java
public KKW21502SFBean()
```

Lines 137–138.

No-argument constructor. All fields are initialized to `""` (empty String) at the field declaration level, so the constructor is effectively empty. This means every new instance starts with clean default values.

### typeModelData (overload 1)

```java
public Class<?> typeModelData(String gamenId, String key, String subkey)
```

Line 768–770.

A three-argument delegation wrapper. Simply forwards to the two-argument `typeModelData(String, String)` variant, discarding the `gamenId` parameter. This allows callers from the framework to pass a screen ID without modifying the base method signature.

### typeModelData (core implementation)

```java
public Class<?> typeModelData(String key, String subkey)
```

Lines 779–818.

This is the **only non-trivial method** in the class and serves as a type-introspection utility. Given a `key` (field name) and optional `subkey`, it determines the Java data type of the corresponding bean field by parsing the key.

The method supports multiple key formats:

1. **Plain field name** — e.g., `"tran_div_value"` — looks up the type of a simple String/Long/Boolean field.
2. **Repeated/iteration field** — e.g., `"tv1_title_value"` — retrieves the list's type info.
3. **Nested path** — e.g., `"item/0/fieldName"` — first extracts the root element (`item`) before lookup.
4. **Shared info bean** — when `key` starts with `//`, delegates to `super.typeCommonInfoData(key)` to handle shared information beans.
5. **List element count type** — when `key` ends with `/*`, retrieves the element type of a list.

**Parameters:**
- `key` (String): Field name or path. If `null`, returns `null`.
- `subkey` (String): Sub-key. If `null`, treated as empty string `""`.

**Returns:**
- `Class<?>`: The Java type of the field, or `null` if the key format is not recognized.

**Side effects:** None.

**Implementation detail:** The method searches for `/` in the key. If found at position > 0, it extracts the first segment before the slash as `keyElement`. Otherwise, it uses the full key. It then falls through to `return null`, meaning the actual type resolution logic is handled by the parent class `X33VViewBaseBean` (which is not shown in this file).

## Relationships

### Who Uses This Class (5 inbound connections)

| Consumer | Type | Role |
|---|---|---|
| `KKW215020PJP.jsp` | JSP | Renders the 215020PJP screen. Reads/writes bean fields to display and collect form data. |
| `KKW215030PJP.jsp` | JSP | Renders the 215030PJP screen. Shares the same bean for data exchange. |
| `WEBGAMEN_KKW215020PJP.xml` | XML | Screen definition that references this bean to map form fields. |
| `WEBGAMEN_KKW215030PJP.xml` | XML | Screen definition mapping. |
| `WEBGAMEN_KKW215040PJP.xml` | XML | A third screen definition referencing this bean. |

The bean acts as the **shared data contract** across multiple screens (215020, 215030, 215040), suggesting these screens are part of a single workflow — perhaps a multi-step contract creation/update wizard.

### Dependencies

This class has **no outbound references** beyond the framework base class and interfaces. It is a pure data structure — a "dumb bean" — and delegates all behavior to the framework (via `X33VViewBaseBean`) or to sibling logic classes (`KKW21502SFLogic`, `KKW21502SFChecker`).

## Usage Example

While the full calling patterns live in the JSPs and logic classes, a typical flow looks like:

```java
// 1. Framework creates or retrieves the bean (via XML screen definition)
KKW21502SFBean bean = new KKW21502SFBean();

// 2. Populate with data from database (via KKW21502SFLogic)
bean.setKnytcs_no_value("C20240001");
bean.setSohus_nm_value("Tokyo Main Store");
bean.setNet_mskm_no_value("NET-12345");
bean.setPay_way_value("01");

// 3. Pass to JSP for rendering
//    (Framework handles bean-to-JSP data binding)

// 4. After form submission, read modified values
String contractNo = bean.getKnytcs_no_value();
Boolean searchFlag = bean.getJyusho_search_chk1_value();

// 5. Use typeModelData for dynamic type introspection
Class<?> fieldType = bean.typeModelData("tran_div_value", "");
// Returns the Class for tran_div_value's type
```

## Notes for Developers

### Thread Safety
This bean is **not thread-safe**. It is designed to be request-scoped — created per HTTP request, used by a single JSP/logic invocation, and discarded. Never share a single `KKW21502SFBean` instance across threads or requests.

### Immutability
The bean is **fully mutable** — every field has a public setter. There is no validation in the setters; data integrity is the responsibility of `KKW21502SFChecker` and `KKW21502SFLogic`.

### Naming Conventions
- All fields follow the pattern `<name>_value`.
- All getters follow `get<name>_value()` / `get<name>_value()`.
- All setters follow `set<name>_value(param)`.
- The Japanese-origin names (`sohus`, `knytcs`, `jyusho`, etc.) use a phonetic abbreviation style common in Japanese enterprise systems.

### Default Values
- Most `String` fields default to `""` (empty string), **not** `null`. This means callers should check for emptiness rather than null.
- `jyusho_search_chk1_value` defaults to `false` (Boolean primitive wrapper).
- `dlyd_trn_req_sbt_cd_value` defaults to `"00000"` — a special code rather than empty string.

### Serialization
The bean implements `Serializable`, which means it can be passed across JVM boundaries (e.g., from a servlet to a remote EJB or RMI service). However, since all fields are Strings/Boolean with no custom serialization logic, the default Java serialization applies.

### Extension Points
The `typeModelData` method is the one place where the bean delegates to its parent. If you need to add a new field, ensure:
1. It is added as a `protected` field with the `_value` suffix.
2. A getter/setter pair follows the naming convention.
3. The parent class `X33VViewBaseBean` is aware of the new field (so `typeModelData` resolves it).

### Screen ID Pattern
The class name `KKW21502SFBean` encodes the screen number: `KKW` = module prefix, `21502` = screen ID, `SF` = screen type (likely "Show Form"). The sibling screens (`215020PJP`, `215030PJP`, `215040PJP`) all share this bean, which is unusual and suggests a tightly coupled multi-step workflow.
