## org.eclipse.datatools.sqltools.core
Interface ISqlDataValidator

public interface ISqlDataValidator

A SQL data validator used to validate the given data value. Also provides methods to converts the input value into normalized form.

Author:
  Shifeng Yu

Field Summary
`static int` `CONVERT_FAIL`
`static int` `SYS_ERROR`
`static int` `VALIDATE_FAIL_CONVERT_SUCCESS`
`static int` `VALIDATE_SUCCESS`

Method Summary
`java.lang.Object` `convert(java.lang.String dataType, java.lang.String inputValue, java.lang.String profileName, java.lang.String dbName)` Converts the inputValue into normalized form.
`java.lang.String` `getConvertedValue()` Returns the value converted by validate.`#convert(String, String, DatabaseIdentifier)`
`java.lang.String` `getErrorMessage()` Gets teh error message encountered during validation.
`int` `getStatus()`
`int` `validate(java.lang.String dataType, java.lang.String inputValue)` Validates a value through the convert function offered by relative database.

Field Detail

### VALIDATE_SUCCESS

    public static final int VALIDATE_SUCCESS

See Also:
  Constant Field Values

### VALIDATE_FAIL_CONVERT_SUCCESS

    public static final int VALIDATE_FAIL_CONVERT_SUCCESS

See Also:
  Constant Field Values

### CONVERT_FAIL

    public static final int CONVERT_FAIL

See Also:
  Constant Field Values

### SYS_ERROR

    public static final int SYS_ERROR

See Also:
  Constant Field Values

Method Detail

### validate

    public int validate(java.lang.String dataType,
                        java.lang.String inputValue)

  Validates a value through the convert function offered by relative database. If convert succeeds, we will get the original value or converted value. If convert fails, we will throw SQL exception.

  Parameters:
    `dataType` - data type name
    `inputValue` - input value
  Returns:
    validation status, one of `VALIDATE_SUCCESS`,`VALIDATE_FAIL_CONVERT_SUCCESS`,`CONVERT_FAIL` and `SYS_ERROR`

### getErrorMessage

    public java.lang.String getErrorMessage()

  Gets teh error message encountered during validation.

  Returns:
    error message, may be null.

### getStatus

    public int getStatus()

  Returns:
    validation status, one of `VALIDATE_SUCCESS`,`VALIDATE_FAIL_CONVERT_SUCCESS`,`CONVERT_FAIL` and `SYS_ERROR`

### getConvertedValue

    public java.lang.String getConvertedValue()

  Returns the value converted by validate.`#convert(String, String, DatabaseIdentifier)`

### convert

    public java.lang.Object convert(java.lang.String dataType,
                                    java.lang.String inputValue,
                                    java.lang.String profileName,
                                    java.lang.String dbName)
                             throws java.lang.Exception

  Converts the inputValue into normalized form. If the value is invalid, `Exception` will be thrown.

  Parameters:
    `dataType` - data type name
    `inputValue` - input value
  Returns:
    converted value
  Throws:
    `java.lang.Exception`

Copyright © 2006 Actuate, IBM Corporation, Sybase, Inc. and others. All rights reserved.