Feature Validator Runner custom Java class extension


Purpose
This sample demonstrates how to create, deploy, and use a custom class extension tool in Java. The class extension featured in this sample is associated with a new feature class and is used to validate features that are added to the feature class. For example, an e-mail address must adhere to a certain pattern (<email_id>@<domain.com>). If the editor adds a feature that has an e-mail address that does not follow this pattern, the class extension outputs appropriate error messages indicating violation of the pattern.
 
This sample creates a file geodatabase (GDB) and a feature class inside the file GDB. The output is a message returned by the class extension. This sample can be modified to test invalid e-mail addresses, and the validator will output appropriate messages. No message is returned by the class extension if the correct pattern for the e-mail ID is provided.

How to use

See How to use ArcGIS samples for help on running the sample. If the sample has associated data, you will find that the sample's zip file includes a "data" folder alongside the language folders. However, you will need to update the sample to point to the location of the data once you have extracted all the files.

Deploy extension to ArcGIS Desktop
  1. Navigate to this sample's lib folder (featurevalidation/lib) and copy FeatureValidationExt.jar into the <ArcGIS Desktop Install Dir>/java/lib/ext folder to deploy the custom feature class extension. The extension functionality will become available to you when you start the runner application.
  2. Navigate to this sample's bin folder (featurevalidation/bin) and execute the FeatureValidation.jar to start the application (Eclipse can also be used to execute the application - ValidatorRunner.java).
  3. Review the output messages on the command prompt or in Eclipse's output window.
  4. Use ArcCatalog or ArcMap to review the data in the output location.


Download the files for Java
geodatabase/FeatureValidationRunner.java Main class
geodatabase/classextension/FeatureValidator.java Class extension class

See Also:

Getting started with class extensions




Additional Requirements
  • ArcGIS Desktop Installation

Development licensing Deployment licensing
ArcView ArcView
ArcEditor ArcEditor
ArcInfo ArcInfo
Engine Developer Kit