クラス MappingVaultConverter
java.lang.ObjectSE
org.springframework.vault.repository.convert.AbstractVaultConverter
org.springframework.vault.repository.convert.MappingVaultConverter
- 実装されたすべてのインターフェース:
InitializingBean
、EntityConverter<VaultPersistentEntity<?>,
、VaultPersistentProperty, ObjectSE, SecretDocument> EntityReader<ObjectSE,
、SecretDocument> EntityWriter<ObjectSE,
、SecretDocument> VaultConverter
MappingContext
を使用して、ドメインオブジェクトの SecretDocument
への高度なマッピングを行う VaultConverter
。このコンバーターは、JSON ライブラリを使用せずに Map 型の表現とドメインオブジェクトを変換します。SecretDocument
は、Vault とシークレットを交換するための JSON マッピングへの入力です。- 導入:
- 2.0
- 作成者:
- Mark Paluch
フィールドのサマリー
クラス org.springframework.vault.repository.convert.AbstractVaultConverter から継承されたフィールド
conversions, conversionService, instantiators
コンストラクターの概要
コンストラクターコンストラクター説明MappingVaultConverter
(MappingContext<? extends VaultPersistentEntity<?>, VaultPersistentProperty> mappingContext) メソッドのサマリー
修飾子と型メソッド説明protected void
addCustomTypeKeyIfNecessary
(TypeInformation<?> type, ObjectSE value, org.springframework.vault.repository.convert.SecretDocumentAccessor accessor) 必要に応じて、特定のSecretDocument
にカスタム型情報を追加します。createCollection
(CollectionSE<?> collection, VaultPersistentProperty property) 指定されたVaultPersistentProperty
情報を使用して、指定されたCollection
SE を書き込みます。createMap
(MapSE<ObjectSE, ObjectSE> map, VaultPersistentProperty property) 指定されたVaultPersistentProperty
情報を使用して、指定されたMap
SE を書き込みます。MappingContext<? extends VaultPersistentEntity<?>,
VaultPersistentProperty> <S> S
read
(ClassSE<S> type, SecretDocument source) readMap
(TypeInformation<?> type, MapSE<StringSE, ObjectSE> sourceMap) void
setTypeMapper
(VaultTypeMapper typeMapper) コンバーターによって作成されたSecretDocument
に型情報を追加するために使用されるVaultTypeMapper
と、読み取り時にSecretDocument
から型情報を検索する方法を構成します。void
write
(ObjectSE source, SecretDocument sink) protected void
writeInternal
(ObjectSE obj, org.springframework.vault.repository.convert.SecretDocumentAccessor sink, TypeInformation<?> typeHint) ネストされた呼び出しに使用する必要がある内部書き込み変換メソッド。protected void
writeInternal
(ObjectSE obj, org.springframework.vault.repository.convert.SecretDocumentAccessor sink, VaultPersistentEntity<?> entity) writeMapInternal
(MapSE<ObjectSE, ObjectSE> obj, MapSE<StringSE, ObjectSE> bson, TypeInformation<?> propertyType) protected void
writePropertyInternal
(ObjectSE obj, org.springframework.vault.repository.convert.SecretDocumentAccessor accessor, VaultPersistentProperty prop) クラス org.springframework.vault.repository.convert.AbstractVaultConverter から継承されたメソッド
afterPropertiesSet, getConversionService, setCustomConversions, setInstantiators
コンストラクターの詳細
MappingVaultConverter
public MappingVaultConverter(MappingContext<? extends VaultPersistentEntity<?>, VaultPersistentProperty> mappingContext)
メソッドの詳細
setTypeMapper
コンバーターによって作成されたSecretDocument
に型情報を追加するために使用されるVaultTypeMapper
と、読み取り時にSecretDocument
から型情報を検索する方法を構成します。デフォルトでDefaultVaultTypeMapper
を使用します。これを null に設定すると、TypeMapper
がデフォルトのものにリセットされます。- パラメーター:
typeMapper
- 設定する typeMapper は null であってはなりません。
getMappingContext
public MappingContext<? extends VaultPersistentEntity<?>,VaultPersistentProperty> getMappingContext()read
readMap
protected MapSE<ObjectSE,ObjectSE> readMap(TypeInformation<?> type, MapSE<StringSE, ObjectSE> sourceMap) - パラメーター:
type
- このMap
SE の非整列化に使用されるMap
SETypeInformation
。sourceMap
- null であってはなりません- 戻り値:
- 変換された
Map
SE。
write
writeInternal
protected void writeInternal(ObjectSE obj, org.springframework.vault.repository.convert.SecretDocumentAccessor sink, @Nullable TypeInformation<?> typeHint) ネストされた呼び出しに使用する必要がある内部書き込み変換メソッド。- パラメーター:
obj
-sink
-typeHint
-
writeInternal
protected void writeInternal(ObjectSE obj, org.springframework.vault.repository.convert.SecretDocumentAccessor sink, VaultPersistentEntity<?> entity) writePropertyInternal
protected void writePropertyInternal(@Nullable ObjectSE obj, org.springframework.vault.repository.convert.SecretDocumentAccessor accessor, VaultPersistentProperty prop) createCollection
protected ListSE<ObjectSE> createCollection(CollectionSE<?> collection, VaultPersistentProperty property) 指定されたVaultPersistentProperty
情報を使用して、指定されたCollection
SE を書き込みます。- パラメーター:
collection
- null であってはなりません。property
- null であってはなりません。- 戻り値:
- 変換された
List
SE。
createMap
protected MapSE<StringSE,ObjectSE> createMap(MapSE<ObjectSE, ObjectSE> map, VaultPersistentProperty property) 指定されたVaultPersistentProperty
情報を使用して、指定されたMap
SE を書き込みます。- パラメーター:
map
- null であってはなりません。property
- null であってはなりません。- 戻り値:
- 変換された
Map
SE。
writeMapInternal
protected MapSE<StringSE,ObjectSE> writeMapInternal(MapSE<ObjectSE, ObjectSE> obj, MapSE<StringSE, ObjectSE> bson, TypeInformation<?> propertyType) - パラメーター:
obj
- null であってはなりません。bson
- null であってはなりません。propertyType
- null であってはなりません。- 戻り値:
- 変換された
Map
SE。
addCustomTypeKeyIfNecessary
protected void addCustomTypeKeyIfNecessary(@Nullable TypeInformation<?> type, ObjectSE value, org.springframework.vault.repository.convert.SecretDocumentAccessor accessor) 必要に応じて、特定のSecretDocument
にカスタム型情報を追加します。つまり、値が与えられたものと同じでない場合です。これは通常、プロパティの実際に宣言された型のサブ型を格納する場合に当てはまります。- パラメーター:
type
- 型ヒント。value
- null であってはなりません。accessor
- null であってはなりません。