Package org.nekosoft.pdffer.registry
Class PdfferRegistryBean
java.lang.Object
org.nekosoft.pdffer.registry.PdfferRegistryBean
The PDFfer bean that deals with PDF templates. It scans a specified package for
PdfTemplateComponent
-annotated implementations of
PdfTemplate
and makes the instances available
via the findTemplate(String)
method.
It creates its own Spring application context, separate from the main one.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionPdfTemplate<?>
findTemplate(String templateName)
Finds a PDF template in the root registry given the name.PdfTemplate<?>
findTemplate(String group, String templateName)
Finds a PDF template in the given group with the given name.PdfTemplate<?>
findTemplateByPath(String templatePath)
Finds a PDF template given the template path.Provides a list of all PDF template groups that were registered with this context.listTemplateNamesInGroup(String group)
Provides a list of all PDF templates that were registered in the given group.Provides a list of all PDF templates that were registered in the root registry (the one with the default or no group associated to it).Provides a list of all PDF template paths that were registered with this context.
-
Constructor Details
-
PdfferRegistryBean
public PdfferRegistryBean()Allows Spring to create the bean instance.
-
-
Method Details
-
findTemplateByPath
Finds a PDF template given the template path.- Parameters:
templatePath
- the template path- Returns:
- the PDF template instance
- Throws:
TemplateNotFoundException
- if a template at the given template path could not be found
-
findTemplate
Finds a PDF template in the root registry given the name.- Parameters:
templateName
- the template name in the root registry- Returns:
- the PDF template from the root registry
- Throws:
TemplateNotFoundException
- if a template with the given name in the root registry could not be found
-
findTemplate
public PdfTemplate<?> findTemplate(String group, String templateName) throws TemplateNotFoundExceptionFinds a PDF template in the given group with the given name.- Parameters:
group
- the name of the grouptemplateName
- the name of the template- Returns:
- the PDF template from the given group
- Throws:
TemplateNotFoundException
- if a template with the given name in the given group could not be found
-
listTemplatePaths
Provides a list of all PDF template paths that were registered with this context.- Returns:
- the list of PDF template paths
-
listGroupNames
Provides a list of all PDF template groups that were registered with this context.- Returns:
- the list of PDF template groups
-
listTemplateNamesInRoot
Provides a list of all PDF templates that were registered in the root registry (the one with the default or no group associated to it).- Returns:
- the list of all PDF templates in the root registry
-
listTemplateNamesInGroup
Provides a list of all PDF templates that were registered in the given group.- Parameters:
group
- the group name- Returns:
- the list of templates in the given group
-