|
||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
java.lang.Object jp.hishidama.html.HtmlEscape
public class HtmlEscape
HTMLエスケープクラス.
HTMLエスケープ(HTMLエンコード)の判定や実行を行う。
コンストラクタの概要 | |
---|---|
HtmlEscape()
コンストラクター. |
|
HtmlEscape(boolean dq,
boolean sq)
コンストラクター. |
メソッドの概要 | |
---|---|
void |
addEntity(String name,
String entity)
ENTITY追加. |
void |
clearEntities()
ENTITY定義を全て削除する. |
String |
escape(String s)
HTMLエスケープ. |
String |
escapedAmp(String s,
int pos)
HTMLエスケープされている文字かどうかを判定する |
static boolean |
isDigit(char c)
十進数文字かどうかを判定する |
static boolean |
isDigits(String s,
int first)
十進数かどうかを判定する |
static boolean |
isHexDigit(char c)
十六進数文字かどうかを判定する |
static boolean |
isHexDigits(String s,
int first)
十六進数かどうかを判定する |
クラス java.lang.Object から継承されたメソッド |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
コンストラクタの詳細 |
---|
public HtmlEscape()
引数ありコンストラクター
に全てtrueを指定した場合と同じ。
HtmlEscape(boolean, boolean)
public HtmlEscape(boolean dq, boolean sq)
文字 | 変換 | 備考 | version |
---|---|---|---|
& | & | - |   |
< | < | - |   |
> | > | - |   |
" | " | dqがtrueの場合 |   |
' | ' | sqがtrueの場合 |   |
| 今のところ、変換対象外 | 2009.02.08 | |
なし | © | 変換対象外 | 2009.02.08 |
なし | ® | 変換対象外 | 2009.02.08 |
dq
- trueの場合、ダブルクォーテーションの定義も含めるsq
- trueの場合、シングルクォーテーションの定義も含めるメソッドの詳細 |
---|
public void addEntity(String name, String entity)
エンティティー(文字参照の実体)を追加する。
同一エンティティー(文字)になる名前は、後から追加した方が優先される。
name
- 名前(例:amp)entity
- 実体(例:&)。必ず1文字である必要がある。public void clearEntities()
public String escape(String s)
HTMLエスケープを行う。既にエスケープされている文字については変換しない。
s
- 文字列
public String escapedAmp(String s, int pos)
s
- 文字列pos
- 判定開始位置(「&」がある位置)
public static boolean isDigits(String s, int first)
s
- 文字列first
- 判定開始位置
public static boolean isDigit(char c)
c
- 文字
public static boolean isHexDigits(String s, int first)
s
- 文字列first
- 判定開始位置
public static boolean isHexDigit(char c)
c
- 文字
|
||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |