@Override public TypeMirror asType() { return ensureDelegateType().asType(); }
protected Set<? extends MutableTypeMirror> getDataTypes(Set<? extends MutableTypeMirror> types) { Set<MutableTypeMirror> result = new HashSet<MutableTypeMirror>(); for (MutableTypeMirror type: types){ MutableDeclaredType d = (MutableDeclaredType) type; if (d.asType() != null) { if (new DomainInterfaceAccessor(((DeclaredType)d.asType()).asElement(), processingEnv).isValid()) { DomainDataInterfaceType domainDataInterfaceType = new DomainDataInterfaceType((MutableDeclaredType)d, processingEnv); result.add(domainDataInterfaceType); } else { result.add(d); } } else { result.add(type); } } return result; }
public List<MutableDeclaredType> getBaseObjects() { List<MutableDeclaredType> baseObjects = new ArrayList<MutableDeclaredType>(); for (MutableTypeMirror domainInterface : domainDataType.getInterfaces()) { MutableDeclaredType d = (MutableDeclaredType) domainInterface; if (new BaseObjectAccessor(((DeclaredType)d.asType()).asElement(), processingEnv).isValid()) { baseObjects.add(d); } } return baseObjects; }
protected MutableDeclaredType getDataObject(MutableDeclaredType type) { if (type.asType() != null) { if (new DomainInterfaceAccessor(((DeclaredType)type.asType()).asElement(), processingEnv).isValid()) { return new DomainDataInterfaceType((MutableDeclaredType)type, processingEnv); } } if (type.hasTypeParameters()) { List<? extends MutableTypeVariable> typeVariables = type.getTypeVariables(); MutableTypeVariable[] dataTypeVariables = new MutableTypeVariable[typeVariables.size()]; int i = 0; for (MutableTypeVariable typeVariable: typeVariables) { dataTypeVariables[i++] = getDataObject(typeVariable); } type.setTypeVariables(dataTypeVariables); } return type; }
public MutableDeclaredType getDeclaredType(MutableDeclaredType enclosedType, MutableDeclaredType type, MutableTypeVariable... typeArgs) { return new MutableDeclared(type.asType(), enclosedType, type.getSimpleName(), processingEnv).setTypeVariables(typeArgs); }
MutableDeclaredType constructDeclaredType(MutableDeclaredType type, MutableTypeVariable... typeArgs) { if (type.getEnclosedClass() != null) { return new MutableDeclared(type.asType(), type.getEnclosedClass(), type.getSimpleName(), processingEnv).setTypeVariables(typeArgs); } return new MutableDeclared(type.asType(), type.getPackageName(), type.getSimpleName(), processingEnv).setTypeVariables(typeArgs); }
public MutableTypeMirror toReturnType(MutableTypeMirror type) { switch (type.getKind()) { case PRIMITIVE: return type; case VOID: return toReturnType(((MutableDeclaredType)type).asType()); case ARRAY: case TYPEVAR: return toParamType(type); default: return stripTypeParametersTypes((MutableDeclaredType)type); } }