## org.eclipse.wst.validation
Interface IDependencyIndex

    public interface IDependencyIndex

This service is used to specify the resources that a particular resource depends on.

This is an optional service, validators do not need to use this Interface and can simply supply their dependency information through the ValidationResult return result.

Provisional API: This class/interface is part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.

See Also:
  `ValidationResult`

Method Summary
`void` `add(java.lang.String id, IResource dependent, IResource dependsOn)` Assert that one resource depends on another resource as part of it's validity.
`void` `clear(IProject project)` Remove all the dependency assertions for this project.
`java.util.List<DependentResource>` `get(IResource resource)` Answer all the resources that depend on this resource.
`IResource[]` `get(java.lang.String id, IResource resource)` Answer all the resources that depend on this resource.
`boolean` `isDependedOn(IResource resource)` Answer true if other resources depend on this resource.
`void` `set(java.lang.String id, IResource dependent, IResource[] dependsOn)` Replace all the resources that the dependent depends on.

Method Detail

### add

    void add(java.lang.String id,
             IResource dependent,
             IResource dependsOn)

  Assert that one resource depends on another resource as part of it's validity.

  For example, if an XML file is dependent on an XSD file to be valid, the resource that holds the XML file would be the dependent, and the resource that holds the XSD would be the dependsOn.

  Parameters:
    `id` - The validator id that is asserting that the dependency exists.
    `dependent` - The resource that is dependent on the other resource. For example a XML file.
    `dependsOn` - The resource that this being depended on. For example a XSD file.

### clear

    void clear(IProject project)

  Remove all the dependency assertions for this project.

  Parameters:
    `project` - The project that will have it's dependency assertions removed.

### get

    java.util.List<DependentResource> get(IResource resource)

  Answer all the resources that depend on this resource. For example, if this resource was a XSD, this could answer all the XML files that depended on it for their validity.

  Parameters:
    `resource` - A resource that other resources may depend on.
  Returns:
    the dependent resources.

### get

    IResource[] get(java.lang.String id,
                    IResource resource)

  Answer all the resources that depend on this resource. For example, if this resource was a XSD, this could answer all the XML files that depended on it for their validity.

  Parameters:
    `id` - The validator id that asserted that the dependency exists.
    `resource` - A resource that other resources may depend on.
  Returns:
    the dependent resources. This method can return null or an empty array, if there are no dependent resources.

### isDependedOn

    boolean isDependedOn(IResource resource)

  Answer true if other resources depend on this resource.

  Parameters:
    `resource` - The resource being tested.
  Returns:
    true if any of the validators asserted a dependency on this resource.

### set

    void set(java.lang.String id,
             IResource dependent,
             IResource[] dependsOn)

  Replace all the resources that the dependent depends on.

  Parameters:
    `id` - The validator id that is asserting that the dependency exists.
    `dependent` - The resource that is dependent on the other resource.
    `dependsOn` - All the resources that are depended on. This can be null or a zero length array. Null or a zero length array removes all the dependencies.