Class JobLogChecks

java.lang.Object
org.apache.juneau.console.views.JobLogChecks

public final class JobLogChecks extends Object
The shared shape checks of a job-log declaration, used by the console's page-level job-log card and by a JobLogRegion, so the two cannot drift.

Every check throws an IllegalArgumentException whose message names the offending key relative to the job-log body (for example "submit.fields[0] type must be ..."); each caller prefixes its own context.

Since:
10.0.0
  • Field Details

  • Method Details

    • submit

      public static void submit(Map<?,?> submit, JobLogChecks.Mode mode)
      Checks a submit object's keys, method, label, envelope, action, key URL and fields.

      The page card checks its own endpoint first (it has the console's same-origin rule); a region's endpoint and keyUrl are checked here as same-origin templates whose only token is {id}.

      Parameters:
      submit - The submit object.
      mode - Where the declaration lives.
      Throws:
      IllegalArgumentException - If a rule is broken.
    • field

      public static void field(int i, Object f, JobLogChecks.Mode mode, boolean actionEnvelope)
      Checks one field.
      Parameters:
      i - The field's index, for the message.
      f - The field.
      mode - Where the declaration lives; source needs a row, so the page card rejects it.
      actionEnvelope - Whether the fields are nested under fields (no reserved names) or flat.
      Throws:
      IllegalArgumentException - If a rule is broken.
    • output

      public static void output(Object o)
      Checks an output object.
      Parameters:
      o - The output value.
      Throws:
      IllegalArgumentException - If a rule is broken.
    • detail

      public static void detail(Object o)
      Checks a region's detail object: {renderer, fields}.
      Parameters:
      o - The detail value.
      Throws:
      IllegalArgumentException - If a rule is broken.
    • height

      public static void height(Object height, int min)
      Checks height.
      Parameters:
      height - The value. Can be null.
      min - The smallest accepted height, in pixels.
      Throws:
      IllegalArgumentException - If it is set and not an integer of at least min.
    • clearOnSubmit

      public static void clearOnSubmit(Object clear)
      Checks clearOnSubmit.
      Parameters:
      clear - The value. Can be null.
      Throws:
      IllegalArgumentException - If it is set and not a boolean.