@Override public String toString(ClassSerializer serializer, boolean typed) { return componentType.toString(serializer, typed) + "[]"; }
@Override public String toString(ClassSerializer serializer) { return componentType.toString(serializer) + "[]"; }
@Override public boolean isSameType(MutableTypeMirror type) { return toString(ClassSerializer.CANONICAL, false).equals(type.toString(ClassSerializer.CANONICAL, false)); } }
@Override public String toString(ClassSerializer serializer) { return ensureDelegateType().toString(serializer); }
@Override public String toString(ClassSerializer serializer, boolean typed) { return ensureDelegateType().toString(serializer, typed); }
protected boolean isPrimitiveBoolean(MutableTypeMirror type) { return type.toString(ClassSerializer.CANONICAL).equals(TypeKind.BOOLEAN.toString().toLowerCase()); }
public static String toString(Type type, ClassSerializer serializer, boolean typed) { if (type instanceof Class) { return toString((Class<?>)type, serializer); } if (type instanceof MutableDeclaredType) { return ((MutableDeclaredType)type).toString(serializer, typed); } if (type instanceof MutableTypeMirror) { return ((MutableTypeMirror)type).toString(serializer); } throw new IllegalArgumentException("Not supported annotation element " + type.toString()); }
public static boolean hasFieldByType(MutableDeclaredType ownerType, MutableTypeMirror fieldType) { if (ownerType.getFields() == null) { return false; } for (MutableVariableElement field: ownerType.getFields()) { if (field.asType().toString(ClassSerializer.QUALIFIED).equals(fieldType.toString(ClassSerializer.QUALIFIED))) { return true; } } return false; }
@Override protected List<ConfigurationTypeElement> getConfigurationElementsForType(TargetType targetType, MutableTypeMirror type, ConfigurationContext context) { List<ConfigurationTypeElement> configurationElementsForType = super.getConfigurationElementsForType(targetType, type, context); List<ConfigurationTypeElement> result = new ArrayList<ConfigurationTypeElement>(); for (ConfigurationTypeElement configurationElement: configurationElementsForType) { if (configurationElement.getInstantiableDomainSpecified() != null && configurationElement.getInstantiableDomainSpecified().getQualifiedName().toString().equals(type.toString(ClassSerializer.QUALIFIED, false))) { //if this is configuration exactly for this type, use it result.add(configurationElement); } } if (result.size() > 0) { return result; } return configurationElementsForType; } }
public String toString(ClassSerializer serializer, boolean typed) { String result = ""; if (getVariable() != null) { result += getVariable(); } if (getUpperBounds().size() > 0) { if (getVariable() != null) { result += " extends "; } int i = 0; for (MutableTypeMirror typeVariable : getUpperBounds()) { if (i > 0) { result += " & "; } result += typeVariable.toString(serializer, typed); i++; } } if (getLowerBounds().size() > 0) { if (getVariable() != null) { result += " super "; } result += getLowerBounds().iterator().next().toString(serializer, typed); } return result; }
static Class<?> getType(TypeMirror type, MutableProcessingEnvironment processingEnv) { MutableTypeMirror mutableType = processingEnv.getTypeUtils().toMutableType(type); String className = mutableType.toString(ClassSerializer.QUALIFIED, false);
protected void printCastDomainType(TransferObjectContext context, PathResolver domainPathResolver, DomainType inputDomainType, FormattedPrintWriter pw) { MutableTypeMirror parameterType = getParameterType(context, domainPathResolver); MutableTypeMirror domainType = getTypeVariableDelegate(getDelegateCast(inputDomainType, true)); if (!isCastRequired(parameterType)) { pw.print(domainType); } else { MutableDeclaredType declaredParameter = (MutableDeclaredType) parameterType; MutableTypeMirror typeParameter = getTypeParameter(declaredParameter); if (typeParameter == null) { pw.print(domainType); } else { if (typeParameter.isSameType(domainType) || ProcessorUtils.implementsType(processingEnv.getElementUtils().getTypeElement(domainType.toString(ClassSerializer.CANONICAL, false)) .asType(), processingEnv.getElementUtils().getTypeElement(typeParameter.toString(ClassSerializer.CANONICAL, false)).asType())) { pw.print(domainType); } else { processingEnv.getMessager().printMessage(Kind.NOTE, "Params: [1] InputDomainType: " + inputDomainType.toString()); processingEnv.getMessager().printMessage( Kind.ERROR, "Method " + getSetterMethod(context, domainPathResolver).getSimpleName().toString() + " in type " + context.getConfigurationTypeElement().getDomain().getCanonicalName() + " has parameter of type " + typeParameter.toString() + " but " + domainType.toString() + " was expected!"); } } } }
String res = mutableType.toString(evalSerializer, typed); length += res.length(); write(res);
pw.print("(", parameterDomainType, ")"); final Field field = new Field("(" + remoteParameterType.toString(ClassSerializer.SIMPLE, true) + ")" + parameterName, parameterDtoType); pw.print("(");
pw.print(", " + processingEnv.getTypeUtils().toMutableType(processingEnv.getTypeUtils().erasure(listType)).toString(ClassSerializer.CANONICAL, false) + ".class)"); } else { pw.print(")");