com.esri.arcgis.geodatabase
Interface IFieldChecker

All Superinterfaces:
Serializable
All Known Implementing Classes:
FieldChecker

public interface IFieldChecker
extends Serializable

Provides access to members that control the Field Checker.

Description

IFieldChecker has methods for validating fields collections and table names for a specific workspace. It's strongly recommended that this interface be used prior to two types of operations:

The main difference between these two cases is that while setting the ValidateWorkspace property is required to validate in either case, setting the InputWorkspace property is only required for the second case.

The Validate and ValidateField methods are responsible for verifying that field name, data types, and other parameters meet a minimum set of criteria that are required for the target workspace (set using the ValidateWorkspace property). ValidateTableName is used to verify that a table's name is not a reserved word, and that it does not start with or contain any invalid characters.

Remarks

The logic used to determine if the OID field should be renamed to "ObjectID" can be classified with 4 cases.

Case1: Both the InputWorkspace and ValidateWorkspace are provided.

Case2: Only the InputWorkspace is provided (the ValidateWorkspace has not been provided).

Case3: Only the ValidateWorkspace is provided (the InputWorkspace has not been provided).

Case4: Neither of the workspaces is provided

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.


Method Summary
 IWorkspace getInputWorkspace()
          Input workspace of the fieldchecker.
 ISqlKeywordDictionary getValidateDictionary()
          Fieldchecker dictionary.
 IWorkspace getValidateWorkspace()
          Workspace of the fieldchecker.
 void setInputWorkspace(IWorkspace inputWorkspace)
          Input workspace of the fieldchecker.
 void setValidateDictionaryByRef(ISqlKeywordDictionary validateDictionary)
          Fieldchecker dictionary.
 void setValidateWorkspaceByRef(IWorkspace validateWorkspace)
          Workspace of the fieldchecker.
 void validate(IFields inputField, IEnumFieldError[] error, IFields[] fixedFields)
          Checks the validity of a list of field names.
 void validateField(int fieldIndex, IFields inputFields, IEnumFieldError[] error, IFields[] fixedFields)
          Checks the validity of a field.
 int validateTableName(String tableName, String[] fixedName)
          Checks the validity of a table name.
 

Method Detail

validate

void validate(IFields inputField,
              IEnumFieldError[] error,
              IFields[] fixedFields)
              throws IOException,
                     AutomationException
Checks the validity of a list of field names.

Description

Validate sets the IFields parameter to a set of fields valid for the target data format, and sets the IEnumFieldError to contain field error codes and associated field names. The error codes are stored as a esriFieldNameErrorType. If the IEnumFieldError is returned as Nothing then no errors were found.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
inputField - A reference to a com.esri.arcgis.geodatabase.IFields (in)
error - A reference to a com.esri.arcgis.geodatabase.IEnumFieldError (out: use single element array)
fixedFields - A reference to a com.esri.arcgis.geodatabase.IFields (out: use single element array)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

validateTableName

int validateTableName(String tableName,
                      String[] fixedName)
                      throws IOException,
                             AutomationException
Checks the validity of a table name.

Description

ValidateTableName verifies that a table name is valid for the target data format, and if needed, returns a compliant table name. This method returns a esriTableNameErrorType indicating the type of error. Table existence is not checked.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
tableName - The tableName (in)
fixedName - The fixedName (out: use single element array)
Returns:
The error
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

validateField

void validateField(int fieldIndex,
                   IFields inputFields,
                   IEnumFieldError[] error,
                   IFields[] fixedFields)
                   throws IOException,
                          AutomationException
Checks the validity of a field.

Description

ValidateFields validates a field selected using its FieldIndex value from the entered IFields object. If the field is not valid IEnumFieldError and a IFields object is returned. The IEnumFieldError object will contain the field error code and the associated field name. The error codes are stored as a esriFieldNameErrorType. If the IEnumFieldError is returned as Nothing then no errors were found. The returned IFields object will include compliant field names.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
fieldIndex - The fieldIndex (in)
inputFields - A reference to a com.esri.arcgis.geodatabase.IFields (in)
error - A reference to a com.esri.arcgis.geodatabase.IEnumFieldError (out: use single element array)
fixedFields - A reference to a com.esri.arcgis.geodatabase.IFields (out: use single element array)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getValidateWorkspace

IWorkspace getValidateWorkspace()
                                throws IOException,
                                       AutomationException
Workspace of the fieldchecker.

Description

Setting the ValidateWorkspace property is required prior to using any of this interface's Validate methods. This property should be set to the workspace where the dataset being validated is to be created.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Returns:
A reference to a com.esri.arcgis.geodatabase.IWorkspace
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setValidateWorkspaceByRef

void setValidateWorkspaceByRef(IWorkspace validateWorkspace)
                               throws IOException,
                                      AutomationException
Workspace of the fieldchecker.

Description

Setting the ValidateWorkspace property is required prior to using any of this interface's Validate methods. This property should be set to the workspace where the dataset being validated is to be created.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
validateWorkspace - A reference to a com.esri.arcgis.geodatabase.IWorkspace (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getInputWorkspace

IWorkspace getInputWorkspace()
                             throws IOException,
                                    AutomationException
Input workspace of the fieldchecker.

Description

The InputWorkspace property should be set when the IFieldChecker interface is used for creating a dataset that uses another dataset's fields. For example, when using the feature data converter to create a new dataset, or when cloning the fields of an existing dataset to use with a new dataset.

This property should be set to the source workspace - the workspace that contains the original dataset, not the newly created dataset.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Returns:
A reference to a com.esri.arcgis.geodatabase.IWorkspace
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setInputWorkspace

void setInputWorkspace(IWorkspace inputWorkspace)
                       throws IOException,
                              AutomationException
Input workspace of the fieldchecker.

Description

The InputWorkspace property should be set when the IFieldChecker interface is used for creating a dataset that uses another dataset's fields. For example, when using the feature data converter to create a new dataset, or when cloning the fields of an existing dataset to use with a new dataset.

This property should be set to the source workspace - the workspace that contains the original dataset, not the newly created dataset.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
inputWorkspace - A reference to a com.esri.arcgis.geodatabase.IWorkspace (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getValidateDictionary

ISqlKeywordDictionary getValidateDictionary()
                                            throws IOException,
                                                   AutomationException
Fieldchecker dictionary.

Description

The ValidateDictionary method provides access to the dictionary used to verify that field and table names are reserved words in the target data source. A ISqlKeywordDictionary object can be used to search the dictionary used to validate a name when IFieldChecker::ValidateWorkspace has been set. If a ValidateWorkspace has not been set a custom keyword dictionary can be built using ISqlKeywordDictionary. If the ValidateWorkspace has been set the dictionary can not be changed.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Returns:
A reference to a com.esri.arcgis.geodatabase.ISqlKeywordDictionary
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setValidateDictionaryByRef

void setValidateDictionaryByRef(ISqlKeywordDictionary validateDictionary)
                                throws IOException,
                                       AutomationException
Fieldchecker dictionary.

Description

The ValidateDictionary method provides access to the dictionary used to verify that field and table names are reserved words in the target data source. A ISqlKeywordDictionary object can be used to search the dictionary used to validate a name when IFieldChecker::ValidateWorkspace has been set. If a ValidateWorkspace has not been set a custom keyword dictionary can be built using ISqlKeywordDictionary. If the ValidateWorkspace has been set the dictionary can not be changed.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
validateDictionary - A reference to a com.esri.arcgis.geodatabase.ISqlKeywordDictionary (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.