public class BindStatus extends ObjectSE
明らかに、オブジェクトステータス表現(つまり、フィールドレベルではなくオブジェクトレベルのエラー)には、式と値はありませんが、エラーコードとメッセージのみがあります。わかりやすくするため、および同じタグとマクロを使用できるようにするために、両方のシナリオで同じステータスクラスを使用しています。
RequestContext.getBindStatus(java.lang.String), BindTag, AbstractTemplateView.setExposeSpringMacroHelpers(boolean)| コンストラクターと説明 |
|---|
BindStatus(RequestContext requestContext, StringSE path, boolean htmlEscape) フィールドまたはオブジェクトのステータスを表す新しい BindStatus インスタンスを作成します。 |
| 修飾子と型 | メソッドと説明 |
|---|---|
PropertyEditorSE | findEditor(ClassSE<?> valueClass) このバインドされたステータスが現在バインドされているプロパティに関連付けられている、指定された値クラスの PropertyEditor を見つけます。 |
ObjectSE | getActualValue() フィールドの実際の値を返します。 |
StringSE | getDisplayValue() フィールドに適切な表示値を返します。 |
PropertyEditorSE | getEditor() このバインドステータスが現在バインドされているプロパティの PropertyEditor を返します。 |
StringSE | getErrorCode() 存在する場合、フィールドまたはオブジェクトの最初のエラーコードを返します。 |
StringSE[] | getErrorCodes() 存在する場合、フィールドまたはオブジェクトのエラーコードを返します。 |
StringSE | getErrorMessage() 存在する場合、フィールドまたはオブジェクトの最初のエラーメッセージを返します。 |
StringSE[] | getErrorMessages() 存在する場合、フィールドまたはオブジェクトの解決されたエラーメッセージを返します。 |
StringSE | getErrorMessagesAsString(StringSE delimiter) 指定された区切り文字で区切られたすべてのメッセージを連結して、エラーメッセージ文字列を返します。 |
Errors | getErrors() このバインドステータスが現在関連付けられている Errors インスタンス(通常は BindingResult)を返します。 |
StringSE | getExpression() それぞれのフィールドの入力名として HTML フォームで使用できるバインド式を返します。フィールド固有でない場合は null を返します。 |
StringSE | getPath() 値とエラーが解決される Bean とプロパティパスを返します(例: |
ObjectSE | getValue() フィールドの現在の値を返します。 |
ClassSE<?> | getValueType() フィールドの ' Class' 型を取得します。 |
boolean | isError() このステータスがフィールドまたはオブジェクトのエラーを表す場合に返されます。 |
StringSE | toString() |
cloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, waitSE, waitSE, waitSEpublic BindStatus(RequestContext requestContext, StringSE path, boolean htmlEscape) throws IllegalStateExceptionSE
requestContext - 現在の RequestContextpath - 値とエラーが解決される Bean とプロパティパス (たとえば "customer.address.street" )htmlEscape - HTML エスケープエラーメッセージと文字列値かどうか IllegalStateExceptionSE - 対応する Errors オブジェクトが見つからない場合 public StringSE getPath()
@Nullable public StringSE getExpression()
null を返します。再送信に適したバインドパスを返します。例: "address.street"。「顧客」Bean にバインドされている場合、バインドタグに必要な完全なバインドパスは "customer.address.street" であることに注意してください。
@Nullable public ObjectSE getValue()
null を返します。元の値がすでに文字列であった場合、この値は HTML エスケープ文字列になります。
@Nullable public ClassSE<?> getValueType()
Class' 型を取得します。"getValue()" が "null" を返す可能性があるため、"getValue().getClass()" の代わりにこれを優先します。@Nullable public ObjectSE getActualValue()
null を返します。public StringSE getDisplayValue()
元の値が null 以外の場合、この値は HTML エスケープ文字列になります。元の値の toString 結果は HTML エスケープされます。
public boolean isError()
public StringSE[] getErrorCodes()
public StringSE getErrorCode()
public StringSE[] getErrorMessages()
public StringSE getErrorMessage()
public StringSE getErrorMessagesAsString(StringSE delimiter)
delimiter - 区切り文字列。例: ","、"@Nullable public Errors getErrors()
null BindingResult@Nullable public PropertyEditorSE getEditor()
null @Nullable public PropertyEditorSE findEditor(ClassSE<?> valueClass)
valueClass - エディターが必要とする値クラス null public StringSE toString()
ObjectSE の toStringSE