public static boolean isConverterGenerated(Element typeElement, MutableProcessingEnvironment processingEnv) { TypeElement domain = new TransferObjectMappingAccessor(typeElement, processingEnv).getDomain(); if (domain == null) { //if there no domain defined, converter does not make sense return false; } return (!domain.getModifiers().contains(Modifier.ABSTRACT)); } }
@Override protected ConfigurationTypeElement getConfigurationTypeElement(Element configurationElement, EnvironmentContext<TransferObjectProcessingEnvironment> envContext, ConfigurationContext configurationContext) { return new DataConfigurationTypeElement(getTransferObjectMappingAccessor().getConfiguration(), envContext, configurationContext); }
TransferObjectMappingAccessor transferObjectMappingAccessor = new TransferObjectMappingAccessor(context.getDtoMethod(), processingEnv); if (transferObjectMappingAccessor.isValid() && transferObjectMappingAccessor.getConverter() != null) { converterProviderPrinter.printDtoGetConverterMethodName(context.getConverter().getDto(), field, context.getDtoMethod(), pw, false); } else {
private List<MutableDeclaredType> getDomainDataInterfaces() { if (dataInterfacesValue.isInitialized()) { return dataInterfacesValue.getValue(); } TypeElement declaredDomainType = getTransferObjectMappingAccessor().getDomain(); if (declaredDomainType != null) { return dataInterfacesValue.setValue(dataTypeResolver.getDomainData(getTypeUtils().toMutableType(declaredDomainType))); } return dataInterfacesValue.setValue(new ArrayList<MutableDeclaredType>()); }
Field field = new Field( (context.getDomainMethodReturnType().getKind().equals(MutableTypeKind.TYPEVAR) ? "(" + context.getConverter().getDomain().toString(ClassSerializer.SIMPLE, true) + ")" : "") + TransferObjectElementPrinter.DOMAIN_NAME + "." + context.getDomainFieldName(), context.getConverter().getDomain()); TransferObjectMappingAccessor transferObjectMappingAccessor = new TransferObjectMappingAccessor(context.getDtoMethod(), processingEnv); if (transferObjectMappingAccessor.isValid() && transferObjectMappingAccessor.getConverter() != null) { converterProviderPrinter.printDomainGetConverterMethodName(context.getConverter().getDomain(), field, null, pw, false); } else {
@Override protected MutableDeclaredType[] getOutputClasses(RoundContext context) { TypeElement domain = new TransferObjectMappingAccessor(context.getTypeElement(), processingEnv).getDomain(); if (domain == null) { //if there no domain defined, converter does not make sense return new MutableDeclaredType[] {}; } if (domain.getModifiers().contains(Modifier.ABSTRACT)) { return new MutableDeclaredType[] {}; } ConverterTypeElement converter = getConfigurationElement(context).getConverter(); if (converter == null || !converter.isGenerated()) { return new MutableDeclaredType[] {}; } return new MutableDeclaredType[] { converter }; }