# Validator Group

###### Identifier:

org.eclipse.wst.validation.validatorGroup

###### Since:

WebTools 3.0

###### Description:

Defines a grouping for validators with listeners notified of group members' activites. Useful for pre-caching common information used by multiple validators and disposing of that information when they're all done.

###### Configuration Markup:

<!ELEMENT extension (group+)>

<!ATTLIST extension

point CDATA #REQUIRED

id CDATA #IMPLIED

name CDATA #IMPLIED>

- id - A unique identifier for this extension
- name - A name for this extension

<!ELEMENT listener EMPTY>

<!ATTLIST listener

class CDATA #REQUIRED>

A listener for activities in this group.

- class - The listener's class.

<!ELEMENT group (listener+)>

<!ATTLIST group

id IDREF #REQUIRED>

Declares a validator group. A group may have multiple listeners.

- id -

###### Examples:

Define a listener that simply prints that it has been called.

    <extension point="org.eclipse.wst.validation.validatorGroup">
       <group id="validatorGroup">
         <listener class="org.eclipse.wst.validation.example.ValidatorGroupListener"/>
       </group>
    </extension>

    public class org.eclipse.wst.validation.example.ValidatorGroupListener implements IValidatorGroupListener {

      public ValidatorGroupListener() {
      }

      public void validationFinishing(IResource resource, IProgressMonitor monitor, ValType valType, ValOperation operation) {
       System.out.println("Finishing:" + resource.getFullPath());
      }

      public void validationStarting(IResource resource, IProgressMonitor monitor, ValType valType, ValOperation operation) {
       System.out.println("Starting:" + resource.getFullPath());
      }
    }

    <extension id="id" name="name" point="org.eclipse.wst.validation.validatorV2">
      <validator class="org.eclipse.wst.validation.example.Validator">
        <group id="org.eclipse.wst.validation.example.validatorGroup"/>
      </validator>
    </extension>

###### API Information:

Provisional API.

Copyright (c) 2008 IBM Corporation and others.
All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html