* @param rootResources root resources in ResourceModel type
* @return constructed ResourceSchemaCollection
*/
public static ResourceSchemaCollection loadOrCreateResourceSchema(Map<String, ResourceModel> rootResources)
{
final ResourceModelEncoder encoder = new ResourceModelEncoder(new NullDocsProvider());
final Map<String, ResourceSchema> schemaMap = new TreeMap<String, ResourceSchema>();
for (ResourceModel resource : rootResources.values())
{
schemaMap.put(resource.getName(), encoder.loadOrBuildResourceSchema(resource));
}
return new ResourceSchemaCollection(schemaMap);
}