toothpick.compiler.registry.targets.RegistryInjectionTarget Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of toothpick-compiler Show documentation
Show all versions of toothpick-compiler Show documentation
'Annotation Processors of toothpick'
package toothpick.compiler.registry.targets;
import java.util.List;
import javax.lang.model.element.TypeElement;
import toothpick.compiler.registry.generators.RegistryGenerator;
import toothpick.registries.FactoryRegistry;
import toothpick.registries.MemberInjectorRegistry;
/**
* Stores the information needed by {@link RegistryGenerator} to generate a Registry.
*
* @see {@link FactoryRegistry} and {@link MemberInjectorRegistry} for Registry types.
*/
public class RegistryInjectionTarget {
private static final String REGISTRY_NAME = "%sRegistry";
private static final String GETTER_NAME = "get%s";
private static final String CHILDREN_GETTER_NAME = "get%sInChildrenRegistries";
public Class> type; // Factory.class
public Class> superClass; // toothpick.registries.factory.AbstractFactoryRegistry
public String packageName;
public List childrenRegistryPackageNameList;
public List injectionTargetList;
public String registryName;
public String getterName;
public String childrenGetterName;
public RegistryInjectionTarget(Class> type, Class> superClass, String packageName,
List childrenRegistryPackageNameList, List injectionTargetList) {
this.type = type;
this.superClass = superClass;
this.packageName = packageName;
this.childrenRegistryPackageNameList = childrenRegistryPackageNameList;
this.injectionTargetList = injectionTargetList;
String typeSimpleName = type.getSimpleName();
this.registryName = String.format(REGISTRY_NAME, typeSimpleName);
this.getterName = String.format(GETTER_NAME, typeSimpleName);
this.childrenGetterName = String.format(CHILDREN_GETTER_NAME, typeSimpleName);
}
public String getFqcn() {
return packageName + "." + registryName;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy