Package mil.nga.geopackage.db.table
Class ConstraintParser
- java.lang.Object
- 
- mil.nga.geopackage.db.table.ConstraintParser
 
- 
 public class ConstraintParser extends Object SQL constraint parser from create table statements- Since:
- 3.3.0
- Author:
- osbornb
 
- 
- 
Constructor SummaryConstructors Constructor Description ConstraintParser()
 - 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description static ConstraintgetColumnConstraint(String constraintSql)Attempt to get a column constraint by parsing the SQL statementstatic ColumnConstraintsgetColumnConstraints(String constraintSql)Attempt to get column constraints by parsing the SQL statementstatic ConstraintTypegetColumnType(String constraintSql)Get the column constraint type of the constraint SQLstatic ConstraintgetConstraint(String constraintSql)Attempt to get a constraint by parsing the SQL statementstatic TableConstraintsgetConstraints(String tableSql)Get the constraints for the table SQLstatic StringgetName(String constraintSql)Get the constraint name if it has onestatic String[]getNameAndDefinition(String constraintSql)Get the constraint name and remaining definitionstatic ConstraintgetTableConstraint(String constraintSql)Attempt to get a table constraint by parsing the SQL statementstatic ConstraintTypegetTableType(String constraintSql)Get the table constraint type of the constraint SQLstatic ConstraintTypegetType(String constraintSql)Get the constraint type of the constraint SQLstatic booleanisColumnConstraint(String constraintSql)Check if the SQL is a column type constraintstatic booleanisColumnType(ConstraintType type, String constraintSql)Determine if the column constraint SQL is the constraint typestatic booleanisConstraint(String constraintSql)Check if the SQL is a constraintstatic booleanisTableConstraint(String constraintSql)Check if the SQL is a table type constraintstatic booleanisTableType(ConstraintType type, String constraintSql)Determine if the table constraint SQL is the constraint typestatic booleanisType(ConstraintType type, String constraintSql)Determine if the constraint SQL is the constraint type
 
- 
- 
- 
Method Detail- 
getConstraintspublic static TableConstraints getConstraints(String tableSql) Get the constraints for the table SQL- Parameters:
- tableSql- table SQL
- Returns:
- constraints
 
 - 
getColumnConstraintspublic static ColumnConstraints getColumnConstraints(String constraintSql) Attempt to get column constraints by parsing the SQL statement- Parameters:
- constraintSql- constraint SQL statement
- Returns:
- constraints
 
 - 
getTableConstraintpublic static Constraint getTableConstraint(String constraintSql) Attempt to get a table constraint by parsing the SQL statement- Parameters:
- constraintSql- constraint SQL statement
- Returns:
- constraint or null
 
 - 
isTableConstraintpublic static boolean isTableConstraint(String constraintSql) Check if the SQL is a table type constraint- Parameters:
- constraintSql- constraint SQL statement
- Returns:
- true if a table constraint
 
 - 
getTableTypepublic static ConstraintType getTableType(String constraintSql) Get the table constraint type of the constraint SQL- Parameters:
- constraintSql- constraint SQL
- Returns:
- constraint type or null
 
 - 
isTableTypepublic static boolean isTableType(ConstraintType type, String constraintSql) Determine if the table constraint SQL is the constraint type- Parameters:
- type- constraint type
- constraintSql- constraint SQL
- Returns:
- true if the constraint type
 
 - 
getColumnConstraintpublic static Constraint getColumnConstraint(String constraintSql) Attempt to get a column constraint by parsing the SQL statement- Parameters:
- constraintSql- constraint SQL statement
- Returns:
- constraint or null
 
 - 
isColumnConstraintpublic static boolean isColumnConstraint(String constraintSql) Check if the SQL is a column type constraint- Parameters:
- constraintSql- constraint SQL statement
- Returns:
- true if a column constraint
 
 - 
getColumnTypepublic static ConstraintType getColumnType(String constraintSql) Get the column constraint type of the constraint SQL- Parameters:
- constraintSql- constraint SQL
- Returns:
- constraint type or null
 
 - 
isColumnTypepublic static boolean isColumnType(ConstraintType type, String constraintSql) Determine if the column constraint SQL is the constraint type- Parameters:
- type- constraint type
- constraintSql- constraint SQL
- Returns:
- true if the constraint type
 
 - 
getConstraintpublic static Constraint getConstraint(String constraintSql) Attempt to get a constraint by parsing the SQL statement- Parameters:
- constraintSql- constraint SQL statement
- Returns:
- constraint or null
 
 - 
isConstraintpublic static boolean isConstraint(String constraintSql) Check if the SQL is a constraint- Parameters:
- constraintSql- constraint SQL statement
- Returns:
- true if a constraint
 
 - 
getTypepublic static ConstraintType getType(String constraintSql) Get the constraint type of the constraint SQL- Parameters:
- constraintSql- constraint SQL
- Returns:
- constraint type or null
 
 - 
isTypepublic static boolean isType(ConstraintType type, String constraintSql) Determine if the constraint SQL is the constraint type- Parameters:
- type- constraint type
- constraintSql- constraint SQL
- Returns:
- true if the constraint type
 
 - 
getNamepublic static String getName(String constraintSql) Get the constraint name if it has one- Parameters:
- constraintSql- constraint SQL
- Returns:
- constraint name or null
 
 
- 
 
-