com.esri.arcgis.geodatabase
Interface IFieldChecker

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
FieldChecker, IFieldCheckerProxy

public interface IFieldChecker
extends java.io.Serializable

Provides access to members that control the Field Checker.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Description

IFieldChecker is used to validate the Fields object. This is ideally used when you are creating a new FeatureClass based on another FeatureClass, when it is stored in a different database format, i.e., Workspace. IFieldChecker is responsible for verifying that the field names, datatypes, and other parameters meet a generic minimum set of criteria--this is so they will work for Geodatabase, Shapefile or Coverage data formats. If you use IFeatureDataConverter, use the IFieldChecker to create the IFields object for the output FeatureClass or Table.

Remarks

The InputWorkspace and ValidateWorkspace methods should be used when validating IFields and TableNames where the input and output datasets are in a different format, i.e: shapefile vs. Geodatabase. Since different data formats (or DBMSs when using a Geodatabase) have different requirements and limitations, using both of these methods is required to provide proper validation and reserved word dictionary selection.

 

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


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(java.lang.String tableName, java.lang.String[] fixedName)
          Checks the validity of a table name.
 

Method Detail

validate

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

Supported Platforms

Windows, Solaris, Linux

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. 

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:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

validateTableName

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

Supported Platforms

Windows, Solaris, Linux

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.

Remarks

.

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

validateField

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

Supported Platforms

Windows, Solaris, Linux

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.

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:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getValidateWorkspace

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

Supported Platforms

Windows, Solaris, Linux

Description

The InputWorkspace and ValidateWorkspace methods should be used when validating IFields and TableNames where the input and output datasets are in a different format, i.e: shapefile vs. Geodatabase. Since different data formats (or DBMSs when using a Geodatabase) have different requirements and limitations, using both of these methods are required to provide proper validation and reserved word dictionary selection.

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

setValidateWorkspaceByRef

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

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

getInputWorkspace

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

Supported Platforms

Windows, Solaris, Linux

Description

The InputWorkspace and ValidateWorkspace methods should be used when validating IFields and TableNames where the input and output datasets are in a different format, i.e: shapefile vs. Geodatabase. Since different data formats (or DBMSs when using a Geodatabase) have different requirements and limitations, using both of these methods are required to provide proper validation and reserved word dictionary selection.

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

setInputWorkspace

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

Supported Platforms

Windows, Solaris, Linux

Description

The InputWorkspace and ValidateWorkspace methods should be used when validating IFields and TableNames where the input and output datasets are in a different format, i.e: shapefile vs. Geodatabase. Since different data formats (or DBMSs when using a Geodatabase) have different requirements and limitations, using both of these methods are required to provide proper validation and reserved word dictionary selection.

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

getValidateDictionary

public ISqlKeywordDictionary getValidateDictionary()
                                            throws java.io.IOException,
                                                   AutomationException
Fieldchecker dictionary.

Supported Platforms

Windows, Solaris, Linux

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.

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

setValidateDictionaryByRef

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

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