public abstract class TemplatedViolatedConstraintNameExtracter extends java.lang.Object implements ViolatedConstraintNameExtracter
Constructor and Description |
---|
TemplatedViolatedConstraintNameExtracter() |
Modifier and Type | Method and Description |
---|---|
protected abstract java.lang.String |
doExtractConstraintName(java.sql.SQLException sqle) |
java.lang.String |
extractConstraintName(java.sql.SQLException sqle)
Extract the name of the violated constraint from the given SQLException.
|
protected java.lang.String |
extractUsingTemplate(java.lang.String templateStart,
java.lang.String templateEnd,
java.lang.String message)
Extracts the constraint name based on a template (i.e., templateStartconstraintNametemplateEnd).
|
public TemplatedViolatedConstraintNameExtracter()
public java.lang.String extractConstraintName(java.sql.SQLException sqle)
ViolatedConstraintNameExtracter
extractConstraintName
in interface ViolatedConstraintNameExtracter
sqle
- The exception that was the result of the constraint violation.protected abstract java.lang.String doExtractConstraintName(java.sql.SQLException sqle) throws java.lang.NumberFormatException
java.lang.NumberFormatException
protected java.lang.String extractUsingTemplate(java.lang.String templateStart, java.lang.String templateEnd, java.lang.String message)
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.Copyright © 2001-2018 Red Hat, Inc. All Rights Reserved.