类 TemplatedViolatedConstraintNameExtracter

  • 所有已实现的接口:
    ViolatedConstraintNameExtracter

    public abstract class TemplatedViolatedConstraintNameExtracter
    extends Object
    implements ViolatedConstraintNameExtracter
    Knows how to extract a violated constraint name from an error message based on the fact that the constraint name is templated within the message.
    作者:
    Steve Ebersole, Brett Meyer
    • 构造器详细资料

      • TemplatedViolatedConstraintNameExtracter

        public TemplatedViolatedConstraintNameExtracter()
    • 方法详细资料

      • extractUsingTemplate

        protected String extractUsingTemplate​(String templateStart,
                                              String templateEnd,
                                              String message)
        Extracts the constraint name based on a template (i.e., templateStartconstraintNametemplateEnd).
        参数:
        templateStart - The pattern denoting the start of the constraint name within the message.
        templateEnd - The pattern denoting the end of the constraint name within the message.
        message - The templated error message containing the constraint name.
        返回:
        The found constraint name, or null.