The following was investigated running Eclipse JEE Kepler while reading source code that was checked out summer 2016 and debugging Eclipse on startup.
In your workspace root folder there is a file .metadata.plugins\org.eclipse.jdt.core\variablesAndContainers.dat.
This file is read by JavaModelManager from the method loadVariablesAndContainers.
Here is the source of JavaModelManager
https://git.eclipse.org/c/e4/org.eclipse.jdt.core.git/tree/model/org/eclipse/jdt/internal/core/JavaModelManager.java
Within variablesAndContainers.dat, I believe there is an entry for each project, and each project has a container. You can see the container name as a String in the file.
Flow continues to
JavaModelManager$VariablesAndContainersLoadHelper.loadContainers(IJavaProject)
From here, the file reads a count of the number of classpath entries. For each entry, it then reads the container with the method VariablesAndContainersLoadHelper.loadClasspathEntry. This creates an array of classpath entries which represents the Java container. This is held in memory as JavaModelManager.PersistedClasspathContainer.
This is what you are looking for if creating a standalone application.
If creating an Eclipse plugin, examine the behavior of JavaModelManager.getClasspathContainer.
You'll have to study the code, and maybe debug a lot of Eclipse startups to figure out the whole format of the file.