public BundleInstantiationSpecification(ComponentSpecification id, ComponentSpecification classId, ComponentSpecification bundle) { this.id = id.toId(); this.classId = (classId != null) ? classId : id.withoutNamespace(); this.bundle = (bundle != null) ? bundle : this.classId; }
@Override public String toString() { return toId().toString(); }
private static boolean matches(ComponentSpecification component, Set<ComponentSpecification> excludes) { ComponentId id = component.toId().withoutNamespace(); for (ComponentSpecification exclude : excludes) { if (exclude.matches(id)) { return true; } } return false; }
public void fillQueryProfileTypes(List<Element> queryProfileTypeElements, QueryProfileTypeRegistry registry) { for (Element element : queryProfileTypeElements) { QueryProfileType type = registry.getComponent(new ComponentSpecification(element.getAttribute("id")).toId()); try { readInheritedTypes(element, type, registry); readFieldDefinitions(element, type, registry); } catch (RuntimeException e) { throw new IllegalArgumentException("Error reading " + type, e); } } }
public boolean hasChainThatInherits(ComponentId filterChain) { for (Chain<Filter> chain : allChains().allComponents()) { for (ComponentSpecification spec : chain.getChainSpecification().inheritance.chainSpecifications) { if(spec.toId().equals(filterChain)) return true; } } return false; }
public void fillQueryProfiles(List<Element> queryProfileElements, QueryProfileRegistry registry) { for (Element element : queryProfileElements) { // Lookup by exact id QueryProfile profile = registry.getComponent(new ComponentSpecification(element.getAttribute("id")).toId()); try { readInherited(element, profile, registry,null, profile.toString()); readFields(element, profile, registry,null, profile.toString()); readVariants(element, profile, registry); } catch (RuntimeException e) { throw new IllegalArgumentException("Error reading " + profile, e); } } }
private static void fillProfileType(QueryProfilesConfig.Queryprofiletype config, QueryProfileTypeRegistry registry) { QueryProfileType type = registry.getComponent(new ComponentSpecification(config.id()).toId()); try { for (String inheritedId : config.inherit()) { QueryProfileType inherited = registry.getComponent(inheritedId); if (inherited == null) throw new IllegalArgumentException("Inherited query profile type '" + inheritedId + "' in " + type + " was not found"); else type.inherited().add(inherited); } for (QueryProfilesConfig.Queryprofiletype.Field fieldConfig : config.field()) instantiateFieldDescription(fieldConfig,type,registry); } catch (IllegalArgumentException e) { throw new IllegalArgumentException("Invalid " + type,e); } }
QueryProfileRegistry registry, Set<ComponentId> filled) { QueryProfile profile = registry.getComponent(new ComponentSpecification(config.id()).toId()); if (filled.contains(profile.getId())) return; filled.add(profile.getId());