|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.datatools.connectivity.oda.spec.util.ValidatorUtil
public class ValidatorUtil
Utility class for use by implementation of IValidator.
Constructor Summary | |
---|---|
ValidatorUtil()
|
Method Summary | |
---|---|
static OdaException |
addException(OdaException rootEx,
OdaException newEx)
Adds the new OdaException object to the end of the OdaException chain. |
static boolean |
isInvalidAggregateExpression(AggregateExpression aggrExpr,
OdaException rootEx)
Indicates whether the specified aggregate expression is one of the cause(s) in the specified OdaException chain. |
static boolean |
isInvalidFilterExpression(FilterExpression filterExpr,
OdaException rootEx)
Indicates whether the specified FilterExpression is one of the cause(s) in the specified OdaException chain. |
static boolean |
isInvalidResultProjection(ResultProjection resultProj,
OdaException rootEx)
Indicates whether the specified result projection is one of the cause(s) in the specified OdaException chain. |
static boolean |
isInvalidResultSetSpec(ResultSetSpecification resultSetSpec,
OdaException rootEx)
Indicates whether the specified result set specification is one of the cause(s) in the specified OdaException chain. |
static boolean |
isInvalidSortKey(int sortKeySequenceOrder,
OdaException rootEx)
Indicates whether the specified sort key is one of the cause(s) in the specified OdaException chain. |
static boolean |
isInvalidSortSpec(SortSpecification sortSpec,
OdaException rootEx)
Indicates whether the specified sort specification is one of the cause(s) in the specified OdaException chain. |
static boolean |
isInvalidValueExpression(ValueExpression valueExpr,
OdaException rootEx)
Indicates whether the specified value expression is one of the cause(s) in the specified OdaException chain. |
static OdaException |
newAggregateException(AggregateExpression invalidAggrExpr,
OdaException driverEx)
Creates and returns a top-level OdaException to indicate that the specified aggregate expression is the cause of the specified driverEx exception. |
static OdaException |
newAggregateException(java.lang.String message,
AggregateExpression invalidAggrExpr)
Creates and returns an OdaException with the specified AggregateExpression identified as the cause. |
static OdaException |
newFilterExprException(FilterExpression invalidFilterExpr,
OdaException driverEx)
Creates and returns a top-level OdaException to indicate that the specified FilterExpression is the cause of the specified driverEx exception. |
static OdaException |
newFilterExprException(java.lang.String message,
FilterExpression invalidFilterExpr)
Creates and returns an OdaException with the specified FilterExpression identified as the cause. |
static OdaException |
newOdaException(java.lang.String message,
java.lang.String causeIdentifier)
Creates and returns an OdaException with the specified message and an IllegalArgumentException cause with the specified causeIdentifier. |
static OdaException |
newResultProjectionException(ResultProjection resultProj,
OdaException driverEx)
Creates and returns a top-level OdaException to indicate that the specified result projection is the cause of the specified driverEx exception. |
static OdaException |
newResultProjectionException(java.lang.String message,
ResultProjection resultProj)
Creates and returns a top-level OdaException to indicate that the specified result projection is the cause of the specified driverEx exception. |
static OdaException |
newResultSetSpecException(java.lang.String message,
ResultSetSpecification resultSetSpec,
OdaException chainedEx)
Creates and returns a top-level OdaException to indicate that the specified result set specification is the cause of the specified driverEx exception. |
static OdaException |
newSortKeyException(int sortKeySequenceOrder,
OdaException driverEx)
Creates and returns a top-level OdaException to indicate that the specified sort key is the cause of the specified driverEx exception. |
static OdaException |
newSortKeyException(java.lang.String message,
int sortKeySequenceOrder)
Creates and returns a top-level OdaException to indicate that the specified sort key is the cause of the specified driverEx exception. |
static OdaException |
newSortSpecException(SortSpecification sortSpec,
OdaException driverEx)
Creates and returns a top-level OdaException to indicate that the specified sort specification is the cause of the specified driverEx exception. |
static OdaException |
newSortSpecException(java.lang.String message,
SortSpecification sortSpec)
Creates and returns a top-level OdaException to indicate that the specified sort specification is the cause of the specified driverEx exception. |
static OdaException |
newValueExprException(java.lang.String message,
ValueExpression invalidValueExpr)
Creates and returns an OdaException with the specified value expression identified as the cause. |
static OdaException |
newValueExprException(ValueExpression invalidValueExpr,
OdaException driverEx)
Creates and returns a top-level OdaException to indicate that the specified value expression is the cause of the specified driverEx exception. |
static void |
validateAllCustomExprType(FilterExpression expr,
java.lang.Class<?> expectedExprClass)
Validates each and every CustomExpression nested in the specified FilterExpression to be an instance of the specified class. |
static void |
validateCustomExprExtension(CustomAggregate customAggrExpr,
java.lang.String expectedExtensionId)
Validates that the specified CustomAggregate is contributed by the specified dynamicResultSet extension id. |
static void |
validateCustomExprExtension(CustomExpression customExpr,
java.lang.String expectedExtensionId)
Validates that the specified CustomExpression is contributed by the specified dynamicResultSet extension id. |
static void |
validateCustomExprExtension(CustomFunction customFuncExpr,
java.lang.String expectedExtensionId)
Validates that the specified CustomFunction is contributed by the specified dynamicResultSet extension id. |
static void |
validateCustomExprType(CustomAggregate customExpr,
java.lang.Class<?> expectedExprClass)
Validates the specified CustomAggregate to be an instance of the specified class. |
static void |
validateCustomExprType(CustomExpression customExpr,
java.lang.Class<?> expectedExprClass)
Validates the specified CustomExpression to be an instance of the specified class. |
static void |
validateCustomExprType(CustomFunction customExpr,
java.lang.Class<?> expectedExprClass)
Validates the specified CustomFunction to be an instance of the specified class. |
static void |
validateHasExprVariable(AtomicExpression expr)
Validates that the specified AtomicExpression has an associated ExpressionVariable. |
static void |
validateHasNoNullOrderingSpec(SortSpecification sortSpec)
Validates that null ordering is not specified in the given sortSpec. |
static void |
validateSupportedVariableDataTypes(ExpressionVariable exprVar,
VariableRestrictions varRestrictions,
java.lang.String odaDataSourceId,
java.lang.String dataSetType)
Validates that the data type of the specified expression variable is one of the supported data types listed in the VariableRestrictions. |
static void |
validateSupportedVariableDataTypes(ValueExpression valueExpr,
VariableRestrictions varRestrictions,
java.lang.String odaDataSourceId,
java.lang.String dataSetType)
Validates that the data type of the specified value expression is one of the supported data types listed in the VariableRestrictions. |
static void |
validateSupportedVariableTypes(AtomicExpression expr,
ExpressionVariable.VariableType[] supportedVarTypes)
Validates that the expression variable of the specified filter expression is one of the specified variable types. |
static void |
validateSupportedVariableTypes(CustomAggregate expr,
ExpressionVariable.VariableType[] supportedVarTypes)
Validates that the input expression variable of the specified aggregate expression is one of the specified variable types. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ValidatorUtil()
Method Detail |
---|
public static void validateCustomExprType(CustomExpression customExpr, java.lang.Class<?> expectedExprClass) throws OdaException
customExpr
- a custom filter expression instanceexpectedExprClass
- the expected class of the custom expression
OdaException
- if validation failspublic static void validateCustomExprType(CustomAggregate customExpr, java.lang.Class<?> expectedExprClass) throws OdaException
customExpr
- a custom aggregate expression instanceexpectedExprClass
- the expected class of the custom expression
OdaException
- if validation failspublic static void validateCustomExprType(CustomFunction customExpr, java.lang.Class<?> expectedExprClass) throws OdaException
customExpr
- a custom function value expression instanceexpectedExprClass
- the expected class of the custom function value expression
OdaException
- if validation failspublic static void validateAllCustomExprType(FilterExpression expr, java.lang.Class<?> expectedExprClass) throws OdaException
customExpr
- a custom filter expression instanceexpectedExprClass
- the expected class of the custom expression
OdaException
- if validation failspublic static void validateCustomExprExtension(CustomExpression customExpr, java.lang.String expectedExtensionId) throws OdaException
customExpr
- a custom filter expression instanceexpectedExtensionId
- id of the expected oda dynamicResultSet extension
OdaException
- if validation failspublic static void validateCustomExprExtension(CustomAggregate customAggrExpr, java.lang.String expectedExtensionId) throws OdaException
customAggrExpr
- a custom aggregate expression instanceexpectedExtensionId
- id of the expected oda dynamicResultSet extension
OdaException
- if validation failspublic static void validateCustomExprExtension(CustomFunction customFuncExpr, java.lang.String expectedExtensionId) throws OdaException
customFuncExpr
- a custom function value expression instanceexpectedExtensionId
- id of the expected oda dynamicResultSet extension
OdaException
- if validation failspublic static void validateHasExprVariable(AtomicExpression expr) throws OdaException
expr
- an atomic filter expression instance
OdaException
- if validation failspublic static void validateSupportedVariableTypes(AtomicExpression expr, ExpressionVariable.VariableType[] supportedVarTypes) throws OdaException
expr
- an atomic filter expression instancesupportedVarTypes
- array of supported types of expression variable
OdaException
- if validation failspublic static void validateSupportedVariableTypes(CustomAggregate expr, ExpressionVariable.VariableType[] supportedVarTypes) throws OdaException
expr
- a custom aggregate expression instancesupportedVarTypes
- array of supported types of expression variable
OdaException
- if validation failspublic static void validateSupportedVariableDataTypes(ExpressionVariable exprVar, VariableRestrictions varRestrictions, java.lang.String odaDataSourceId, java.lang.String dataSetType) throws OdaException
exprVar
- an expression variablevarRestrictions
- supported data types defined by an oda dynamicResultSet extensionodaDataSourceId
- the id of an oda.dataSource extensiondataSetType
- the id of a data set type defined by an oda.dataSource extension;
used to map native data type to corresponding ODA data type
OdaException
- if validation failspublic static void validateSupportedVariableDataTypes(ValueExpression valueExpr, VariableRestrictions varRestrictions, java.lang.String odaDataSourceId, java.lang.String dataSetType) throws OdaException
valueExpr
- a value expressionvarRestrictions
- supported data types defined by an oda dynamicResultSet extensionodaDataSourceId
- the id of an oda.dataSource extensiondataSetType
- the id of a data set type defined by an oda.dataSource extension;
used to map native data type to corresponding ODA data type
OdaException
- if validation failspublic static void validateHasNoNullOrderingSpec(SortSpecification sortSpec) throws OdaException
sortSpec
- the sort specification found in a query spec
OdaException
- if validation failspublic static OdaException newOdaException(java.lang.String message, java.lang.String causeIdentifier)
message
- causeIdentifier
-
public static OdaException addException(OdaException rootEx, OdaException newEx)
rootEx
- the root of an OdaException chainnewEx
- a new OdaException to append to the end of the chain
public static OdaException newFilterExprException(FilterExpression invalidFilterExpr, OdaException driverEx)
invalidFilterExpr
- a top-level FilterExpression that is invaliddriverEx
- optional detail OdaException thrown by an ODA driver that has detected
the invalid state; may be null
#isInvalidFilterExpression(FilterExpression, OdaException)}
public static OdaException newFilterExprException(java.lang.String message, FilterExpression invalidFilterExpr)
message
- custom exception messageinvalidFilterExpr
- the invalid FilterExpression to set as the cause
#isInvalidFilterExpression(FilterExpression, OdaException)}
public static boolean isInvalidFilterExpression(FilterExpression filterExpr, OdaException rootEx)
filterExpr
- a filter expression whose processing might have caused
an OdaExceptionrootEx
- the root of an OdaException chain caught while processing
the filter expression
public static OdaException newAggregateException(AggregateExpression invalidAggrExpr, OdaException driverEx)
invalidAggrExpr
- the invalid AggregateExpression to set as the causedriverEx
- optional detail OdaException thrown by an ODA driver that has detected
the invalid state; may be null
#isInvalidAggregateExpression(AggregateExpression, OdaException)}
public static OdaException newAggregateException(java.lang.String message, AggregateExpression invalidAggrExpr)
message
- custom exception messageinvalidAggrExpr
- the invalid AggregateExpression to set as the cause
#isInvalidAggregateExpression(AggregateExpression, OdaException)}
public static boolean isInvalidAggregateExpression(AggregateExpression aggrExpr, OdaException rootEx)
aggrExpr
- an aggregate expression whose processing might have caused an OdaExceptionrootEx
- the root of an OdaException chain caught while processing
the aggregate expression
public static OdaException newValueExprException(ValueExpression invalidValueExpr, OdaException driverEx)
invalidValueExpr
- the invalid ValueExpression to set as the causedriverEx
- optional detail OdaException thrown by an ODA driver that has detected
the invalid state; may be null
#isInvalidValueExpression(ValueExpression, OdaException)}
public static OdaException newValueExprException(java.lang.String message, ValueExpression invalidValueExpr)
message
- custom exception messageinvalidValueExpr
- the invalid ValueExpression to set as the cause
#isInvalidValueExpression(ValueExpression, OdaException)}
public static boolean isInvalidValueExpression(ValueExpression valueExpr, OdaException rootEx)
valueExpr
- a value expression whose processing might have caused an OdaExceptionrootEx
- the root of an OdaException chain caught while processing
the value expression
public static OdaException newResultProjectionException(ResultProjection resultProj, OdaException driverEx)
resultProj
- the invalid ResultProjection to set as the causedriverEx
- optional detail OdaException thrown by an ODA driver that has detected
the invalid state; may be null
#isInvalidResultProjection(ResultProjection, OdaException)}
public static OdaException newResultProjectionException(java.lang.String message, ResultProjection resultProj)
message
- custom exception messageresultProj
- the invalid ResultProjection to set as the cause
#isInvalidResultProjection(ResultProjection, OdaException)}
public static boolean isInvalidResultProjection(ResultProjection resultProj, OdaException rootEx)
resultProj
- a result projection whose processing might have caused an OdaExceptionrootEx
- the root of an OdaException chain caught while processing the result projection
public static OdaException newSortKeyException(int sortKeySequenceOrder, OdaException driverEx)
sortKeySequenceOrder
- the sequence ordering position of a sort key that is invaliddriverEx
- optional detail OdaException thrown by an ODA driver that has detected
the invalid state; may be null
#isInvalidSortKey(int, OdaException)}
public static OdaException newSortKeyException(java.lang.String message, int sortKeySequenceOrder)
message
- custom exception messagesortKeySequenceOrder
- the sequence ordering position of a sort key that is invalid
#isInvalidSortKey(int, OdaException)}
public static boolean isInvalidSortKey(int sortKeySequenceOrder, OdaException rootEx)
sortKeySequenceOrder
- the sequence ordering position (1-based) of a sort key
whose processing might have caused an OdaExceptionrootEx
- the root of an OdaException chain caught while processing the sort key
public static OdaException newSortSpecException(SortSpecification sortSpec, OdaException driverEx)
sortSpec
- the invalid SortSpecification to set as the causedriverEx
- optional detail OdaException thrown by an ODA driver that has detected
the invalid state; may be null
#isInvalidSortSpec(SortSpecification, OdaException)}
public static OdaException newSortSpecException(java.lang.String message, SortSpecification sortSpec)
message
- custom exception messagesortSpec
- the invalid SortSpecification to set as the cause
#isInvalidSortSpec(SortSpecification, OdaException)}
public static boolean isInvalidSortSpec(SortSpecification sortSpec, OdaException rootEx)
sortSpec
- a sort specification whose processing might have caused an OdaExceptionrootEx
- the root of an OdaException chain caught while processing the sort specification
public static OdaException newResultSetSpecException(java.lang.String message, ResultSetSpecification resultSetSpec, OdaException chainedEx)
message
- custom exception messageresultSetSpec
- the invalid ResultSetSpecification to set as the causedriverEx
- optional detail OdaException thrown by an ODA driver that has detected
the invalid state; may be null
#isInvalidResultSetSpec(ResultSetSpecification, OdaException)}
public static boolean isInvalidResultSetSpec(ResultSetSpecification resultSetSpec, OdaException rootEx)
resultSetSpec
- a result set specification whose processing might have caused an OdaExceptionrootEx
- the root of an OdaException chain caught while processing the result set specification
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |