Package net.sf.jasperreports.engine
Class JRSimpleTemplate
java.lang.Object
net.sf.jasperreports.engine.JRSimpleTemplate
- All Implemented Interfaces:
Serializable,JRChangeEventsSupport,JRTemplate
public class JRSimpleTemplate
extends Object
implements JRTemplate, Serializable, JRChangeEventsSupport
Default
JRTemplate implementation.- Author:
- Lucian Chirita (lucianc@users.sourceforge.net)
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddIncludedTemplate(int index, JRTemplateReference reference) Adds an included template.voidaddIncludedTemplate(String templateLocation) Adds an included template.voidaddIncludedTemplate(JRTemplateReference reference) Adds an included template.voidAdds a style to the template.voidAdds a style to the template.protected voidcheckExistingName(String name) Returns the property change support object for this instance.Returns the templates included/referenced by this template.Returns an included style by name.JRStyle[]Returns the styles defined in this template.protected booleannameMatches(JRStyle style, String name) removeIncludedTemplate(String location) Removes an included template.booleanremoveIncludedTemplate(JRTemplateReference reference) Removes an included template.removeStyle(String name) Removes an included style.booleanremoveStyle(JRStyle style) Removes an included style.
-
Field Details
-
EXCEPTION_MESSAGE_KEY_DUPLICATE_TEMPLATE_STYLE
- See Also:
-
PROPERTY_STYLE
- See Also:
-
PROPERTY_INCLUDED_TEMPLATES
- See Also:
-
-
Constructor Details
-
JRSimpleTemplate
public JRSimpleTemplate()
-
-
Method Details
-
getEventSupport
Description copied from interface:JRChangeEventsSupportReturns the property change support object for this instance.- Specified by:
getEventSupportin interfaceJRChangeEventsSupport- Returns:
- the property change support object for this instance
-
addStyle
Adds a style to the template.- Parameters:
style- the style to add- Throws:
JRException- when a style with the same name already exists
-
addStyle
Adds a style to the template.- Parameters:
style- the style to add- Throws:
JRException- when a style with the same name already exists
-
checkExistingName
- Throws:
JRException
-
nameMatches
-
getStyle
Returns an included style by name.- Parameters:
name- the name of the style to be returned- Returns:
- the style having the specified name, or
nullif not found
-
removeStyle
Removes an included style.- Parameters:
style- the style to remove- Returns:
trueif and only if the style has been found and removed
-
removeStyle
Removes an included style.- Parameters:
name- the name of the style to be removed- Returns:
- the removed style, or
nullif not found
-
getStylesList
-
getStyles
Description copied from interface:JRTemplateReturns the styles defined in this template.- Specified by:
getStylesin interfaceJRTemplate- Returns:
- the template styles
-
addIncludedTemplate
Adds an included template.- Parameters:
reference- the template reference- See Also:
-
addIncludedTemplate
Adds an included template.- Parameters:
reference- the template reference- See Also:
-
addIncludedTemplate
Adds an included template.- Parameters:
templateLocation- the template location- See Also:
-
removeIncludedTemplate
Removes an included template.- Parameters:
reference- the template reference to remove- Returns:
trueif and only if the included template has been found and removed
-
removeIncludedTemplate
Removes an included template. The first template reference that matches the location is removed.- Parameters:
location- the location of the template to remove- Returns:
- the removed template reference, or
nullif not found
-
getIncludedTemplates
Description copied from interface:JRTemplateReturns the templates included/referenced by this template.- Specified by:
getIncludedTemplatesin interfaceJRTemplate- Returns:
- the included templates
-
getIncludedTemplatesList
-