private static void parseObjectTypeDefsFromSchemaHandling( RefinedResourceSchemaImpl rSchema, ResourceType resourceType, SchemaHandlingType schemaHandling, Collection<ResourceObjectTypeDefinitionType> resourceObjectTypeDefs, ShadowKindType impliedKind, PrismContext prismContext, String contextDescription) throws SchemaException { if (resourceObjectTypeDefs == null) { return; } Map<ShadowKindType, RefinedObjectClassDefinition> defaults = new HashMap<>(); for (ResourceObjectTypeDefinitionType accountTypeDefType : resourceObjectTypeDefs) { RefinedObjectClassDefinition rOcDef = RefinedObjectClassDefinitionImpl.parse( accountTypeDefType, resourceType, rSchema, impliedKind, prismContext, contextDescription); if (rOcDef.isDefault()) { if (defaults.containsKey(rOcDef.getKind())) { throw new SchemaException( "More than one default " + rOcDef.getKind() + " definitions (" + defaults.get(rOcDef.getKind()) + ", " + rOcDef + ") in " + contextDescription); } else { defaults.put(rOcDef.getKind(), rOcDef); } } rSchema.add(rOcDef); } }
@Override public List<? extends RefinedObjectClassDefinition> getRefinedDefinitions(ShadowKindType kind) { List<RefinedObjectClassDefinition> rv = new ArrayList<>(); for (RefinedObjectClassDefinition def : getRefinedDefinitions()) { if (MiscSchemaUtil.matchesKind(kind, def.getKind())) { rv.add(def); } } return rv; }