Class RestControllerUtils

java.lang.Object
io.jmix.rest.impl.RestControllerUtils

@Component("rest_RestControllerUtils") public class RestControllerUtils extends Object
  • Field Details

  • Constructor Details

    • RestControllerUtils

      public RestControllerUtils()
  • Method Details

    • getMetaClass

      public MetaClass getMetaClass(String entityName)
      Finds metaClass by entityName. Throws a RestAPIException if metaClass not found
    • getFetchPlan

      @Nullable public FetchPlan getFetchPlan(MetaClass metaClass, @Nullable String name)
      Returns a fetch plan by name.
      Parameters:
      metaClass - entity MetaClass
      name - fetch plan name (nullable)
      Returns:
      a fetch plan by name, or null if name is null
      Throws:
      RestAPIException - if the fetch plan is not found
    • getFetchPlanByNameOrJson

      @Nullable public FetchPlan getFetchPlanByNameOrJson(MetaClass metaClass, @Nullable String fetchPlanNameOrJson)
      Returns a fetch plan by name or deserializes it from JSON.
      Parameters:
      metaClass - entity MetaClass
      fetchPlanNameOrJson - fetch plan name or JSON representation (nullable)
      Returns:
      a fetch plan by name, or null if name is null
      Throws:
      RestAPIException - if the provided fetch plan is a name, and it's not found in repository. Also, if inline fetch plans are disabled by RestProperties.isInlineFetchPlanEnabled().
    • transformEntityNameIfRequired

      public String transformEntityNameIfRequired(String entityName, @Nullable String modelVersion, JsonTransformationDirection direction)
    • transformJsonIfRequired

      public String transformJsonIfRequired(String entityName, @Nullable String modelVersion, JsonTransformationDirection direction, String json)