Kagetaka

net.hizlab.kagetaka.token
クラス Attribute

java.lang.Object
  拡張net.hizlab.kagetaka.token.Attribute
直系の既知のサブクラス:
AAttribute, BaseAttribute, BodyAttribute, CaptionAttribute, DivAttribute, FontAttribute, FormAttribute, FrameAttribute, FramesetAttribute, HAttribute, HrAttribute, ImgAttribute, InputAttribute, LAttribute, LinkAttribute, MetaAttribute, OptionAttribute, PAttribute, SelectAttribute, StyleAttribute, TableAttribute, TbodyAttribute, TdAttribute, TextareaAttribute, TrAttribute

public class Attribute
extends Object

トークン毎の属性を表すクラスです。

バージョン:
$Revision: 1.1.1.1 $

フィールドの概要
protected  int columnNumber
          このトークンが開始される行頭からのカラム位置
protected  Content content
          コンテンツ
protected  int lineNumber
          このトークンの開始される行番号
protected  Reporter reporter
          解析時に起きたメッセージを記録するレポータ
 
コンストラクタの概要
Attribute(Content content, int line, int column, Reporter reporter)
          唯一のコンストラクタです。
 
メソッドの概要
 String[] getBaseClass()
          クラス名を返します。
 String getBaseId()
          ID を返します。
 String getBaseTitle()
          タイトルを返します。
 Object getStyle()
          スタイルを返します。
protected  void reportMessage(int level, String key, String[] args)
          メッセージを報告します。
 boolean setAttribute(String key, String value)
          指定された属性名と属性値で、属性を設定します。
protected  boolean setBaseAttribute(String key, String value)
          多くのトークンに共通する基本属性を設定します。
 void setStyle(Object style)
          スタイルを設定します。
 
クラス java.lang.Object から継承したメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

フィールドの詳細

columnNumber

protected int columnNumber
このトークンが開始される行頭からのカラム位置


content

protected Content content
コンテンツ


lineNumber

protected int lineNumber
このトークンの開始される行番号


reporter

protected Reporter reporter
解析時に起きたメッセージを記録するレポータ

コンストラクタの詳細

Attribute

public Attribute(Content content,
                 int line,
                 int column,
                 Reporter reporter)
唯一のコンストラクタです。 サブクラスでコンストラクタを定義した場合は、 このコンストラクタを呼び出し、初期化する必要があります。

パラメータ:
content - コンテンツ
line - 行番号 (1 から)、 特定できない場合は 0
column - カラム位置 (1 から)、 特定できない場合は 0
reporter - エラーレポータ
メソッドの詳細

getBaseClass

public String[] getBaseClass()
クラス名を返します。

戻り値:
クラス名

getBaseId

public String getBaseId()
ID を返します。

戻り値:
ID

getBaseTitle

public String getBaseTitle()
タイトルを返します。

戻り値:
タイトル

getStyle

public Object getStyle()
スタイルを返します。

戻り値:
スタイル

reportMessage

protected void reportMessage(int level,
                             String key,
                             String[] args)
メッセージを報告します。

パラメータ:
level - メッセージのレベル
key - メッセージリソースのキー
args - メッセージ追加引数、 必要ない場合は null

setAttribute

public boolean setAttribute(String key,
                            String value)
                     throws IllegalArgumentException
指定された属性名と属性値で、属性を設定します。 属性名が存在する場合は true を、 存在しない場合は false を返します。 渡される key は、必ず小文字に変換されています。

パラメータ:
key - 属性名
value - 属性値
戻り値:
属性名が存在する場合は true、 それ以外の場合は false
例外:
IllegalArgumentException - 属性が正しくない場合

setBaseAttribute

protected boolean setBaseAttribute(String key,
                                   String value)
                            throws IllegalArgumentException
多くのトークンに共通する基本属性を設定します。 設定される属性は、id、class、title、style です。

パラメータ:
key - 属性名
value - 属性値
戻り値:
属性名が存在する場合は true、 それ以外の場合は false
例外:
IllegalArgumentException - 属性が正しくない場合

setStyle

public void setStyle(Object style)
スタイルを設定します。

パラメータ:
style - スタイル

Kagetaka

Copyright (c) 2002-2004 The Kagetaka Project 'November 20, 2004'