public abstract class UriComponents extends ObjectSE implements SerializableSE
URI
SE に似ていますが、より強力なエンコードオプションと URI テンプレート変数のサポートを備えています。UriComponentsBuilder
, 直列化された形式 修飾子と型 | クラスと説明 |
---|---|
static interface | UriComponents.UriTemplateVariables URI テンプレート変数の契約を定義します。 |
修飾子 | コンストラクターと説明 |
---|---|
protected | UriComponents(StringSE scheme, StringSE fragment) |
修飾子と型 | メソッドと説明 |
---|---|
protected abstract void | copyToUriComponentsBuilder(UriComponentsBuilder builder) 指定された UriComponentsBuilder のすべてのコンポーネントを設定します。 |
UriComponents | encode() URI 変数を展開した後、これを呼び出して、結果の URI コンポーネント値をエンコードします。 |
abstract UriComponents | encode(CharsetSE charset) 「UTF-8」以外の文字セットを持つ encode() のバリアント。 |
UriComponents | expand(MapSE<StringSE,?> uriVariables) すべての URI テンプレート変数を特定のマップの値に置き換えます。 |
UriComponents | expand(ObjectSE... uriVariableValues) すべての URI テンプレート変数を特定の配列の値に置き換えます。 |
UriComponents | expand(UriComponents.UriTemplateVariables uriVariables) すべての URI テンプレート変数を、指定された UriComponents.UriTemplateVariables の値に置き換えます。 |
StringSE | getFragment() フラグメントを返します。 |
abstract StringSE | getHost() ホストを返します。 |
abstract StringSE | getPath() パスを返します。 |
abstract ListSE<StringSE> | getPathSegments() パスセグメントのリストを返します。 |
abstract int | getPort() ポートを返します。 |
abstract StringSE | getQuery() クエリを返します。 |
abstract MultiValueMap<StringSE,StringSE> | getQueryParams() クエリパラメーターのマップを返します。 |
StringSE | getScheme() スキームを返します。 |
abstract StringSE | getSchemeSpecificPart() スキーム固有の部分を返します。 |
abstract StringSE | getUserInfo() ユーザー情報を返します。 |
abstract UriComponents | normalize() 「path/..」のようなシーケンスを削除してパスを正規化します。 |
StringSE | toString() toUriString() への単純なパススルー。 |
abstract URISE | toUri() 次のようにして、このインスタンスから URI SE を作成します。 |
abstract StringSE | toUriString() すべての URI コンポーネントを連結して、完全に形成された URI 文字列を返します。 |
cloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, waitSE, waitSE, waitSE
@Nullable public abstract StringSE getSchemeSpecificPart()
null
にすることができます。public abstract int getPort()
-1
。public abstract ListSE<StringSE> getPathSegments()
public abstract MultiValueMap<StringSE,StringSE> getQueryParams()
public final UriComponents encode()
UriComponentsBuilder.encode()
と比較すると、このメソッドは、非 ASCII 文字および無効な(指定された URI コンポーネントタイプ内の)文字のみを置き換えますが、意味が予約されている文字は置き換えません。ほとんどの場合、UriComponentsBuilder.encode()
は期待される結果を与える可能性が高くなります。
public abstract UriComponents encode(CharsetSE charset)
encode()
のバリアント。charset
- エンコードに使用する文字セット UriComponentsBuilder.encode(Charset)
public final UriComponents expand(MapSE<StringSE,?> uriVariables)
指定されたマップキーは変数名を表します。対応する値は変数値を表します。変数の順序は重要ではありません。
uriVariables
- URI 変数のマップ public final UriComponents expand(ObjectSE... uriVariableValues)
指定された配列は変数値を表します。変数の順序は重要です。
uriVariableValues
- URI 変数値 public final UriComponents expand(UriComponents.UriTemplateVariables uriVariables)
UriComponents.UriTemplateVariables
の値に置き換えます。uriVariables
- URI テンプレート値 public abstract UriComponents normalize()
public abstract StringSE toUriString()
このメソッドは、現在の値に基づいた単純な連結にすぎません。つまり、encode
、expand
や normalize
などの個々の値を変更できるメソッドの前と後で呼び出された場合、異なる結果が生成される可能性があります。
public abstract URISE toUri()
URI
SE を作成します。 現在のインスタンスが encoded
の場合、toUriString()
を介して完全な URI 文字列を形成し、パーセントエンコーディングを保持する単一の引数 URI
SE コンストラクターに渡します。
まだエンコードされていない場合は、個々の URI コンポーネントの値を複数の引数 URI
SE コンストラクターに渡します。このコンストラクターは、それぞれの URI コンポーネントに表示できない不正な文字を引用します。
public final StringSE toString()
toUriString()
への単純なパススルー。ObjectSE
の toStringSE
protected abstract void copyToUriComponentsBuilder(UriComponentsBuilder builder)