Annotation Interface OutputResolver


@Target(METHOD) @Retention(RUNTIME) @Documented @MinMuleVersion("4.5.0") public @interface OutputResolver
Associates the annotated Component to an OutputTypeResolver that will be used to resolve the Component's return type dynamically
Since:
1.0
  • Element Details

    • output

      Class<? extends OutputTypeResolver> output
      Specifies the OutputTypeResolver which should be used to resolve the type of the value which will go into the payload of the output message.

      Always keep in mind that this should resolve to a single unitary type. That means that for operations which return collections, this should not return an ArrayType but the type of the items inside the collection.

      So, if the operation returns List<Apple>, this should return a MetadataType for the Apple. Also, if the operation returns List<Result<Apple, AppleAttributes>>, it still should only return the Apple's metadata.

      Returns:
      the associated OutputTypeResolver for the annotated Component
      Default:
      org.mule.sdk.api.metadata.NullMetadataResolver.class
    • attributes

      Class<? extends AttributesTypeResolver> attributes
      Specifies the AttributesTypeResolver which should be used to resolve the type of the Message#getAttributes() of the output message.

      Always consider that this resolver should be consistent with the one returned by output().

      So, if the operation returns List<Apple>, this should return a MetadataType for attributes which describe the Apple, not the list. . Also, if the operation returns List<Result<Apple, AppleAttributes>>, it still should only describe AppleAttributes.

      Returns:
      the associated AttributesTypeResolver for the annotated Component
      Default:
      org.mule.sdk.api.metadata.NullMetadataResolver.class