Package net.sf.jasperreports.engine.fill
Class JRTemplateGenericPrintElement
- java.lang.Object
-
- net.sf.jasperreports.engine.fill.JRTemplatePrintElement
-
- net.sf.jasperreports.engine.fill.JRTemplateGenericPrintElement
-
- All Implemented Interfaces:
Serializable
,JRCommonElement
,JRGenericPrintElement
,JRIdentifiable
,JRPrintElement
,JRPropertiesHolder
,JRStyleContainer
,VirtualizationSerializable
- Direct Known Subclasses:
JRRecordedValuesGenericPrintElement
public class JRTemplateGenericPrintElement extends JRTemplatePrintElement implements JRGenericPrintElement
Implementation ofJRGenericPrintElement
that uses aJRTemplateGenericElement
instance to store common attributes.- Author:
- Lucian Chirita (lucianc@users.sourceforge.net)
- See Also:
JRTemplateGenericPrintElement
, Serialized Form
-
-
Field Summary
-
Fields inherited from class net.sf.jasperreports.engine.fill.JRTemplatePrintElement
EXCEPTION_MESSAGE_KEY_TEMPLATE_NOT_FOUND, template
-
Fields inherited from interface net.sf.jasperreports.engine.JRPrintElement
UNSET_PRINT_ELEMENT_ID, UNSET_SOURCE_ELEMENT_ID
-
-
Constructor Summary
Constructors Constructor Description JRTemplateGenericPrintElement()
JRTemplateGenericPrintElement(JRTemplateGenericElement template, PrintElementOriginator originator)
Creates a generic print element.JRTemplateGenericPrintElement(JRTemplateGenericElement template, PrintElementOriginator originator, int parameterCount)
Creates a generic print element.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> void
accept(PrintElementVisitor<T> visitor, T arg)
Accepts a print element visitor.JRGenericElementType
getGenericType()
Returns the generic type specified by the element template.Set<String>
getParameterNames()
Returns the set of parameter names for this element.Object
getParameterValue(String name)
Returns the value of a parameter.boolean
hasParameter(String name)
Determines whether the element includes a parameter having a given name.void
readVirtualized(VirtualizationInput in)
void
setParameterValue(String name, Object value)
Sets a parameter value.void
writeVirtualized(VirtualizationOutput out)
-
Methods inherited from class net.sf.jasperreports.engine.fill.JRTemplatePrintElement
getBackcolor, getDefaultLineColor, getDefaultStyleProvider, getForecolor, getHeight, getKey, getMode, getOrigin, getOwnBackcolor, getOwnForecolor, getOwnMode, getParentProperties, getPrintElementId, getPropertiesMap, getSourceElementId, getStyle, getStyleNameReference, getTemplate, getUUID, getWidth, getX, getY, hasProperties, setBackcolor, setForecolor, setHeight, setMode, setSourceElementId, setStyle, setTemplate, setUUID, setWidth, setX, setY, updateElementTemplate
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.sf.jasperreports.engine.JRCommonElement
getBackcolor, getForecolor, getMode, getOwnBackcolor, getOwnForecolor, getOwnMode, setBackcolor, setForecolor, setMode
-
Methods inherited from interface net.sf.jasperreports.engine.JRIdentifiable
getUUID
-
Methods inherited from interface net.sf.jasperreports.engine.JRPrintElement
getHeight, getKey, getOrigin, getPrintElementId, getSourceElementId, getWidth, getX, getY, setHeight, setStyle, setUUID, setWidth, setX, setY
-
Methods inherited from interface net.sf.jasperreports.engine.JRPropertiesHolder
getParentProperties, getPropertiesMap, hasProperties
-
Methods inherited from interface net.sf.jasperreports.engine.JRStyleContainer
getDefaultStyleProvider, getStyle, getStyleName, getStyleNameReference
-
-
-
-
Constructor Detail
-
JRTemplateGenericPrintElement
public JRTemplateGenericPrintElement()
-
JRTemplateGenericPrintElement
public JRTemplateGenericPrintElement(JRTemplateGenericElement template, PrintElementOriginator originator)
Creates a generic print element.- Parameters:
template
- the template to use for the elementoriginator
-
-
JRTemplateGenericPrintElement
public JRTemplateGenericPrintElement(JRTemplateGenericElement template, PrintElementOriginator originator, int parameterCount)
Creates a generic print element.- Parameters:
template
- the template to use for the elementoriginator
-parameterCount
- the number of parameters that the element will have
-
-
Method Detail
-
getGenericType
public JRGenericElementType getGenericType()
Returns the generic type specified by the element template.- Specified by:
getGenericType
in interfaceJRGenericPrintElement
- Returns:
- the element type
- See Also:
JRTemplateGenericElement.getGenericType()
-
getParameterNames
public Set<String> getParameterNames()
Description copied from interface:JRGenericPrintElement
Returns the set of parameter names for this element.- Specified by:
getParameterNames
in interfaceJRGenericPrintElement
- Returns:
- the set of parameter names (as
String
s).
-
getParameterValue
public Object getParameterValue(String name)
Description copied from interface:JRGenericPrintElement
Returns the value of a parameter.- Specified by:
getParameterValue
in interfaceJRGenericPrintElement
- Parameters:
name
- the parameter name- Returns:
- the parameter value, or
null
if a parameter by the specified name does not exist.
-
hasParameter
public boolean hasParameter(String name)
Description copied from interface:JRGenericPrintElement
Determines whether the element includes a parameter having a given name.- Specified by:
hasParameter
in interfaceJRGenericPrintElement
- Parameters:
name
- the parameter name- Returns:
- whether a parameter having the specified name exists in the element
-
setParameterValue
public void setParameterValue(String name, Object value)
Description copied from interface:JRGenericPrintElement
Sets a parameter value.- Specified by:
setParameterValue
in interfaceJRGenericPrintElement
- Parameters:
name
- the parameter namevalue
- the parameter value
-
accept
public <T> void accept(PrintElementVisitor<T> visitor, T arg)
Description copied from interface:JRPrintElement
Accepts a print element visitor.The element calls the method that corresponds to the element type on the visitor.
- Specified by:
accept
in interfaceJRPrintElement
- Overrides:
accept
in classJRTemplatePrintElement
- Type Parameters:
T
- the type of the argument passed to the visit operation- Parameters:
visitor
- the visitor objectsarg
- the argument passed to the visit operation
-
writeVirtualized
public void writeVirtualized(VirtualizationOutput out) throws IOException
- Specified by:
writeVirtualized
in interfaceVirtualizationSerializable
- Overrides:
writeVirtualized
in classJRTemplatePrintElement
- Throws:
IOException
-
readVirtualized
public void readVirtualized(VirtualizationInput in) throws IOException
- Specified by:
readVirtualized
in interfaceVirtualizationSerializable
- Overrides:
readVirtualized
in classJRTemplatePrintElement
- Throws:
IOException
-
-