クラス 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 voidaddCustomTypeKeyIfNecessary(@Nullable TypeInformation<?> type, ObjectSE value, SecretDocumentAccessor accessor) 必要に応じて、特定のSecretDocumentにカスタム型情報を追加します。createCollection(CollectionSE<?> collection, VaultPersistentProperty property) 指定されたVaultPersistentProperty情報を使用して、指定されたCollectionSE を書き込みます。createMap(MapSE<ObjectSE, ObjectSE> map, VaultPersistentProperty property) 指定されたVaultPersistentProperty情報を使用して、指定されたMapSE を書き込みます。MappingContext<? extends VaultPersistentEntity<?>,VaultPersistentProperty> <S> Sread(ClassSE<S> type, SecretDocument source) readMap(TypeInformation<?> type, MapSE<StringSE, ObjectSE> sourceMap) voidsetTypeMapper(VaultTypeMapper typeMapper) コンバーターによって作成されたSecretDocumentに型情報を追加するために使用されるVaultTypeMapperと、読み取り時にSecretDocumentから型情報を検索する方法を構成します。voidwrite(ObjectSE source, SecretDocument sink) protected voidwriteInternal(ObjectSE obj, SecretDocumentAccessor sink, @Nullable TypeInformation<?> typeHint) ネストされた呼び出しに使用する必要がある内部書き込み変換メソッド。protected voidwriteInternal(ObjectSE obj, SecretDocumentAccessor sink, VaultPersistentEntity<?> entity) writeMapInternal(MapSE<ObjectSE, ObjectSE> obj, MapSE<StringSE, ObjectSE> bson, TypeInformation<?> propertyType) protected voidwritePropertyInternal(@Nullable ObjectSE obj, 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<@Nullable ObjectSE,@Nullable ObjectSE> readMap(TypeInformation<?> type, MapSE<StringSE, ObjectSE> sourceMap) - パラメーター:
type- このMapSE の非整列化に使用されるMapSETypeInformation。sourceMap- null であってはなりません- 戻り値:
- 変換された
MapSE。
write
writeInternal
protected void writeInternal(ObjectSE obj, SecretDocumentAccessor sink, @Nullable TypeInformation<?> typeHint) ネストされた呼び出しに使用する必要がある内部書き込み変換メソッド。- パラメーター:
obj-sink-typeHint-
writeInternal
protected void writeInternal(ObjectSE obj, SecretDocumentAccessor sink, VaultPersistentEntity<?> entity) writePropertyInternal
protected void writePropertyInternal(@Nullable ObjectSE obj, SecretDocumentAccessor accessor, VaultPersistentProperty prop) createCollection
protected ListSE<ObjectSE> createCollection(CollectionSE<?> collection, VaultPersistentProperty property) 指定されたVaultPersistentProperty情報を使用して、指定されたCollectionSE を書き込みます。- パラメーター:
collection- null であってはなりません。property- null であってはなりません。- 戻り値:
- 変換された
ListSE。
createMap
protected MapSE<StringSE,ObjectSE> createMap(MapSE<ObjectSE, ObjectSE> map, VaultPersistentProperty property) 指定されたVaultPersistentProperty情報を使用して、指定されたMapSE を書き込みます。- パラメーター:
map- null であってはなりません。property- null であってはなりません。- 戻り値:
- 変換された
MapSE。
writeMapInternal
protected MapSE<StringSE,ObjectSE> writeMapInternal(MapSE<ObjectSE, ObjectSE> obj, MapSE<StringSE, ObjectSE> bson, TypeInformation<?> propertyType) - パラメーター:
obj- null であってはなりません。bson- null であってはなりません。propertyType- null であってはなりません。- 戻り値:
- 変換された
MapSE。
addCustomTypeKeyIfNecessary
protected void addCustomTypeKeyIfNecessary(@Nullable TypeInformation<?> type, ObjectSE value, SecretDocumentAccessor accessor) 必要に応じて、特定のSecretDocumentにカスタム型情報を追加します。つまり、値が与えられたものと同じでない場合です。これは通常、プロパティの実際に宣言された型のサブ型を格納する場合に当てはまります。- パラメーター:
type- 型ヒント。value- null であってはなりません。accessor- null であってはなりません。