# FUW00928SF02DBean

## Purpose

`FUW00928SF02DBean` is a JavaServer Faces (JSF) data binding bean that models the display fields for a customer information screen in a K-Opticom web application (likely a telecom service management system). It acts as the central data container for all form-bound inputs — text fields, checkboxes, and state flags — on the FUW00928SF02 screen. The class bridges the JSP presentation layer and the underlying business logic by exposing properties in a reflection-friendly way that the X33 framework can interrogate and manipulate at runtime.

## Design

This class follows the **JavaBean / model-view** pattern within the Fujitsu Futurity X33 web framework. It extends `X33VViewBaseBean` (the framework's base view-bean) and implements two interfaces:

- **`X33VDataTypeBeanInterface`** — enables dynamic type inspection of fields via `typeModelData()`, so the framework knows whether a field is `String`, `Boolean`, or `Long` without reflection.
- **`X33VListedBeanInterface`** — enables dynamic data loading/storing via `loadModelData()` and `storeModelData()`, allowing the framework to set and retrieve field values by string-based key names rather than direct method calls.

The bean does not implement any business logic. It is a pure data carrier: each field is a JavaBean property with a standard getter/setter pair, plus three auxiliary properties per field (`_update`, `_enabled`, `_state`) that control editability, change tracking, and UI state. The Japanese-language "koumoku" (項目, "item") keys used in `loadModelData` / `storeModelData` / `typeModelData` tie each field to a human-readable screen label that the X33 framework uses for binding.

The class is `Serializable`, which is required for JSF session-scoped beans.

```mermaid
flowchart TD
    A["FUW00928SF02DBean"] --> B["FUW009280PJP.jsp"]
    A --> C["X33VViewBaseBean"]
    A --> D["X33VDataTypeBeanInterface"]
    A --> E["X33VListedBeanInterface"]
    A --> F["Serializable"]

    subgraph Fields
        G["dsp_bampo_dtl_flg
(Boolean)"]
        H["no_title
(String)"]
        I["bmp_telno
(String)"]
        J["bmp_tel_svctk_jgs
(String)"]
        K["bmp_pcd
(String)"]
        L["bmp_adrs
(String)"]
        M["kshnm
(String)"]
        N["kshkn
(String)"]
        O["ntt_no_iten_ttdk_choice
(String)"]
        P["bmp_stc_place_ad_choice_nm
(String)"]
        Q["bmp_kshnm_choice_nm
(String)"]
        R["index
(int)"]
    end

    A --> G
    A --> H
    A --> I
    A --> J
    A --> K
    A --> L
    A --> M
    A --> N
    A --> O
    A --> P
    A --> Q
    A --> R
```

## Field Structure

Each data field in this bean has up to four associated properties:

| Property | Type | Purpose |
|----------|------|---------|
| `<field>_value` | `String` or `Boolean` | The actual data value |
| `<field>_enabled` | `Boolean` | Whether the field is editable (`true`) or locked (`false`) |
| `<field>_state` | `String` | UI state (e.g., "disabled", error codes) |
| `<field>_update` | `String` | Change-tracking flag (set when the field value is modified) |

Boolean fields (like `dsp_bampo_dtl_flg_value`) do **not** have an `_enabled` property; they only have `_value`, `_state`, and `_update`.

The 11 business fields are:

| Japanese Label | Field Name | Data Type | Description |
|---|---|---|---|
| 表示明細制御フラグ | `dsp_bampo_dtl_flg` | Boolean | Display detail control flag |
| Ｎ番号目タイトル | `no_title` | String | N-number (NTT) title |
| 番号ポータビリティを利用する電話番号 | `bmp_telno` | String | Phone number for number portability |
| 現在ご利用中の電話サービス提供事業者 | `bmp_tel_svctk_jgs` | String | Current telecom service provider |
| 現在ご利用中の電話サービスの郵便番号 | `bmp_pcd` | String | Postal code of current service |
| 現在ご利用中の電話サービスの住所 | `bmp_adrs` | String | Address of current service |
| 契約者名義 | `kshnm` | String | Contract holder name |
| 契約者名義か | `kshkn` | String | Is it the contract holder? |
| ＮＴＴ番号移行手続き | `ntt_no_iten_ttdk_choice` | String | NTT number transfer procedure |
| 現在利用中設置場所住所 | `bmp_stc_place_ad_choice_nm` | String | Current installation location address |
| 現在利用中契約者名義 | `bmp_kshnm_choice_nm` | String | Current contract holder name |

## Key Methods

### Constructor

```java
public FUW00928SF02DBean()
```

Creates a new bean instance. Initializes all `_value` fields to `""` (String) or `false` (Boolean), and all `_state` fields to `""`. The constructor has a stub comment for "constant creation" — a pattern where framework-generated beans reserve room for framework-provided constants.

### Getters and Setters (one per property per field)

Each field has four accessor pairs. For example, for the `no_title` field:

```java
public String getNo_title_value()     // Returns the field value
public void setNo_title_value(String param)
public Boolean getNo_title_enabled()  // Returns editability flag
public void setNo_title_enabled(Boolean param)
public String getNo_title_state()     // Returns UI state
public void setNo_title_state(String param)
public String getNo_title_update()    // Returns change-tracking flag
public void setNo_title_update(String param)
```

These are auto-generated by the Web Client tool. The framework sets `_enabled` to control whether the JSP renders the field as read-only. The `_update` flag is set to `"1"` (or similar) when the user modifies the field, allowing the server to detect which fields need to be persisted.

### loadModelData

```java
public Object loadModelData(String key, String subkey)
```

The framework's dynamic getter. Given a Japanese item name (`key`) and a property name (`subkey`), it returns the corresponding field value. This allows the X33 framework to read any field without using Java reflection.

- `key` — Japanese label (e.g., `"契約者名義"`)
- `subkey` — Property selector: `"value"`, `"enable"`, or `"state"`
- Returns — The field's value (String or Boolean), or `null` if no match

Example: `loadModelData("契約者名義", "value")` returns `getKshnm_value()`.

If the `key` contains a `/` character, it is detected via `indexOf("/")` but not currently used for routing — it appears to be reserved for future hierarchical key support.

### storeModelData

Three overloaded variants:

```java
public void storeModelData(String gamenId, String key, String subkey, Object in_value)
public void storeModelData(String key, String subkey, Object in_value)
public void storeModelData(String key, String subkey, Object in_value, boolean isSetAsString)
```

The framework's dynamic setter. Sets a field value based on the Japanese item name and subkey.

- `gamenId` — Screen ID (currently unused; present as a placeholder for future use)
- `key` — Japanese label (e.g., `"契約者名義"`)
- `subkey` — Property selector: `"value"`, `"enable"`, or `"state"`
- `in_value` — The value to set, cast to the expected type
- `isSetAsString` — When `true`, forces Long-typed properties to be set as String (not used for any current fields, so effectively always `false` in practice)

The three-arg version delegates to the four-arg version with `isSetAsString = false`.

### listKoumokuIds

```java
public static ArrayList<String> listKoumokuIds()
```

Returns a static list of all 11 Japanese item names used as keys. This is a static method, so it can be called without instantiating the bean. The framework uses this to enumerate available fields — for example, to populate a dropdown of fields or iterate over all properties during batch operations.

### typeModelData

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

Returns the Java type of a field property. This implements the `X33VDataTypeBeanInterface` contract, allowing the framework to validate and format data without relying on Java reflection.

- `key` — Japanese label
- `subkey` — `"value"`, `"enable"`, or `"state"`
- Returns — `Boolean.class`, `String.class`, or `null` if not found

The type mapping is:
- `dsp_bampo_dtl_flg` → `"value"`: `Boolean.class`; `"state"`: `String.class`
- All other fields → `"value"`: `String.class`; `"enable"`: `Boolean.class`; `"state"`: `String.class`

### index

```java
public int getIndex()
public void setIndex(int index)
```

A simple integer index field, likely used for row positioning in list-based UI scenarios.

## Relationships

```mermaid
flowchart LR
    JSP["FUW009280PJP.jsp"] -->|"reads/writes"| BEAN["FUW00928SF02DBean"]
    BEAN -->|"extends"| BASE["X33VViewBaseBean"]
    BEAN -->|"implements"| IFACE1["X33VDataTypeBeanInterface"]
    BEAN -->|"implements"| IFACE2["X33VListedBeanInterface"]
    BEAN -->|"implements"| JAVA["Serializable"]
```

### Inbound (1 consumer)

- **`FUW009280PJP.jsp`** — The JSP page that renders the FUW00928SF02 screen. It binds form inputs to the bean's properties using the X33 framework's tag library.

### Outbound (no direct bean dependencies)

The bean itself has no outbound bean dependencies. It imports several X33 framework classes (`X33VViewBaseBean`, `X33VDataTypeBeanInterface`, etc.), JSF utilities (`SelectItem`), and exception types (`X33SException`, `X33VLoadModelException`), but these are framework contracts, not application-level dependencies.

## Usage Example

The X33 framework typically uses this bean in a request or session-scoped flow. Here's how the framework would interact with it:

```java
// 1. Instantiate the bean (usually done by the framework's IOC container)
FUW00928SF02DBean bean = new FUW00928SF02DBean();

// 2. Set field editability before rendering
bean.setNo_title_enabled(Boolean.TRUE);
bean.setKshnm_enabled(Boolean.FALSE);  // read-only

// 3. Populate initial values (loaded from a database or previous screen)
bean.setKshnm_value("Sample Company Ltd.");
bean.setBmp_telno_value("03-1234-5678");
bean.setBmp_pcd_value("100-0001");

// 4. The framework uses dynamic access via the Japanese keys
//    (This is how the X33 framework reads values from the JSP)
Object value = bean.loadModelData("契約者名義", "value");
// value == "Sample Company Ltd."

// 5. On form submission, the framework sets values dynamically
bean.storeModelData("契約者名義", "value", "New Company Name");
// bean.getKshnm_value() == "New Company Name"

// 6. The framework checks which fields changed
String updateFlag = bean.getKshnm_update();

// 7. Get all field names for iteration or validation
ArrayList<String> fields = FUW00928SF02DBean.listKoumokuIds();
// Contains all 11 Japanese labels

// 8. Framework validates types before binding
Class<?> type = bean.typeModelData("契約者名義", "value");
// type == String.class
```

On the JSP side, the X33 tag library would bind fields declaratively:

```jsp
<!-- X33 framework auto-binds based on the item key -->
<xx:inputText itemKey="契約者名義" property="value" />
<xx:inputText itemKey="契約者名義" property="enable" />
<xx:inputText itemKey="契約者名義" property="state" />
```

## Notes for Developers

1. **Framework-generated code**: This bean is auto-generated by the "Web Client tool" (version 2.0.39+). Manual edits to field declarations or getter/setter signatures will be overwritten on regeneration. Only the method bodies for `loadModelData`, `storeModelData`, `typeModelData`, and `listKoumokuIds` should be modified if new fields are added — though ideally these are also updated by the code generator.

2. **Japanese string keys are fragile**: All dynamic access methods use hardcoded Japanese strings as map keys. Any change to the Japanese label in one method but not the other (e.g., a typo in `typeModelData` but not `loadModelData`) will silently break the binding. Adding a new field requires updating **all four methods** (`loadModelData`, `storeModelData`, `typeModelData`, `listKoumokuIds`) consistently.

3. **Case-insensitive subkey matching**: The `subkey` parameter is compared using `equalsIgnoreCase("value")`, `equalsIgnoreCase("enable")`, and `equalsIgnoreCase("state")`. The framework always passes lowercase strings, so this is safe in practice.

4. **Null safety**: Both `loadModelData` and `storeModelData` return early (or return `null`) when `key` or `subkey` is `null`. The framework should never pass nulls, but defensive coding is in place.

5. **Not thread-safe**: Like most JSF view-scoped beans, this class is not designed for concurrent access. Each HTTP request gets its own instance (or the same instance within a single session). Do not share instances across threads.

6. **`separaterPoint` variable is unused**: Every method declares `int separaterPoint = key.indexOf("/");` but never uses the result. This appears to be scaffolding for future hierarchical key support (e.g., `"parent/child"` keys).

7. **`isSetAsString` is unused**: The four-argument `storeModelData` accepts a boolean `isSetAsString` that, when true, would force Long-type properties to accept String values. No current fields are Long-typed, so this code path is dead code in the current version.

8. **Empty constructor**: The constructor body is a no-op with a comment for "constant creation". All field initialization happens at the declaration site (e.g., `= ""` or `= false`), ensuring consistent defaults even if the constructor is ever removed.

9. **SerialVersionUID**: The class is annotated with `@SuppressWarnings("serial")` rather than declaring an explicit `serialVersionUID`. If this bean is serialized across JVM restarts or distributed across servers, consider adding an explicit `serialVersionUID` to avoid `InvalidClassException` if fields change.

10. **Extension points**: To add a new field, you must:
    - Add four protected fields (`_value`, `_enabled`, `_state`, `_update`)
    - Add eight getter/setter methods
    - Add a case in `loadModelData` (with `"value"`, `"enable"`, `"state"` branches)
    - Add a case in `storeModelData` (same three subkey branches)
    - Add a case in `typeModelData` (same three subkey branches)
    - Add the Japanese label to `listKoumokuIds()`
