List dependencies = toDependencyTypes(environment.getDependencies());
DependencyType[] dependencyTypes = (DependencyType[]) dependencies.toArray(new DependencyType[dependencies.size()]);
DependenciesType dependenciesType = environmentType.addNewDependencies();
dependenciesType.setDependencyArray(dependencyTypes);
ClassLoadingRules classLoadingRules = environment.getClassLoadingRules();
if (classLoadingRules.isInverseClassLoading()) {
environmentType.addNewInverseClassloading();
}
if (environment.isSuppressDefaultEnvironment()) {
environmentType.addNewSuppressDefaultEnvironment();
}
ClassLoadingRule classLoadingRule = classLoadingRules.getHiddenRule();
environmentType.setHiddenClasses(toFilterType(classLoadingRule.getClassPrefixes()));
classLoadingRule = classLoadingRules.getNonOverrideableRule();
environmentType.setNonOverridableClasses(toFilterType(classLoadingRule.getClassPrefixes()));
classLoadingRule = classLoadingRules.getPrivateRule();
environmentType.setPrivateClasses(toFilterType(classLoadingRule.getClassPrefixes()));
return environmentType;
}