Package net.sf.jasperreports.engine.base
Class JRBaseGenericPrintElement
- java.lang.Object
-
- net.sf.jasperreports.engine.base.JRBasePrintElement
-
- net.sf.jasperreports.engine.base.JRBaseGenericPrintElement
-
- All Implemented Interfaces:
Serializable
,JRCommonElement
,JRGenericPrintElement
,JRIdentifiable
,JRPrintElement
,JRPropertiesHolder
,JRStyleContainer
public class JRBaseGenericPrintElement extends JRBasePrintElement implements JRGenericPrintElement
A basic implementation ofJRGenericPrintElement
.- Author:
- Lucian Chirita (lucianc@users.sourceforge.net)
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class net.sf.jasperreports.engine.base.JRBasePrintElement
backcolor, defaultStyleProvider, forecolor, height, key, mode, origin, style, uuid, width, x, y
-
Fields inherited from interface net.sf.jasperreports.engine.JRPrintElement
UNSET_PRINT_ELEMENT_ID, UNSET_SOURCE_ELEMENT_ID
-
-
Constructor Summary
Constructors Constructor Description JRBaseGenericPrintElement(JRDefaultStyleProvider defaultStyleProvider)
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 type of this element.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
setGenericType(JRGenericElementType genericType)
Sets the type of this element.void
setParameterValue(String name, Object value)
Sets a parameter value.-
Methods inherited from class net.sf.jasperreports.engine.base.JRBasePrintElement
getBackcolor, getDefaultStyleProvider, getForecolor, getHeight, getKey, getMode, getOrigin, getOwnBackcolor, getOwnForecolor, getOwnMode, getParentProperties, getPrintElementId, getPropertiesMap, getSourceElementId, getStyle, getStyleNameReference, getStyleResolver, getUUID, getWidth, getX, getY, hasProperties, setBackcolor, setForecolor, setHeight, setKey, setMode, setOrigin, setPrintElementId, setSourceElementId, setStyle, setUUID, setWidth, setX, setY
-
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
-
JRBaseGenericPrintElement
public JRBaseGenericPrintElement(JRDefaultStyleProvider defaultStyleProvider)
Creates a generic print element.- Parameters:
defaultStyleProvider
- the default style provider to use for the element- See Also:
JasperPrint.getDefaultStyleProvider()
-
-
Method Detail
-
getGenericType
public JRGenericElementType getGenericType()
Description copied from interface:JRGenericPrintElement
Returns the type of this element.- Specified by:
getGenericType
in interfaceJRGenericPrintElement
- Returns:
- the element type
-
setGenericType
public void setGenericType(JRGenericElementType genericType)
Sets the type of this element.- Parameters:
genericType
- the type of the element- See Also:
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 classJRBasePrintElement
- 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
-
-