Class GomValidationError

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
de.espirit.common.UncheckedException
de.espirit.firstspirit.access.store.templatestore.gom.GomValidationError
All Implemented Interfaces:
LocalizableError, Serializable

public class GomValidationError extends UncheckedException
This error indicates an invalid gom source.
Since:
4.0.52
See Also:
  • Constructor Details

    • GomValidationError

      public GomValidationError(String message, @NotNull @NotNull GomElement gom, @Nullable @Nullable String detail)
      Create a new exception with the given message to be thrown for the provided gom element and a regular expression used to identify the position of the gom element's detail.

      To identify the correct position of the error, the detail's regular expression should define the erronous part as the first group within the expression. If the expression does not define a group, the cursor is placed at the end of the matching sequence.

      For example, having an invalid attribute value, a detail definition with group might look like follows:
      "\\battrName *= *[\"'](invalidValue)[\"']"
      where invalidValue will be identified as the erronous part.

      Parameters:
      message - The exception's message.
      gom - The gom element that failed.
      detail - The regular expression identifying the detail.
      Since:
      4.2.410
  • Method Details

    • getContext

      public Map<String,Object> getContext()
      Returns the context of this error containing specific error information.
      Since:
      4.2.200
    • putContext

      public void putContext(String key, Object value)
      Adds the given value identified by the given key to the context of this error.
      Parameters:
      key - The key identifying the context object.
      value - The context object to be stored.
      Since:
      4.2.200
      See Also:
    • findPosition

      @Deprecated public int[] findPosition(String text)
      Deprecated.
      since 5.0.100 Use findPosition(String,int) instead.
      Tries to find the position causing this exception within the given text.
      Parameters:
      text - The text to search in.
      Returns:
      The position of the detail or -1.
      Since:
      4.2.9
    • findPosition

      public Range findPosition(@NotNull @NotNull String text, int start)
      Find the position causing this exception within the given text from the given start on.
      Parameters:
      text - The text to search in.
      start - The starting index.
      Returns:
      A match or null.
      Since:
      5.0.100
    • getName

      public String getName()
      Get the GomFormElement name.
      Returns:
      the elements name
      Since:
      4.2.400
      See Also:
    • getTag

      public String getTag()
      Get the GomElement tag.
      Returns:
      the elements name
      Since:
      4.2.400
      See Also:
    • getGom

      public GomElement getGom()
      Get the GOM element.
      Returns:
      The element itself.
      Since:
      5.0.100
    • getTarget

      public String getTarget()
      Get the target for identifying the error's origin.
      Returns:
      The target name.
      Since:
      5.0.100