Type Validator

org.eclipse.hyades.ui.typeValidators

0.2.0

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.

<!ELEMENT extension (typeValidator+)>

<!ATTLIST extension

point CDATA #REQUIRED

id    CDATA #IMPLIED

name  CDATA #IMPLIED>


<!ELEMENT typeValidator EMPTY>

<!ATTLIST typeValidator

id        CDATA #REQUIRED

extension CDATA #REQUIRED

type      CDATA #IMPLIED

class     CDATA #REQUIRED>


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));
  }
 }

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