public void process(ResourceDefinition resource) { // add resourceAPI level authentication schemes if resource authentication schemes are absent if (resource.getSecuredBy().isEmpty()) { ResourceAPI resourceAPI = (ResourceAPI) resource.eContainer(); if (resourceAPI != null) { resource.getSecuredBy().addAll(resourceAPI.getSecuredBy()); } } for (Method method : resource.getMethods()) { // add resource level authentication schemes if method authentication schemes are absent if (method.getSecuredBy().isEmpty()) { if (resource != null) { method.getSecuredBy().addAll(resource.getSecuredBy()); } } } } }