## org.eclipse.datatools.connectivity.oda.spec
Class ValidationContext

    java.lang.Object
      org.eclipse.datatools.connectivity.oda.spec.ValidationContext

    public class ValidationContext

extends java.lang.Object

The context for validation of a query specification and associated query specification expressions. It may include a custom validator and/or the contributor of the expression being validated.

Since:
  3.3 (DTP 1.8)

Nested Class Summary
`class` `ValidationContext.Connection` A connection context for online validation.

Constructor Summary
`ValidationContext(ExtensionContributor contributor)`
`ValidationContext(IValidator validator)`

Method Summary
`ValidationContext.Connection` `getConnection()` Gets the optional connection context that may be used by an `IValidator` implementation for online validation.
`ExtensionContributor` `getContributor()` Gets the contributor of a custom filter expression being validated.
`java.lang.Object` `getData(java.lang.String key)` Gets the value of a named property.
`java.lang.String` `getQueryText()` Gets the optional query text specified in this context.
`IValidator` `getValidator()` Gets the custom validator of a filter expression being validated.
`void` `setConnection(ValidationContext.Connection validationConn)` Sets the connection context for online validation.
`void` `setData(java.lang.String key, java.lang.Object value)` Sets the value of a named property.
`void` `setQueryText(java.lang.String queryText)` Sets the query text specified in this context.
`void` `setValidator(IValidator validator)` Sets the custom validator of a filter expression being validated.

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### ValidationContext

    public ValidationContext(ExtensionContributor contributor)

### ValidationContext

    public ValidationContext(IValidator validator)

Method Detail

### getContributor

    public ExtensionContributor getContributor()

  Gets the contributor of a custom filter expression being validated.

  Returns:
    an instance of the `ExtensionContributor` that defines its scope and capabilities, or null if none is available

### getValidator

    public IValidator getValidator()

  Gets the custom validator of a filter expression being validated.

  Returns:
    an `IValidator` instance, or null if none is available

### setValidator

    public void setValidator(IValidator validator)

  Sets the custom validator of a filter expression being validated.

  Parameters:
    `validator` - an `IValidator` instance

### getData

    public java.lang.Object getData(java.lang.String key)

  Gets the value of a named property. An extension contributor may associate arbitrary object to an extension-defined property for use at validation.

  Parameters:
    `key` - the name of property
  Returns:
    the value of the named property, or null if it has not been set

### setData

    public void setData(java.lang.String key,
                        java.lang.Object value)

  Sets the value of a named property. An extension contributor may associate arbitrary object to an extension-defined property for use at validation.

  Parameters:
    `key` - the name of property
    `value` - the new value of the named property

### getQueryText

    public java.lang.String getQueryText()

  Gets the optional query text specified in this context.

  Returns:
    the query text specified in context, may be null if none is specified

### setQueryText

    public void setQueryText(java.lang.String queryText)

  Sets the query text specified in this context.

  Parameters:
    `queryText` - query text; may be null to unset previous value

### getConnection

    public ValidationContext.Connection getConnection()

  Gets the optional connection context that may be used by an `IValidator` implementation for online validation. A client may optimize performance by re-using its properties for opening a related connection to prepare and execute a query.

  Returns:
    the connection context for online validation; may be null if none is specified

### setConnection

    public void setConnection(ValidationContext.Connection validationConn)

  Sets the connection context for online validation. The connection context, if exists, may be used by an `IValidator` implementation to open a connection to perform online validation.

  Parameters:
    `props` - connection properties for opening a connection for online validation