return;
}
// Determine if a group is being declared
TypePolicy typePolicy = currentLocation(TypePolicy.class);
GroupDefinition groupDefinition = currentLocation(GroupDefinition.class);
if (groupDefinition != null) {
// Ensure that all the PropertyPaths are set up
List<PropertyPath> paths = ensureReferent(groupDefinition.getPaths());
Class<? extends HasUuid> type = ensureReferent(typePolicy);
if (type == null) {
unresolved.add(typePolicy.getName());
return;
}
SecurityGroup group = paths.isEmpty() ?
securityGroups.getGroupEmpty() :
securityGroups.getGroup(type, groupDefinition.getName().toString(),
groupDefinition.toSource(), paths);
x.setReferent(group);
return;
}
// Find an already-declared group
GroupDefinition group = scope().get(GroupDefinition.class, x);
if (group != null) {
x.setReferent(ensureReferent(group));
return;
}
// Otherwise, it's a global name
x.setReferent(securityGroups.getGroupGlobal(x.getSimpleName()));
GroupDefinition globalDef = new GroupDefinition();
globalDef.setLineNumber(x.getLineNumber());
globalDef.setName(x);
rootScope.put(globalDef);
}