public class Parser {
public Stacks parse(InputStream is) {
CustomClassloaderConstructor constructor = new CustomClassloaderConstructor(StacksImpl.class, this.getClass()
.getClassLoader());
TypeDescription stackDescription = new TypeDescription(StacksImpl.class);
stackDescription.putListPropertyType("availableBoms", BomImpl.class);
stackDescription.putListPropertyType("availableBomVersions", BomVersionImpl.class);
stackDescription.putListPropertyType("availableRuntimes", RuntimeImpl.class);
stackDescription.putListPropertyType("availableArchetypes", ArchetypeImpl.class);
stackDescription.putListPropertyType("availableArchetypeVersions", ArchetypeVersionImpl.class);
stackDescription.putListPropertyType("minorReleases", MinorReleaseImpl.class);
stackDescription.putListPropertyType("majorReleases", MajorReleaseImpl.class);
constructor.addTypeDescription(stackDescription);
Yaml yaml = new Yaml(constructor);
Stacks data = (Stacks) yaml.load(is);
return data;