protected MutableDeclaredType[] getTargetClassNames(ConfigurationTypeElement configurationTypeElement) { return new MutableDeclaredType[] { configurationTypeElement.getDto() }; }
protected ConfigurationTypeElement createTypeElement(TypeElement typeElement) { ConfigurationContext configurationContext = new ConfigurationContext(environmentContext.getConfigurationEnv()); ConfigurationTypeElement configurationTypeElement = new ConfigurationTypeElement(typeElement, getEnvironmentContext(), configurationContext); configurationContext.addConfiguration(configurationTypeElement); return configurationTypeElement; }
@Override protected ConfigurationTypeElement getConfigurationElement(Element configurationElement) { ConfigurationContext configurationContext = new ConfigurationContext(envContext.getConfigurationEnv()); ConfigurationTypeElement configurationTypeElement = new DataConfigurationTypeElement(configurationElement, envContext, configurationContext); configurationContext.addConfiguration(configurationTypeElement); return configurationTypeElement; }
public MutableTypeMirror getDelegateCast(TypeMirror domainType) { DomainType domainTypeElement = processingEnv.getTransferObjectUtils().getDomainType(domainType); MutableTypeMirror domainNamedType = processingEnv.getTypeUtils().toMutableType(domainType); return castToDelegate(domainNamedType, domainTypeElement.getDomainDefinitionConfiguration() == null ? null : domainTypeElement.getDomainDefinitionConfiguration().getDelegateConfigurationTypeElement(), true); }
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); } } }
@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); } }
protected List<ConfigurationTypeElement> getConfigurationsFromType(DeclaredType type, List<String> processedElements) { ConfigurationContext configurationContext = new ConfigurationContext(envContext.getConfigurationEnv()); return getConfigurationsFromType(type, processedElements, configurationContext); }
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; } }
protected EnvironmentContext<TransferObjectProcessingEnvironment> getEnvironmentContext(RemoteServiceTypeElement remoteServiceInterfaceElement) { if (environmentContext == null) { ConfigurationEnvironment configurationEnv = new ConfigurationEnvironment(processingEnv, roundEnv, getConfigurationCache()); environmentContext = configurationEnv.getEnvironmentContext(); configurationEnv.setConfigurationProviders(getConfigurationProviders(remoteServiceInterfaceElement, environmentContext)); } return environmentContext; }
private Element toElement(MutableDeclaredType type) { Element domainElement = type.asElement(); if (domainElement == null) { TypeMirror fromMutableType = envContext.getProcessingEnv().getTypeUtils().fromMutableType(type); domainElement = ((DeclaredType)fromMutableType).asElement(); } return domainElement; }
protected final MutableReferenceType getThisReference() { return processingEnv.getTypeUtils().getReference(null, ConverterConstructorParametersResolver.THIS); }
protected boolean checkPreconditions(ProcessorContext context, boolean alreadyExists) { return getConfigurationElement(context).getDelegateConfigurationTypeElement() == null; }
@Override protected ConfigurationTypeElement getConfigurationTypeElement(Element configurationElement, EnvironmentContext<TransferObjectProcessingEnvironment> envContext, ConfigurationContext configurationContext) { return new DataConfigurationTypeElement(getTransferObjectMappingAccessor().getConfiguration(), envContext, configurationContext); }
@Override protected ConfigurationTypeElement getConfigurationElement(Element configurationElement) { ConfigurationContext configurationContext = new ConfigurationContext(envContext.getConfigurationEnv()); ConfigurationTypeElement configurationTypeElement = new DataConfigurationTypeElement(configurationElement, envContext, configurationContext); configurationContext.addConfiguration(configurationTypeElement); return configurationTypeElement; } }
protected MutableTypeMirror getDelegateCast(MutableTypeMirror domainNamedType, boolean stripWildcard) { TypeMirror domainType = processingEnv.getTypeUtils().fromMutableType(domainNamedType); if (domainType == null) { return domainNamedType; } DomainType domainTypeElement = processingEnv.getTransferObjectUtils().getDomainType(domainType); return castToDelegate(domainNamedType, domainTypeElement.getDomainDefinitionConfiguration() == null ? null : domainTypeElement.getDomainDefinitionConfiguration().getDelegateConfigurationTypeElement(), stripWildcard); }
protected EnvironmentContext<TransferObjectProcessingEnvironment> getEnvironmentContext() { if (environmentContext == null) { ConfigurationEnvironment configurationEnv = new ConfigurationEnvironment(processingEnv, roundEnv, getConfigurationCache()); environmentContext = configurationEnv.getEnvironmentContext(); configurationEnv.setConfigurationProviders(getConfigurationProviders()); } return environmentContext; }
@Override protected MutableDeclaredType[] getOutputClasses(RoundContext context) { return new MutableDeclaredType[] { getConfigurationElement(context).getDto() }; }
@Override protected ConfigurationTypeElement getConfigurationElement(Element configurationElement) { ConfigurationContext configurationContext = new ConfigurationContext(envContext.getConfigurationEnv()); ConfigurationTypeElement configurationTypeElement = new DataConfigurationTypeElement(configurationElement, envContext, configurationContext); configurationContext.addConfiguration(configurationTypeElement); return configurationTypeElement; }
@Override protected ConfigurationTypeElement getConfigurationElement(Element configurationElement) { ConfigurationContext configurationContext = new ConfigurationContext(envContext.getConfigurationEnv()); ConfigurationTypeElement configurationTypeElement = new DataConfigurationTypeElement(configurationElement, envContext, configurationContext); configurationContext.addConfiguration(configurationTypeElement); return configurationTypeElement; } }
@Override protected ConfigurationTypeElement createTypeElement(TypeElement typeElement) { ConfigurationContext configurationContext = new ConfigurationContext(environmentContext.getConfigurationEnv()); ConfigurationTypeElement configurationTypeElement = new DataConfigurationTypeElement(typeElement, getEnvironmentContext(), configurationContext); configurationContext.addConfiguration(configurationTypeElement); return configurationTypeElement; }