Interface TypeEditor.ConstraintViolationCallback

  • Enclosing class:
    TypeEditor

    @ConsumerType
    public static interface TypeEditor.ConstraintViolationCallback
    Extension point that allows pluggable handling of constraint violations
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void onConstraintViolation​(java.lang.String path, java.util.List<java.lang.String> nodeTypeNames, int code, java.lang.String message)
      Invoked whenever a constraint violation is detected.
    • Method Detail

      • onConstraintViolation

        void onConstraintViolation​(java.lang.String path,
                                   java.util.List<java.lang.String> nodeTypeNames,
                                   int code,
                                   java.lang.String message)
                            throws CommitFailedException
        Invoked whenever a constraint violation is detected.

        Implementors may choose to throw a CommitFailedException or to handle the error internally, for instance by logging.

        Implementors may not throw other exception types from this method.

        Parameters:
        path - the path where the constraint violation was detected
        nodeTypeNames - the node type names of the node
        code - the error code
        message - the descriptive error message
        Throws:
        CommitFailedException - thrown when the implementation decides to stop further processing
        See Also:
        TypeEditor.THROW_ON_CONSTRAINT_VIOLATION, TypeEditor.WARN_ON_CONSTRAINT_VIOLATION