Annotation Interface OutputResolver


@MinMuleVersion("4.1") @Target(METHOD) @Retention(RUNTIME) @Documented 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
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Class<? extends org.mule.runtime.api.metadata.resolving.AttributesTypeResolver>
    Specifies the AttributesTypeResolver which should be used to resolve the type of the Message.getAttributes() of the output message.
    Class<? extends org.mule.runtime.api.metadata.resolving.OutputTypeResolver>
    Specifies the OutputTypeResolver which should be used to resolve the type of the value which will go into the payload of the output message.
  • Element Details

    • output

      Class<? extends org.mule.runtime.api.metadata.resolving.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.runtime.extension.api.metadata.NullMetadataResolver.class
    • attributes

      Class<? extends org.mule.runtime.api.metadata.resolving.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.runtime.extension.api.metadata.NullMetadataResolver.class