public abstract class AbstractNestablePropertyAccessor extends AbstractPropertyAccessor
ConfigurablePropertyAccessor
。 このアクセサーは、必要に応じて、コレクションと配列の値を対応するターゲットコレクションまたは配列に変換します。コレクションまたは配列を処理するカスタムプロパティエディターは、配列自体が割り当て可能でない場合、String 配列がこのような形式に変換されるため、PropertyEditor の setValue
を介して、または setAsText
を介してコンマ区切りの String に対して記述できます。
PropertyEditorRegistrySupport.registerCustomEditor(java.lang.Class<?>, java.beans.PropertyEditor)
, AbstractPropertyAccessor.setPropertyValues(java.util.Map<?, ?>)
, setPropertyValue(java.lang.String, java.lang.Object)
, getPropertyValue(java.lang.String)
, getPropertyType(java.lang.String)
, BeanWrapper
, PropertyEditorRegistrySupport
修飾子と型 | クラスと説明 |
---|---|
protected static class | AbstractNestablePropertyAccessor.PropertyHandler |
protected static class | AbstractNestablePropertyAccessor.PropertyTokenHolder |
NESTED_PROPERTY_SEPARATOR, NESTED_PROPERTY_SEPARATOR_CHAR, PROPERTY_KEY_PREFIX, PROPERTY_KEY_PREFIX_CHAR, PROPERTY_KEY_SUFFIX, PROPERTY_KEY_SUFFIX_CHAR
修飾子 | コンストラクターと説明 |
---|---|
protected | AbstractNestablePropertyAccessor() 新しい空のアクセサーを作成します。 |
protected | AbstractNestablePropertyAccessor(boolean registerDefaultEditors) 新しい空のアクセサーを作成します。 |
protected | AbstractNestablePropertyAccessor(java.lang.Class<?> clazz) 指定したクラスの新しいインスタンスをラップして、新しいアクセサーを作成します。 |
protected | AbstractNestablePropertyAccessor(java.lang.Object object) 指定されたオブジェクトの新しいアクセサーを作成します。 |
protected | AbstractNestablePropertyAccessor(java.lang.Object object, java.lang.String nestedPath, AbstractNestablePropertyAccessor parent) 指定されたオブジェクトの新しいアクセサーを作成し、オブジェクトが含まれているネストされたパスを登録します。 |
protected | AbstractNestablePropertyAccessor(java.lang.Object object, java.lang.String nestedPath, java.lang.Object rootObject) 指定されたオブジェクトの新しいアクセサーを作成し、オブジェクトが含まれているネストされたパスを登録します。 |
修飾子と型 | メソッドと説明 |
---|---|
protected java.lang.Object | convertForProperty(java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue, TypeDescriptor td) |
protected abstract NotWritablePropertyException | createNotWritablePropertyException(java.lang.String propertyName) 指定されたプロパティの NotWritablePropertyException を作成します。 |
int | getAutoGrowCollectionLimit() 配列およびコレクションの自動拡張の制限を返します。 |
protected java.lang.String | getFinalPath(AbstractNestablePropertyAccessor pa, java.lang.String nestedPath) パスの最後のコンポーネントを取得します。 |
protected abstract AbstractNestablePropertyAccessor.PropertyHandler | getLocalPropertyHandler(java.lang.String propertyName) 指定されたローカル propertyName の AbstractNestablePropertyAccessor.PropertyHandler を返します。 |
java.lang.String | getNestedPath() このアクセサーによってラップされたオブジェクトのネストされたパスを返します。 |
protected AbstractNestablePropertyAccessor | getPropertyAccessorForPropertyPath(java.lang.String propertyPath) 再帰的にナビゲートして、ネストされたプロパティパスのプロパティアクセサーを返します。 |
protected AbstractNestablePropertyAccessor.PropertyHandler | getPropertyHandler(java.lang.String propertyName) 指定された propertyName の AbstractNestablePropertyAccessor.PropertyHandler を返し、必要に応じてナビゲートします。 |
java.lang.Class<?> | getPropertyType(java.lang.String propertyName) 指定されたプロパティパスのプロパティ型を決定します。 |
TypeDescriptor | getPropertyTypeDescriptor(java.lang.String propertyName) 指定されたプロパティの型記述子を返します。できれば読み取りメソッドから、書き込みメソッドにフォールバックしてください。 |
protected java.lang.Object | getPropertyValue(AbstractNestablePropertyAccessor.PropertyTokenHolder tokens) |
java.lang.Object | getPropertyValue(java.lang.String propertyName) 実際にプロパティの値を取得します。 |
java.lang.Class<?> | getRootClass() このアクセサーのパスの先頭にあるルートオブジェクトのクラスを返します。 |
java.lang.Object | getRootInstance() このアクセサーのパスの先頭にあるルートオブジェクトを返します。 |
java.lang.Class<?> | getWrappedClass() |
java.lang.Object | getWrappedInstance() |
boolean | isReadableProperty(java.lang.String propertyName) 指定したプロパティが読み取り可能かどうかを判断します。 |
boolean | isWritableProperty(java.lang.String propertyName) 指定されたプロパティが書き込み可能かどうかを判断します。 |
protected abstract AbstractNestablePropertyAccessor | newNestedPropertyAccessor(java.lang.Object object, java.lang.String nestedPath) 新しいネストされたプロパティアクセサーインスタンスを作成します。 |
void | setAutoGrowCollectionLimit(int autoGrowCollectionLimit) 配列およびコレクションの自動拡張の制限を指定します。 |
protected void | setPropertyValue(AbstractNestablePropertyAccessor.PropertyTokenHolder tokens, PropertyValue pv) |
void | setPropertyValue(PropertyValue pv) 指定した値を現在のプロパティ値として設定します。 |
void | setPropertyValue(java.lang.String propertyName, java.lang.Object value) 実際にプロパティ値を設定します。 |
void | setWrappedInstance(java.lang.Object object) 新しいオブジェクトのクラスが置き換えられたオブジェクトのクラスと異なる場合にのみ、ターゲットオブジェクトを切り替えて、キャッシュされたイントロスペクションの結果を置き換えます。 |
void | setWrappedInstance(java.lang.Object object, java.lang.String nestedPath, java.lang.Object rootObject) 新しいオブジェクトのクラスが置き換えられたオブジェクトのクラスと異なる場合にのみ、ターゲットオブジェクトを切り替えて、キャッシュされたイントロスペクションの結果を置き換えます。 |
java.lang.String | toString() |
isAutoGrowNestedPaths, isExtractOldValueForEditor, setAutoGrowNestedPaths, setExtractOldValueForEditor, setPropertyValues, setPropertyValues, setPropertyValues, setPropertyValues
convertIfNecessary, convertIfNecessary, convertIfNecessary
copyCustomEditorsTo, copyDefaultEditorsTo, findCustomEditor, getConversionService, getDefaultEditor, guessPropertyTypeFromEditors, hasCustomEditorForElement, overrideDefaultEditor, registerCustomEditor, registerCustomEditor, registerDefaultEditors, setConversionService, useConfigValueEditors
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getConversionService, setConversionService
findCustomEditor, registerCustomEditor, registerCustomEditor
convertIfNecessary, convertIfNecessary, convertIfNecessary
protected AbstractNestablePropertyAccessor()
protected AbstractNestablePropertyAccessor(boolean registerDefaultEditors)
registerDefaultEditors
- デフォルトのエディターを登録するかどうか (アクセサーが型変換を必要としない場合は抑制できます)setWrappedInstance(java.lang.Object)
protected AbstractNestablePropertyAccessor(java.lang.Object object)
object
- このアクセサーによってラップされたオブジェクト protected AbstractNestablePropertyAccessor(java.lang.Class<?> clazz)
clazz
- インスタンス化してラップするクラス protected AbstractNestablePropertyAccessor(java.lang.Object object, java.lang.String nestedPath, java.lang.Object rootObject)
object
- このアクセサーによってラップされたオブジェクト nestedPath
- オブジェクトのネストされたパス rootObject
- パスの上部にあるルートオブジェクト protected AbstractNestablePropertyAccessor(java.lang.Object object, java.lang.String nestedPath, AbstractNestablePropertyAccessor parent)
object
- このアクセサーによってラップされたオブジェクト nestedPath
- オブジェクトのネストされたパス parent
- 含まれるアクセサー (null
であってはなりません)public void setAutoGrowCollectionLimit(int autoGrowCollectionLimit)
プレーンアクセサーのデフォルトは無制限です。
public int getAutoGrowCollectionLimit()
public void setWrappedInstance(java.lang.Object object)
object
- 新しいターゲットオブジェクト public void setWrappedInstance(java.lang.Object object, java.lang.String nestedPath, java.lang.Object rootObject)
object
- 新しいターゲットオブジェクト nestedPath
- オブジェクトのネストされたパス rootObject
- パスの上部にあるルートオブジェクト public final java.lang.Object getWrappedInstance()
public final java.lang.Class<?> getWrappedClass()
public final java.lang.String getNestedPath()
public final java.lang.Object getRootInstance()
getNestedPath()
public final java.lang.Class<?> getRootClass()
getNestedPath()
public void setPropertyValue(java.lang.String propertyName, java.lang.Object value) throws BeansException
AbstractPropertyAccessor
PropertyAccessor
の setPropertyValue
AbstractPropertyAccessor
の setPropertyValue
propertyName
- 値を設定するプロパティの名前 value
- 新しい価値 InvalidPropertyException
- そのようなプロパティがない場合、またはプロパティが書き込み可能でない場合 PropertyAccessException
- プロパティは有効であるが、アクセサーメソッドが失敗したか、型の不一致が発生した場合 BeansException
public void setPropertyValue(PropertyValue pv) throws BeansException
PropertyAccessor
PropertyAccessor
の setPropertyValue
AbstractPropertyAccessor
の setPropertyValue
pv
- 新しいプロパティ値を含むオブジェクト InvalidPropertyException
- そのようなプロパティがない場合、またはプロパティが書き込み可能でない場合 PropertyAccessException
- プロパティは有効であるが、アクセサーメソッドが失敗したか、型の不一致が発生した場合 BeansException
protected void setPropertyValue(AbstractNestablePropertyAccessor.PropertyTokenHolder tokens, PropertyValue pv) throws BeansException
public java.lang.Class<?> getPropertyType(java.lang.String propertyName) throws BeansException
PropertyEditorRegistrySupport
必須の型が指定されていない場合に PropertyEditorRegistrySupport.findCustomEditor(java.lang.Class<?>, java.lang.String)
によって呼び出され、プロパティパスを指定しただけでも型固有のエディターを検索できるようにします。
デフォルトの実装は、常に null
を返します。BeanWrapperImpl は、BeanWrapper インターフェースで定義されている標準の getPropertyType
メソッドでこれをオーバーライドします。
PropertyAccessor
の getPropertyType
AbstractPropertyAccessor
の getPropertyType
propertyName
- 型を決定するプロパティパス null
PropertyAccessException
- プロパティは有効だったが、アクセサーメソッドが失敗した場合 BeansException
PropertyAccessor.getPropertyType(String)
public TypeDescriptor getPropertyTypeDescriptor(java.lang.String propertyName) throws BeansException
PropertyAccessor
propertyName
- チェックするプロパティ (ネストされたパスおよび / またはインデックス付き / マップされたプロパティ)null
PropertyAccessException
- プロパティは有効だったが、アクセサーメソッドが失敗した場合 BeansException
public boolean isReadableProperty(java.lang.String propertyName)
PropertyAccessor
プロパティが存在しない場合、false
を返します。
propertyName
- チェックするプロパティ (ネストされたパスおよび / またはインデックス付き / マップされたプロパティ)public boolean isWritableProperty(java.lang.String propertyName)
PropertyAccessor
プロパティが存在しない場合、false
を返します。
propertyName
- チェックするプロパティ (ネストされたパスおよび / またはインデックス付き / マップされたプロパティ)protected java.lang.Object convertForProperty(java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue, TypeDescriptor td) throws TypeMismatchException
public java.lang.Object getPropertyValue(java.lang.String propertyName) throws BeansException
AbstractPropertyAccessor
PropertyAccessor
の getPropertyValue
AbstractPropertyAccessor
の getPropertyValue
propertyName
- 値を取得するプロパティの名前 InvalidPropertyException
- そのようなプロパティがない場合、またはプロパティが読めない場合 PropertyAccessException
- プロパティは有効だったが、アクセサーメソッドが失敗した場合 BeansException
protected java.lang.Object getPropertyValue(AbstractNestablePropertyAccessor.PropertyTokenHolder tokens) throws BeansException
protected AbstractNestablePropertyAccessor.PropertyHandler getPropertyHandler(java.lang.String propertyName) throws BeansException
propertyName
の AbstractNestablePropertyAccessor.PropertyHandler
を返し、必要に応じてナビゲートします。例外をスローするのではなく、見つからない場合は null
を返します。propertyName
- 記述子を取得するプロパティ null
BeansException
- イントロスペクションが失敗した場合 protected abstract AbstractNestablePropertyAccessor.PropertyHandler getLocalPropertyHandler(java.lang.String propertyName)
propertyName
の AbstractNestablePropertyAccessor.PropertyHandler
を返します。現在のコンテキストで利用可能なプロパティに到達するためにのみ使用されます。propertyName
- ローカルプロパティの名前 null
protected abstract AbstractNestablePropertyAccessor newNestedPropertyAccessor(java.lang.Object object, java.lang.String nestedPath)
object
- この PropertyAccessor によってラップされたオブジェクト nestedPath
- オブジェクトのネストされたパス protected abstract NotWritablePropertyException createNotWritablePropertyException(java.lang.String propertyName)
NotWritablePropertyException
を作成します。protected java.lang.String getFinalPath(AbstractNestablePropertyAccessor pa, java.lang.String nestedPath)
pa
- 作業するプロパティアクセサー nestedPath
- ネストされていることがわかっているプロパティパス protected AbstractNestablePropertyAccessor getPropertyAccessorForPropertyPath(java.lang.String propertyPath)
propertyPath
- ネストできるプロパティパス public java.lang.String toString()
java.lang.Object
の toString