public void addLibraryDeclaration(PluginLibraryDeclaration declaration) {
    if (fLibraryDeclarations == null) fLibraryDeclarations = new ArrayList();

    fLibraryDeclarations.add(declaration);
    declaration.setParent(this);

    if (!getLibraryIds().contains(declaration.getName())) {
      beginInternalCall("calling setLibrarySpecificationPath");

      try {
        setLibrarySpecificationPath(declaration.getName(), declaration.getResourcePath());
      } finally {
        endInternalCall();
      }
    }
  }
  public void validate(IScannerValidator validator) {

    if (fComponentTypeDeclarations != null) {
      for (int i = 0; i < fComponentTypeDeclarations.size(); i++) {

        PluginComponentTypeDeclaration element =
            (PluginComponentTypeDeclaration) fComponentTypeDeclarations.get(i);
        element.validate(this, validator);
      }
    }

    if (fPageDeclarations != null) {
      for (int i = 0; i < fPageDeclarations.size(); i++) {

        PluginPageDeclaration element = (PluginPageDeclaration) fPageDeclarations.get(i);
        element.validate(this, validator);
      }
    }

    if (fEngineServiceDeclarations != null) {
      for (int i = 0; i < fEngineServiceDeclarations.size(); i++) {

        PluginEngineServiceDeclaration element =
            (PluginEngineServiceDeclaration) fEngineServiceDeclarations.get(i);
        element.validate(this, validator);
      }
    }

    if (fExtensionDeclarations != null) {
      for (int i = 0; i < fExtensionDeclarations.size(); i++) {

        PluginExtensionSpecification element =
            (PluginExtensionSpecification) fExtensionDeclarations.get(i);
        element.validate(this, validator);
      }
    }

    if (fLibraryDeclarations != null) {
      for (int i = 0; i < fLibraryDeclarations.size(); i++) {

        PluginLibraryDeclaration element = (PluginLibraryDeclaration) fLibraryDeclarations.get(i);
        element.validate(this, validator);
      }
    }
  }