private DomainDeclaredType replaceTypeParamsByWildcard(DomainDeclaredType domainDeclared) { if (domainDeclared.getTypeVariables().size() > 0) { MutableTypeVariable[] typeVariables = new MutableTypeVariable[domainDeclared.getTypeVariables().size()]; for (int i = 0; i < domainDeclared.getTypeVariables().size(); i++) { typeVariables[i] = envContext.getProcessingEnv().getTypeUtils().getTypeVariable(MutableWildcardType.WILDCARD_NAME); } domainDeclared.setTypeVariables(typeVariables); } return domainDeclared; } }
private Set<? extends MutableTypeMirror> processBounds(Set<? extends MutableTypeMirror> bounds) { if (bounds.size() > 0) { Set<MutableTypeMirror> newBounds = new HashSet<MutableTypeMirror>(); Iterator<? extends MutableTypeMirror> iterator = bounds.iterator(); while (iterator.hasNext()) { MutableTypeMirror next = iterator.next(); if (next.getKind().isDeclared()) { List<MutableDeclaredType> dataInterfaces = new ArrayList<MutableDeclaredType>(); findDomainData(((MutableDeclaredType)next), dataInterfaces); if (dataInterfaces.size() > 0) { MutableDeclaredType dtoType = (MutableDeclaredType)envContext.getProcessingEnv().getTransferObjectUtils().getDomainType(next).getDto(); DomainDeclaredType domainDeclared = new DataDomainDeclared(dataInterfaces.get(0), dtoType, envContext, null/*, configurationContext*/); domainDeclared.setTypeVariables(new MutableTypeVariable[]{}); if (!hasCustomProperties((MutableDeclaredType) next, dataInterfaces.get(0))) { newBounds.add(domainDeclared); } else { newBounds.add(next); } } else { newBounds.add(next); } } else { newBounds.add(next); } } return newBounds; } return bounds; }
List<? extends MutableTypeMirror> interfaces = domainDeclared.getInterfaces(); domainType.setTypeVariables(typeParams.toArray(new MutableTypeVariable[typeParams.size()]));