| |
|
| java.lang.Object spoon.reflect.factory.SubFactory spoon.reflect.factory.TemplateFactory
TemplateFactory | public class TemplateFactory extends SubFactory implements Serializable(Code) | | A factory for storing, accessing and creating templates and associated types.
|
Method Summary | |
public void | add(CtClass> template) Adds a template to this factory. | public CtClass<T> | get(Class> templateClass) Gets a template CT class from its actual class. | public CtClass<T> | get(String templateName) Gets a template class from its qualified name. | public Map<String, CtClass<?>> | getAll() Gets all the templates in this factory. | public boolean | isTemplate(CtTypeReference> candidate) | public void | parseTypes() Look for template classes in the parent factory and add them to this
factory. |
TemplateFactory | public TemplateFactory(Factory factory)(Code) | | Creates a new template factory.
Parameters: factory - the parent factory |
add | public void add(CtClass> template)(Code) | | Adds a template to this factory.
Parameters: template - the template class |
get | public CtClass<T> get(Class> templateClass)(Code) | | Gets a template CT class from its actual class.
Parameters: templateClass - the runtime class the compile-time class |
get | public CtClass<T> get(String templateName)(Code) | | Gets a template class from its qualified name.
Parameters: templateName - the template's fully qualified name the template class |
getAll | public Map<String, CtClass<?>> getAll()(Code) | | Gets all the templates in this factory.
the stored templates as a map |
isTemplate | public boolean isTemplate(CtTypeReference> candidate)(Code) | | Helper method to know if a given type reference points to a Template or
not
Parameters: candidate - the reference to check true if the reference points to a template type |
parseTypes | public void parseTypes()(Code) | | Look for template classes in the parent factory and add them to this
factory.
|
|
|
|