#
Type Validator

Identifier: org.eclipse.hyades.ui.typeValidators

Since: 0.2.0

Description: A type validator allows implementors to define which types are valid for a specific context. The context is described by the "extension" and "type" attributes of this extension point. The recommend implemention is that is there is more than one validator for a given context, them a type is considered valid if any validator accepts it. In the other hand, if a context requires a validator analysis and there isn't any validator registered then no changes should be performed on the context.

Configuration Markup:

`<!ELEMENT extension (typeValidator+)>`
`<!ATTLIST extension`
`point CDATA #REQUIRED`
`id CDATA #IMPLIED`
`name CDATA #IMPLIED`
`>`

- point - a fully qualified identifier of the target extension point
- id - an optional identifier of the extension instance
- name - an optional name of the extension instance

`<!ELEMENT typeValidator EMPTY>`
`<!ATTLIST typeValidator`
`id CDATA #REQUIRED`
`extension CDATA #REQUIRED`
`type CDATA #IMPLIED`
`class CDATA #REQUIRED`
`>`

- id - a unique name that can be used to identify this validator
- extension - the validator's context extension. The extension identifies a category of objects, such as Test Suites or Traces.
- type - the type of the extension for which the validator applies.
- class - the name of the fully qualified validator class that implements `org.eclipse.hyades.ui.extension.ITypeValidator`.``

Examples: Let's say that an implementor is defining a new type of Test Suite. Due to implementation issues, it would be important to limit the types of Test Cases that are allowed to be added to this new type of test suite. In Hyades this can be done by registering a Type Validator. The extension point would be:

       <extension point="org.eclipse.hyades.ui.typeVvalidators">
          <typeValidator
             id="com.xyz.testSuite.HTTP.typeValidator"
             extension="testsuite"
             type="com.xyz.testSuite.HTTP"
             class="com.xyz.HTTPTypeValidator"/>
        </extension>

and the implementation of the ITypeValidator:

     public class HTTPTypeValidator implements ITypeValidator {
      public boolean isValidType(String type) {
       return (com.xyz.testCase.HTTP.equals(type));
      }
     }

API Information: All Hyades type validators' classes are instances of `org.eclipse.hyades.ui.extension.ITypeValidator`.

Copyright (c) 2003 Hyades project. All rights reserved. This program and the accompanying materials are made available under the terms of the Common Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/cpl-v10.html