action/library/src/main/java/io/knotx/fragments/action/library/InlineBodyActionFactory.java
/**
   * Creates inline body action that replaces Fragment body with static content.
   *
   * @param alias - action alias
   * @param config - JSON configuration
   * @param vertx - vertx instance
   * @param doAction - <pre>null</pre> value expected
   */
Creates inline body action that replaces Fragment body with static content.
@param alias - action alias
@param config - JSON configuration
@param vertx - vertx instance
@param doAction - null value expected
Creates inline body action that replaces Fragment body with static content . @param alias - action alias @param config - JSON configuration @param vertx - vertx instance @param doAction - null value expected
@Override
  public Action create(String alias, JsonObject config, Vertx vertx, Action doAction) {
    checkArgument(doAction != null, () -> new ActionConfigurationException(alias, "Inline body action does not support doAction"));
    ActionLogLevel logLevel = ActionLogLevel.fromConfig(config, ActionLogLevel.ERROR);
    return (SyncAction) fragmentContext -> {
      ActionLogger actionLogger = ActionLogger.create(alias, logLevel);
      substituteBodyInFragment(fragmentContext, config, actionLogger);
      return success(fragmentContext.getFragment(), actionLogger.toLog().toJson());
    };
  }
@ Override public Action create ( String alias , JsonObject config , Vertx vertx , Action doAction ) { checkArgument ( doAction != null , ( ) -> new ActionConfigurationException ( alias , "Inline body action does not support doAction" ) ) ; ActionLogLevel logLevel = ActionLogLevel . fromConfig ( config , ActionLogLevel . ERROR ) ; return ( SyncAction ) fragmentContext -> { ActionLogger actionLogger = ActionLogger . create ( alias , logLevel ) ; substituteBodyInFragment ( fragmentContext , config , actionLogger ) ; return success ( fragmentContext . getFragment ( ) , actionLogger . toLog ( ) . toJson ( ) ) ; } ; }
Creates inline body action that replaces Fragment body with static content.
Creates inline body action that replaces Fragment body with static content .