Interface EndpointBuilder<T extends Endpoint>


public interface EndpointBuilder<T extends Endpoint>
Endpoint builder interface. All endpoint builder implementations do implement this interface in order to build endpoints using a fluent Java API.
Since:
2.5
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final org.slf4j.Logger
    Logger
    static final String
    Endpoint builder resource lookup path
    static final TypeResolver
    Default Citrus endpoint builders from classpath resource properties
  • Method Summary

    Modifier and Type
    Method
    Description
    Builds the endpoint.
    default T
    build(Properties endpointProperties, ReferenceResolver referenceResolver)
    Builds the endpoint from given endpoint properties.
    default T
    build(CitrusEndpoint endpointAnnotation, ReferenceResolver referenceResolver)
    Builds the endpoint from given endpoint annotations.
    static void
    Clears the type cache.
    Resolves all available endpoint builders from resource path lookup.
    lookup(String builder)
    Resolves endpoint builder from resource path lookup with given resource name.
    boolean
    supports(Class<?> endpointType)
    Evaluate if this builder supports the given type.
  • Field Details

    • logger

      static final org.slf4j.Logger logger
      Logger
    • RESOURCE_PATH

      static final String RESOURCE_PATH
      Endpoint builder resource lookup path
      See Also:
    • TYPE_RESOLVER

      static final TypeResolver TYPE_RESOLVER
      Default Citrus endpoint builders from classpath resource properties
  • Method Details

    • supports

      boolean supports(Class<?> endpointType)
      Evaluate if this builder supports the given type.
      Parameters:
      endpointType - type to check.
      Returns:
      true when the builder is able to build the endpoint type, false otherwise.
    • build

      T build()
      Builds the endpoint.
    • build

      default T build(CitrusEndpoint endpointAnnotation, ReferenceResolver referenceResolver)
      Builds the endpoint from given endpoint annotations.
    • build

      default T build(Properties endpointProperties, ReferenceResolver referenceResolver)
      Builds the endpoint from given endpoint properties.
    • lookup

      static Map<String,EndpointBuilder<?>> lookup()
      Resolves all available endpoint builders from resource path lookup. Scans classpath for endpoint builder meta information and instantiates those builders.
    • lookup

      static Optional<EndpointBuilder<?>> lookup(String builder)
      Resolves endpoint builder from resource path lookup with given resource name. Scans classpath for endpoint builder meta information with given name and returns instance of the builder. Returns optional instead of throwing exception when no endpoint builder could be found.

      Given builder name is a combination of resource file name and type property separated by '.' character.

    • clearCache

      static void clearCache()
      Clears the type cache. Required when dynamically loading additional artifacts to the classpath.