Class ParseNodeProxyFactory
java.lang.Object
com.microsoft.kiota.serialization.ParseNodeProxyFactory
- All Implemented Interfaces:
ParseNodeFactory
- Direct Known Subclasses:
BackingStoreParseNodeFactory
Proxy factory that allows the composition of before and after callbacks on existing factories.
-
Constructor Summary
ConstructorsConstructorDescriptionParseNodeProxyFactory(ParseNodeFactory concrete, Consumer<Parsable> onBefore, Consumer<Parsable> onAfter) Creates a new proxy factory that wraps the specified concrete factory while composing the before and after callbacks. -
Method Summary
Modifier and TypeMethodDescriptiongetParseNode(String contentType, InputStream rawResponse) Creates aParseNodefrom the givenInputStreamand content type.Returns the content type this factory's parse nodes can deserialize.
-
Constructor Details
-
ParseNodeProxyFactory
public ParseNodeProxyFactory(@Nonnull ParseNodeFactory concrete, @Nullable Consumer<Parsable> onBefore, @Nullable Consumer<Parsable> onAfter) Creates a new proxy factory that wraps the specified concrete factory while composing the before and after callbacks.- Parameters:
concrete- the concrete factory to wraponBefore- the callback to invoke before the deserialization of any model object.onAfter- the callback to invoke after the deserialization of any model object.
-
-
Method Details
-
getValidContentType
Description copied from interface:ParseNodeFactoryReturns the content type this factory's parse nodes can deserialize.- Specified by:
getValidContentTypein interfaceParseNodeFactory- Returns:
- the content type this factory's parse nodes can deserialize.
-
getParseNode
@Nonnull public ParseNode getParseNode(@Nonnull String contentType, @Nonnull InputStream rawResponse) Description copied from interface:ParseNodeFactoryCreates aParseNodefrom the givenInputStreamand content type.- Specified by:
getParseNodein interfaceParseNodeFactory- Parameters:
contentType- the content type of theInputStream.rawResponse- theInputStreamto read from.- Returns:
- a
ParseNodethat can deserialize the givenInputStream.
-