public MutableTypeVariable getTypeVariable(String name, MutableTypeMirror... upperBounds) { MutableVariable typeVariable = new MutableVariable(); typeVariable.setVariable(name); Set<MutableTypeMirror> bounds = new HashSet<MutableTypeMirror>(); for (MutableTypeMirror bound: upperBounds) { if (bound != null) { if (bound != null && (!bound.getKind().isDeclared() || name == null || !bound.toString().equals(Object.class.getCanonicalName()))) { bounds.add(bound); } } } typeVariable.setUpperBounds(bounds); return typeVariable; }
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; }
if (bound != null && (!bound.getKind().isDeclared() || !bound.toString().equals(Object.class.getCanonicalName()))) { boundSize++; if (bound != null && (!bound.getKind().isDeclared() || !bound.toString().equals(Object.class.getCanonicalName()) || acceptObject)) { bounds.add(bound); if (bound != null && (!bound.getKind().isDeclared() || !bound.toString().equals(Object.class.getCanonicalName()))) { boundSize++; if (bound != null && (!bound.getKind().isDeclared() || !bound.toString().equals(Object.class.getCanonicalName()) || acceptObject)) { bounds.add(bound);
DomainType domainReference = currentElement.getDomainReference(getEntityResolver(), currentPath); if (domainReference != null && domainReference.getKind().isDeclared()) { currentElement = (DomainDeclaredType)domainReference; ExecutableElement nestedIdMethod = currentElement.getIdMethod(getEntityResolver());
if (domainType.getKind().isDeclared()) { idMethod = configurationElement.getInstantiableDomain().getIdMethod(entityResolver);
if (!instantiableDomainReference.getKind().isDeclared()) { processingEnv.getMessager().printMessage( Kind.ERROR, if (referenceDomainType.getKind().isDeclared()) { MutableDeclaredType fieldType = processingEnv.getTypeUtils().getDeclaredType(processingEnv.getTypeUtils().toMutableType(Class.class), new MutableDeclaredType[] { referenceDomainType.getDto() });
if (domainType.getKind().isDeclared()) { domainIdMethod = configurationElement.getInstantiableDomain().getIdMethod(entityResolver);
if (element.getKind().isDeclared()) {
public boolean implementsType(MutableTypeMirror t1, MutableTypeMirror t2) { if (t1 == null || t2 == null || !t1.getKind().isDeclared() || !t2.getKind().isDeclared()) { return false; if (interfaceType.getKind().isDeclared()) { if (((MutableDeclaredType)interfaceType).getCanonicalName().equals(dt2.getCanonicalName())) { return true; if (superClassType != null && superClassType.getKind().isDeclared()) { if (((MutableDeclaredType)superClassType).getCanonicalName().equals(dt2.getCanonicalName())) { return true;
if (mutableType.getKind().isDeclared() && ((MutableDeclaredType)mutableType).getTypeVariables().size() > 0) { List<? extends MutableTypeVariable> typeVariables = ((MutableDeclaredType)mutableType).getTypeVariables();
protected MutableTypeMirror getTypeVariableDelegate(MutableTypeMirror domainDelegate) { if (domainDelegate.getKind().isDeclared() && ((MutableDeclaredType)domainDelegate).getTypeVariables().size() == 1) { MutableTypeVariable mutableTypeVariable = ((MutableDeclaredType)domainDelegate).getTypeVariables().get(0); if (mutableTypeVariable.getUpperBounds().size() == 1) { return mutableTypeVariable.getUpperBounds().iterator().next(); } if (mutableTypeVariable.getLowerBounds().size() == 1) { return mutableTypeVariable.getLowerBounds().iterator().next(); } return mutableTypeVariable; } if (domainDelegate.getKind().isDeclared()) { return ((MutableDeclaredType)domainDelegate).clone().setTypeVariables(); } return domainDelegate; }
public boolean isAssignable(MutableTypeMirror t1, MutableTypeMirror t2) { if (isSameType(t1, t2)) { return true; } if (implementsType(t1, t2)) { return true; } if (t1.getKind().isDeclared()) { if (((MutableDeclaredType)t1).getSuperClass() == null) { return false; } return isAssignable(((MutableDeclaredType)t1).getSuperClass(), t2); } return false; }
@Override protected void printType(MutableTypeMirror type, ConverterProviderPrinterContext context) { DtoType dtoType = processingEnv.getTransferObjectUtils().getDtoType(type); if (dtoType.getKind().isDeclared() && dtoType.getConverter() != null) { print(new ServiceConverterProviderPrinterContext((DtoDeclaredType)dtoType, ((ServiceConverterProviderPrinterContext)context).getLocalMethod(), context.getConfigurationType())); } }
private void printDomainTypeVariables(Set<? extends MutableTypeMirror> types, ExecutableElement localMethod, ConverterProviderElementPrinter nestedPrinter) { for (MutableTypeMirror type: types) { DomainType domainType = processingEnv.getTransferObjectUtils().getDomainType(type); if (domainType.getKind().isDeclared() && domainType.getConverter() != null) { ServiceConverterProviderPrinterContext context = new ServiceConverterProviderPrinterContext((DomainDeclaredType)domainType, localMethod); nestedPrinter.print(context); } } }
protected MutableTypeMirror toPrintableType(MutableTypeMirror mutableType) { if (mutableType.getKind().isDeclared()) { MutableDeclaredType declaredType = (MutableDeclaredType)mutableType; return declaredType.clone().stripTypeParametersTypes(); } return mutableType; } }
public MapBasedType(TypeElement mapBasedElement, MutableProcessingEnvironment processingEnv) { this.mapBasedElement = mapBasedElement; this.processingEnv = processingEnv; setSuperClass(processingEnv.getTypeUtils().toMutableType(MapBasedObject.class)); List<MutableDeclaredType> interfaces = new ArrayList<MutableDeclaredType>(); for (TypeMirror interfaceElementMirror : mapBasedElement.getInterfaces()) { MutableTypeMirror mutableInterface = processingEnv.getTypeUtils().toMutableType(interfaceElementMirror); if (mutableInterface.getKind().isDeclared()) { interfaces.add((MutableDeclaredType)mutableInterface); } } setInterfaces(interfaces); setKind(MutableTypeKind.CLASS); }
protected MutableTypeMirror getWildcardDelegate(MutableTypeMirror domainDelegate) { if (domainDelegate.getKind().isDeclared() && ((MutableDeclaredType)domainDelegate).getTypeVariables().size() == 1) { return ((MutableDeclaredType)domainDelegate).clone().setTypeVariables(processingEnv.getTypeUtils().getWildcardType((MutableTypeMirror)null, (MutableTypeMirror)null)); } return domainDelegate; }
@Override protected void printType(MutableTypeMirror type, ConverterProviderPrinterContext context) { DomainType domainType = processingEnv.getTransferObjectUtils().getDomainType(type); if (domainType.getKind().isDeclared() && domainType.getConverter() != null) { context = new ServiceConverterProviderPrinterContext((DomainDeclaredType)domainType, ((ServiceConverterProviderPrinterContext)context).getLocalMethod()); print(context); } }
private void printDtoTypeVariables(Set<? extends MutableTypeMirror> types, ExecutableElement localMethod, ConverterProviderElementPrinter nestedPrinter) { for (MutableTypeMirror type: types) { DtoType dtoType = processingEnv.getTransferObjectUtils().getDtoType(type); if (dtoType.getKind().isDeclared() && dtoType.getConverter() != null) { ServiceConverterProviderPrinterContext context = new ServiceConverterProviderPrinterContext((DtoDeclaredType)dtoType, localMethod, dtoType.getConverter().getConfiguration()); nestedPrinter.print(context); } } }