Editing classpath entries while importing

How could I change classpath entries of Buildship while I import or refresh a Gradle project?

I am in the configure method of a ProjectConfigurator implementation. I have access to the IJavaProject reference of the Eclipse project. I can retrieve the IClasspathEntry with the path org.eclipse.buildship.core.gradleclasspathcontainer but I could not find out how to access and in the end modify the entries of this class path container.

I want to add source and javadoc attachments to given JAR entries of the classpath.

How could I do this without modifying the build.gradle file?

In an Eclipse plugin you can define a ProjectConfigurator extension that runs after the built-in org.eclipse.buildship.core.internal.workspace.BaseConfigurator and directly modifies the classpath of the workspace project.