@Test(expected = IllegalArgumentException.class) public void testDuplicateComponentNames() throws ResourceInitializationException { AggregateBuilder builder = new AggregateBuilder(); builder.add("name", AnalysisEngineFactory.createEngineDescription(Annotator1.class, typeSystemDescription)); builder.add("name", AnalysisEngineFactory.createEngineDescription(Annotator1.class, typeSystemDescription)); }
public String add(AnalysisEngineDescription aed, String... viewNames) { String componentName = aed.getAnalysisEngineMetaData().getName(); if (componentName == null || componentName.equals("")) { if (aed.isPrimitive()) { componentName = aed.getAnnotatorImplementationName(); } else { componentName = "aggregate"; } } if (componentNames.contains(componentName)) { componentName = componentName + "." + (componentNames.size() + 1); } add(componentName, aed, viewNames); return componentName; }
AggregateBuilder { public String add(AnalysisEngineDescription aed, String... viewNames) { String componentName = aed.getAnalysisEngineMetaData().getName(); if (componentName == null || componentName.equals("")) { if (aed.isPrimitive()) { componentName = aed.getAnnotatorImplementationName(); } else { componentName = "aggregate"; } } if (componentNames.contains(componentName)) { componentName = componentName + "." + (componentNames.size() + 1); } add(componentName, aed, viewNames); return componentName; } }
AggregateBuilder { public String add(AnalysisEngineDescription aed, String... viewNames) { String componentName = aed.getAnalysisEngineMetaData().getName(); if (componentName == null || componentName.equals("")) { if (aed.isPrimitive()) { componentName = aed.getAnnotatorImplementationName(); } else { componentName = "aggregate"; } } if (componentNames.contains(componentName)) { componentName = componentName + "." + (componentNames.size() + 1); } add(componentName, aed, viewNames); return componentName; } AggregateBuilder();  AggregateBuilder(TypeSystemDescription typeSystemDescription,
          TypePriorities typePriorities, FlowControllerDescription flowControllerDescription); }
AggregateBuilder { public String add(AnalysisEngineDescription aed, String... viewNames) { String componentName = aed.getAnalysisEngineMetaData().getName(); if (componentName == null || componentName.equals("")) { if (aed.isPrimitive()) { componentName = aed.getAnnotatorImplementationName(); } else { componentName = "aggregate"; } } if (componentNames.contains(componentName)) { componentName = componentName + "." + (componentNames.size() + 1); } add(componentName, aed, viewNames); return componentName; } AggregateBuilder();  AggregateBuilder(TypeSystemDescription typeSystemDescription,
          TypePriorities typePriorities, FlowControllerDescription flowControllerDescription); String add(AnalysisEngineDescription aed, String... viewNames); void add(String componentName, AnalysisEngineDescription aed, String... viewNames); void addSofaMapping(String componentName, String componentViewName,
          String aggregateViewName); void setFlowControllerDescription(FlowControllerDescription flowControllerDescription); AnalysisEngine createAggregate(); AnalysisEngineDescription createAggregateDescription(); }
AggregateBuilder { public String add(AnalysisEngineDescription aed, String... viewNames) { String componentName = aed.getAnalysisEngineMetaData().getName(); if (componentName == null || componentName.equals("")) { if (aed.isPrimitive()) { componentName = aed.getAnnotatorImplementationName(); } else { componentName = "aggregate"; } } if (componentNames.contains(componentName)) { componentName = componentName + "." + (componentNames.size() + 1); } add(componentName, aed, viewNames); return componentName; } AggregateBuilder();  AggregateBuilder(TypeSystemDescription typeSystemDescription,
          TypePriorities typePriorities, FlowControllerDescription flowControllerDescription); String add(AnalysisEngineDescription aed, String... viewNames); void add(String componentName, AnalysisEngineDescription aed, String... viewNames); void addSofaMapping(String componentName, String componentViewName,
          String aggregateViewName); void setFlowControllerDescription(FlowControllerDescription flowControllerDescription); AnalysisEngine createAggregate(); AnalysisEngineDescription createAggregateDescription();  }