Class AwsXmlErrorProtocolUnmarshaller.Builder
- java.lang.Object
-
- software.amazon.awssdk.protocols.query.unmarshall.AwsXmlErrorProtocolUnmarshaller.Builder
-
- Enclosing class:
- AwsXmlErrorProtocolUnmarshaller
public static final class AwsXmlErrorProtocolUnmarshaller.Builder extends Object
Builder forAwsXmlErrorProtocolUnmarshaller
.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AwsXmlErrorProtocolUnmarshaller
build()
AwsXmlErrorProtocolUnmarshaller.Builder
defaultExceptionSupplier(Supplier<SdkPojo> defaultExceptionSupplier)
Default exception type if "error code" does not match any known modeled exception.AwsXmlErrorProtocolUnmarshaller.Builder
errorRootExtractor(Function<XmlElement,Optional<XmlElement>> errorRootExtractor)
Extracts theelement from the top level XML document. AwsXmlErrorProtocolUnmarshaller.Builder
errorUnmarshaller(XmlErrorUnmarshaller errorUnmarshaller)
The unmarshaller to use.AwsXmlErrorProtocolUnmarshaller.Builder
exceptions(List<ExceptionMetadata> exceptions)
List ofExceptionMetadata
to represent the modeled exceptions for the service.
-
-
-
Method Detail
-
exceptions
public AwsXmlErrorProtocolUnmarshaller.Builder exceptions(List<ExceptionMetadata> exceptions)
List ofExceptionMetadata
to represent the modeled exceptions for the service. For AWS services the error type is a string representing the type of the modeled exception.- Returns:
- This builder for method chaining.
-
defaultExceptionSupplier
public AwsXmlErrorProtocolUnmarshaller.Builder defaultExceptionSupplier(Supplier<SdkPojo> defaultExceptionSupplier)
Default exception type if "error code" does not match any known modeled exception. This is the generated base exception for the service (i.e. DynamoDbException).- Returns:
- This builder for method chaining.
-
errorRootExtractor
public AwsXmlErrorProtocolUnmarshaller.Builder errorRootExtractor(Function<XmlElement,Optional<XmlElement>> errorRootExtractor)
Extracts theelement from the top level XML document. Different protocols have slightly different formats for where the Error element is located. The error root of the XML document contains the code, message and any modeled fields of the exception. See javadocs of AwsXmlErrorProtocolUnmarshaller
for examples.- Parameters:
errorRootExtractor
- Function that extracts theelement from the root XML document. - Returns:
- This builder for method chaining.
-
errorUnmarshaller
public AwsXmlErrorProtocolUnmarshaller.Builder errorUnmarshaller(XmlErrorUnmarshaller errorUnmarshaller)
The unmarshaller to use. The unmarshaller only unmarshalls any modeled fields of the exception, additional metadata is extracted byAwsXmlErrorProtocolUnmarshaller
.- Parameters:
errorUnmarshaller
- Error unmarshaller to use.- Returns:
- This builder for method chaining.
-
build
public AwsXmlErrorProtocolUnmarshaller build()
- Returns:
- New instance of
AwsXmlErrorProtocolUnmarshaller
.
-
-