|
Kagetaka | |||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
java.lang.Objectnet.hizlab.kagetaka.token.AttributeConverter
属性値を、文字列から適切なインスタンスを生成するためのユーティリティです。
メソッドの概要 | |
static int |
convertToAlign(String value)
ALIGN 属性を表す文字列から、ALIGN 値を生成します。 |
static Color |
convertToColor(String value)
色を表す文字列から、 Color のインスタンスを生成します。
|
static Color |
convertToColorSilent(String value)
色を表す文字列から、 Color のインスタンスを生成します。
|
static Font |
convertToFont(String value)
フォント名を表す文字列から、 Font のインスタンスを
生成します。 |
static Integer |
convertToInteger(String value)
数値を表す文字列から、 Integer のインスタンスを
生成します。 |
static Value |
convertToPercent(String value)
パーセントを含む文字列から、パーセント値を生成します。 |
static int |
convertToVAlign(String value)
VALIGN 属性を表す文字列から、VALIGN 値を生成します。 |
クラス java.lang.Object から継承したメソッド |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
メソッドの詳細 |
public static int convertToAlign(String value) throws IllegalArgumentException
value
- ALIGN 属性を表す文字列
IllegalArgumentException
- 不正な値の場合public static Color convertToColor(String value) throws IllegalArgumentException
Color
のインスタンスを生成します。
文字列のフォーマットは、以下の通りです。
#f00 (#rgb - 16 進数) #ff0000 (#rrggbb - 16 進数) red (色名)16 進数は 0-9、a-f までの文字で、大文字小文字は区別されません。 rgb の 3 桁の形式は、実際には 6 桁の形式に変換されます。 この変換は、0 を付け加えるのではなく、各桁の値を繰り返すことにより、 6 桁に変換します。例えば「#fb0」という値は、「#ffbb00」に変換されます。
サポートされている色名は、aqua, black, blue, fuchsia, gray, green,
lime, maroon, navy, olive, purple, red, silver, teal, white, yellow
の 16 色で、これらは、HTML 4.0 で定義されている色と同じです。
value
- 色を表す文字列
IllegalArgumentException
- 不正な値の場合public static Color convertToColorSilent(String value)
Color
のインスタンスを生成します。
convertToColor(String)
との違いは、不正な値を変換しようと
した場合に、例外を発生させずに、null
を返す点です。
value
- 色を表す文字列
null
convertToColor(String)
public static Font convertToFont(String value) throws IllegalArgumentException
Font
のインスタンスを
生成します。
value
- フォントを表す文字列
IllegalArgumentException
- 不正な値の場合public static Integer convertToInteger(String value) throws IllegalArgumentException
Integer
のインスタンスを
生成します。
value
- 数値を表す文字列
IllegalArgumentException
- 不正な値の場合public static Value convertToPercent(String value) throws IllegalArgumentException
value
- パーセントを含む文字列
IllegalArgumentException
- 不正な値の場合public static int convertToVAlign(String value) throws IllegalArgumentException
value
- VALIGN 属性を表す文字列
IllegalArgumentException
- 不正な値の場合
|
Kagetaka | |||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
Copyright (c) 2002-2003 The Kagetaka Project 'December 6, 2003'