public class ContentType extends ObjectSE
コンストラクターと説明 |
---|
ContentType() 引数なしのコンストラクター。 |
ContentType(StringSE s) Content-Type 文字列を受け取るコンストラクター。 |
ContentType(StringSE primaryType, StringSE subType, ParameterList list) コンストラクター。 |
修飾子と型 | メソッドと説明 |
---|---|
StringSE | getBaseType() パラメーターなしで MIME 型文字列を返します。 |
StringSE | getParameter(StringSE name) 指定されたパラメーター値を返します。 |
ParameterList | getParameterList() 使用可能なすべてのパラメーターを保持する ParameterList オブジェクトを返します。 |
StringSE | getPrimaryType() プライマリ型を返します。 |
StringSE | getSubType() subType を返します。 |
boolean | match(ContentType cType) 指定された ContentType オブジェクトと一致します。 |
boolean | match(StringSE s) 指定されたコンテンツ型の文字列と一致します。 |
void | setParameter(StringSE name, StringSE value) 指定されたパラメーターを設定します。 |
void | setParameterList(ParameterList list) 新しい ParameterList を設定します。 |
void | setPrimaryType(StringSE primaryType) プライマリ型を設定します。 |
void | setSubType(StringSE subType) subType を設定します。 |
StringSE | toString() この Content-Type の RFC2045 スタイルの文字列表現を取得します。 |
cloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, waitSE, waitSE, waitSE
public ContentType()
public ContentType(StringSE primaryType, StringSE subType, ParameterList list)
primaryType
- プライマリ型 subType
- subTypelist
- ParameterListpublic ContentType(StringSE s) throws ParseException
s
- Content-Type 文字列。ParseException
- 解析が失敗した場合。public StringSE getPrimaryType()
public StringSE getSubType()
public StringSE getBaseType()
public StringSE getParameter(StringSE name)
null
を返します。name
- パラメーター名 public ParameterList getParameterList()
public void setPrimaryType(StringSE primaryType)
primaryType
- プライマリ型 public void setSubType(StringSE subType)
subType
- subTypepublic void setParameter(StringSE name, StringSE value)
name
- パラメーター名 value
- パラメーター値 public void setParameterList(ParameterList list)
list
- ParameterListpublic StringSE toString()
ObjectSE
の toStringSE
public boolean match(ContentType cType)
primaryType
と subType
のみを比較します。両方のオペランドのパラメーターは無視されます。 例: このメソッドは、"text/plain" と "text/plain; charset=foobar" の ContentTypes を比較すると、true
を返します。いずれかのオペランドの subType
が特殊文字 '*' の場合、サブ型は一致中に無視されます。例: "text/plain" と "text/*" の ContentTypes を比較すると、このメソッドは true
を返します。
cType
- これを比較する ContentTypepublic boolean match(StringSE s)
primaryType
と subType
のみを比較します。両方のオペランドのパラメーターは無視されます。 例: このメソッドは、"text/plain" の ContentType を "text/plain; charset=foobar" と比較するときに true
を返します。いずれかのオペランドの subType
が特殊文字 '*' の場合、サブ型は一致中に無視されます。例: "text/plain" の ContentType を "text/*" と比較すると、このメソッドは true
を返します。
s
- 一致するコンテンツ型の文字列 Copyright © 2018,2020 Eclipse Foundation.
Use is subject to license terms.