protected ServiceHandlerDefinitionContext copy(boolean clean) { ServiceHandlerDefinitionContext copy = new ServiceHandlerDefinitionContext(); copy.root = root; if (!clean) { for (String qn : services.keySet()) { TypeDefinition d = services.get(qn); if (d.exists()) { copy.services.put(qn, d); } } copy.serviceAnnotations.addAll(serviceAnnotations); } return copy; }
public void buildBeans(CDIProject target) { CDIProject p = target; Map<String, TypeDefinition> services = context.getServices(); for (TypeDefinition d : services.values()) { ClassBean b = new ClassBean(); b.setDefinition(d); b.setParent(p); p.addBean(b); } }
public void buildDefinitions(FileSet fileSet) { ServiceHandlerDefinitionContext workingCopy = (ServiceHandlerDefinitionContext) context.getWorkingCopy(); Map<IPath, List<IType>> is = fileSet.getInterfaces(); for (IPath path : is.keySet()) { for (IType t : is.get(path)) { InterfaceDefinition i = new InterfaceDefinition(t, workingCopy); List<IAnnotationDeclaration> as = i.getAnnotations(); for (IAnnotationDeclaration a : as) { if (workingCopy.isServiceAnnotation(a.getType())) { TypeDefinition d = new TypeDefinition(); d.setType(t, workingCopy.getRootContext(), 0); d.setBeanConstructor(true); workingCopy.addService(path, d); } } } } }