jp.co.fujitsu.reffi.client.nexaweb.parser
クラス ElementValueParser

java.lang.Object
  上位を拡張 jp.co.fujitsu.reffi.client.nexaweb.parser.ElementValueParser
すべての実装されたインタフェース:
Parser

public class ElementValueParser
extends Object
implements Parser

[概 要]

各種エレメントが持つ値を包括的に取得する為のパーサです。

[詳 細]

各種エレメントは値の保持の仕方が異なります。
(textFieldエレメントはtext属性値を値として保持し、listBoxエレメントは selected属性がついているlistItem子エレメントのtext属性値を値として保持する等)

このクラスを使用してパースすることで、統一的な値へのアクセスと、 共通のオブジェクトによる値の保持が行われます。

[備 考]

このクラスのperseメソッドはElementの種類を意識せず、 単一の方法で値を取る為の手法を提供します。

NexawebエレメントとReffiが提供するValuePaserの対応表

エレメント種 対応する値取得パーサクラス 値取得の対象
button jp.co.fujitsu.reffi.client.nexaweb.parser.ButtonValueParser text属性値
label jp.co.fujitsu.reffi.client.nexaweb.parser.LabelValueParser text属性値
passwordField jp.co.fujitsu.reffi.client.nexaweb.parser.PasswordFieldValueParser text属性値
textField jp.co.fujitsu.reffi.client.nexaweb.parser.TextFieldValueParser text属性値
checkBox jp.co.fujitsu.reffi.client.nexaweb.parser.CheckBoxValueParser selected="true"属性値があれば"true"、なければ"false"
radioButton jp.co.fujitsu.reffi.client.nexaweb.parser.RadioButtonValueParser selected="true"属性値があれば"true"、なければ"false"
comboBox jp.co.fujitsu.reffi.client.nexaweb.parser.ComboBoxValueParser selected="true"属性値がついたlistBox/listItemエレメントのvalue属性値
listBox jp.co.fujitsu.reffi.client.nexaweb.parser.ListBoxValueParser selected="true"属性値がついたlistItemエレメントのvalue属性値
horizontalSlider jp.co.fujitsu.reffi.client.nexaweb.parser.HorizontalSliderValueParser position属性値、なければ"0"
verticalSlider jp.co.fujitsu.reffi.client.nexaweb.parser.VerticalSliderValueParser position属性値、なければ"0"
textArea jp.co.fujitsu.reffi.client.nexaweb.parser.TextAreaValueParser テキストノード値
textView jp.co.fujitsu.reffi.client.nexaweb.parser.TextViewValueParser テキストノード値
table jp.co.fujitsu.reffi.client.nexaweb.parser.TableValueParser row/cellエレメントのtext属性値

[環 境] JDK 6.0 Update 11

Copyright (c) 2008-2009 FUJITSU Japan All rights reserved.

作成者:
Project Reffi

フィールドの概要
static Map<String,Class<? extends Parser>> PARSERS
          エレメント種類毎に用意されたパーサ群をマッピングします。
 
コンストラクタの概要
ElementValueParser()
           
 
メソッドの概要
static void addParser(String elementName, Class<? extends Parser> parser)
          [概 要] 任意のParserを追加します。
 ElementValues parse(Element element)
          [概 要] Nexaweb提供エレメントの値解析を行うメソッドです。
 
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

フィールドの詳細

PARSERS

public static final Map<String,Class<? extends Parser>> PARSERS
エレメント種類毎に用意されたパーサ群をマッピングします。

コンストラクタの詳細

ElementValueParser

public ElementValueParser()
メソッドの詳細

parse

public ElementValues parse(Element element)
                    throws Exception

[概 要]

Nexaweb提供エレメントの値解析を行うメソッドです。

[詳 細]

引数elementのローカル名を元にPARSERSからParserクラスを取り出し インスタンス化、parseメソッドを引数elementで呼び出します。

[備 考]

定義:
インタフェース Parser 内の parse
パラメータ:
element - 解析対象エレメント
例外:
Exception

addParser

public static void addParser(String elementName,
                             Class<? extends Parser> parser)

[概 要]

任意のParserを追加します。

[詳 細]

各エレメント名に対応する、値パーサマップに新規、上書き追加します。

[備 考]

パラメータ:
elementName - 解析対象エレメント名
parser - 解析オブジェクト


Copyright(C) Fujitsu All Rights Reserved.