public class URIEditor extends PropertyEditorSupportSE
java.net.URI
のエディター。ブリッジとして String プロパティを使用する代わりに、URI プロパティを直接入力します。Spring スタイルの URI 表記をサポート: 完全修飾された標準 URI("file:"、"http:" など)および Spring の特別な "classpath:" 疑似 URL。これらは対応する URI に解決されます。
デフォルトでは、このエディターは文字列を URI にエンコードします。たとえば、スペースは %20
にエンコードされます。この動作は、URIEditor(boolean)
コンストラクターを呼び出すことによって変更できます。
メモ: URI は、有効なプロトコルを指定する必要がないという点で、URL よりもリラックスしています。一致するプロトコルハンドラーが登録されていなくても、有効な URI 構文内の任意のスキームが許可されます。
コンストラクターと説明 |
---|
URIEditor() 新しいエンコーディング URIEditor を作成し、"classpath:" の場所を標準 URI に変換します(物理リソースに解決しようとはしません)。 |
URIEditor(boolean encode) 新しい URIEditor を作成し、"classpath:" の場所を標準の URI に変換します(物理リソースに解決しようとはしません)。 |
URIEditor(ClassLoaderSE classLoader) 指定された ClassLoader を使用して "classpath:" の場所を物理リソース URL に解決する新しい URIEditor を作成します。 |
URIEditor(ClassLoaderSE classLoader, boolean encode) 指定された ClassLoader を使用して "classpath:" の場所を物理リソース URL に解決する新しい URIEditor を作成します。 |
修飾子と型 | メソッドと説明 |
---|---|
protected URISE | createURI(StringSE value) 指定されたユーザー指定の文字列値の URI インスタンスを作成します。 |
StringSE | getAsText() |
void | setAsText(StringSE text) |
addPropertyChangeListenerSE, firePropertyChangeSE, getCustomEditorSE, getJavaInitializationStringSE, getSourceSE, getTagsSE, getValueSE, isPaintableSE, paintValueSE, removePropertyChangeListenerSE, setSourceSE, setValueSE, supportsCustomEditorSE
cloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, toStringSE, waitSE, waitSE, waitSE
public URIEditor()
public URIEditor(boolean encode)
encode
- 文字列がエンコードされるかどうかを示します public URIEditor(@Nullable ClassLoaderSE classLoader)
classLoader
- "classpath:" の場所を解決するために使用する ClassLoader (デフォルトの ClassLoader を示す null
)public URIEditor(@Nullable ClassLoaderSE classLoader, boolean encode)
classLoader
- "classpath:" の場所を解決するために使用する ClassLoader (デフォルトの ClassLoader を示す null
)encode
- 文字列がエンコードされるかどうかを示します public void setAsText(StringSE text) throws IllegalArgumentExceptionSE
PropertyEditorSE
の setAsTextSE
PropertyEditorSupportSE
の setAsTextSE
IllegalArgumentExceptionSE
protected URISE createURI(StringSE value) throws URISyntaxExceptionSE
デフォルトの実装では、値を RFC-2396 準拠の URI にエンコードします。
value
- URI インスタンスに変換する値 URISyntaxExceptionSE
- URI 変換が失敗した場合 public StringSE getAsText()
PropertyEditorSE
の getAsTextSE
PropertyEditorSupportSE
の getAsTextSE