net.sf.jasperreports.engine.design
Class JRDesignSubreport

java.lang.Object
  extended bynet.sf.jasperreports.engine.base.JRBaseElement
      extended bynet.sf.jasperreports.engine.design.JRDesignElement
          extended bynet.sf.jasperreports.engine.design.JRDesignSubreport
All Implemented Interfaces:
JRChild, JRElement, JRSubreport, java.io.Serializable

public class JRDesignSubreport
extends JRDesignElement
implements JRSubreport

Version:
$Id: JRDesignSubreport.java,v 1.29 2005/10/09 21:34:26 teodord Exp $
Author:
Teodor Danciu (teodord@users.sourceforge.net)
See Also:
Serialized Form

Field Summary
protected  JRExpression connectionExpression
           
protected  JRExpression dataSourceExpression
           
protected  JRExpression expression
           
protected  java.lang.Boolean isUsingCache
           
protected  java.util.Map parametersMap
           
protected  JRExpression parametersMapExpression
           
protected  java.util.List returnValues
          Values to be copied from the subreport into the master report.
 
Fields inherited from class net.sf.jasperreports.engine.base.JRBaseElement
backcolor, elementGroup, forecolor, height, isPrintInFirstWholeBand, isPrintRepeatedValues, isPrintWhenDetailOverflows, isRemoveLineWhenBlank, key, mode, positionType, printWhenExpression, printWhenGroupChanges, stretchType, width, x, y
 
Fields inherited from interface net.sf.jasperreports.engine.JRElement
MODE_OPAQUE, MODE_TRANSPARENT, POSITION_TYPE_FIX_RELATIVE_TO_BOTTOM, POSITION_TYPE_FIX_RELATIVE_TO_TOP, POSITION_TYPE_FLOAT, STRETCH_TYPE_NO_STRETCH, STRETCH_TYPE_RELATIVE_TO_BAND_HEIGHT, STRETCH_TYPE_RELATIVE_TO_TALLEST_OBJECT
 
Constructor Summary
JRDesignSubreport()
           
 
Method Summary
 void addParameter(JRSubreportParameter subreportParameter)
           
 void addReturnValue(JRSubreportReturnValue returnValue)
          Adds a return value to the subreport.
 void collectExpressions(JRExpressionCollector collector)
           
 JRExpression getConnectionExpression()
           
 JRChild getCopy(JRAbstractObjectFactory factory)
           
 JRExpression getDataSourceExpression()
           
 JRExpression getExpression()
           
 JRSubreportParameter[] getParameters()
           
 java.util.Map getParametersMap()
           
 JRExpression getParametersMapExpression()
           
 JRSubreportReturnValue[] getReturnValues()
          Returns the list of values to be copied from the subreport into the master.
 java.util.List getReturnValuesList()
          Returns the list of values to be copied from the subreport into the master.
 java.lang.Boolean isOwnUsingCache()
          Indicates if the engine is loading the current subreport from cache.
 boolean isUsingCache()
          Indicates if the engine is loading the current subreport from cache.
 JRSubreportParameter removeParameter(java.lang.String name)
           
 boolean removeReturnValue(JRSubreportReturnValue returnValue)
          Removes a return value from the subreport.
 void setConnectionExpression(JRExpression connectionExpression)
           
 void setDataSourceExpression(JRExpression dataSourceExpression)
           
 void setExpression(JRExpression expression)
           
 void setParametersMapExpression(JRExpression parametersMapExpression)
           
 void setUsingCache(boolean isUsingCache)
          Specifies if the engine should be loading the current subreport from cache.
 void setUsingCache(java.lang.Boolean isUsingCache)
          Specifies if the engine should be loading the current subreport from cache.
 void writeXml(JRXmlWriter xmlWriter)
           
 
Methods inherited from class net.sf.jasperreports.engine.design.JRDesignElement
setElementGroup, setHeight, setKey, setPrintWhenExpression, setPrintWhenGroupChanges, setY
 
Methods inherited from class net.sf.jasperreports.engine.base.JRBaseElement
getBackcolor, getElementGroup, getForecolor, getHeight, getKey, getMode, getPositionType, getPrintWhenExpression, getPrintWhenGroupChanges, getStretchType, getWidth, getX, getY, isPrintInFirstWholeBand, isPrintRepeatedValues, isPrintWhenDetailOverflows, isRemoveLineWhenBlank, setBackcolor, setForecolor, setMode, setPositionType, setPrintInFirstWholeBand, setPrintRepeatedValues, setPrintWhenDetailOverflows, setRemoveLineWhenBlank, setStretchType, setWidth, setX
 
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.JRElement
getBackcolor, getElementGroup, getForecolor, getHeight, getKey, getMode, getPositionType, getPrintWhenExpression, getPrintWhenGroupChanges, getStretchType, getWidth, getX, getY, isPrintInFirstWholeBand, isPrintRepeatedValues, isPrintWhenDetailOverflows, isRemoveLineWhenBlank, setBackcolor, setForecolor, setMode, setPositionType, setPrintInFirstWholeBand, setPrintRepeatedValues, setPrintWhenDetailOverflows, setRemoveLineWhenBlank, setStretchType, setWidth, setX
 

Field Detail

isUsingCache

protected java.lang.Boolean isUsingCache

parametersMap

protected java.util.Map parametersMap

returnValues

protected java.util.List returnValues
Values to be copied from the subreport into the master report.


parametersMapExpression

protected JRExpression parametersMapExpression

connectionExpression

protected JRExpression connectionExpression

dataSourceExpression

protected JRExpression dataSourceExpression

expression

protected JRExpression expression
Constructor Detail

JRDesignSubreport

public JRDesignSubreport()
Method Detail

isUsingCache

public boolean isUsingCache()
Description copied from interface: JRSubreport
Indicates if the engine is loading the current subreport from cache. Implementations of this method rely on default values that depend on the type of the subreport expression if a value was not explicitly set of this flag.

Specified by:
isUsingCache in interface JRSubreport
Returns:
true if the subreport should be loaded from cache, false otherwise

setUsingCache

public void setUsingCache(boolean isUsingCache)
Deprecated.  

Description copied from interface: JRSubreport
Specifies if the engine should be loading the current subreport from cache. If set to true, the reporting engine will try to recognize previously loaded subreports using their specified source. For example, it will recognize a subreport if the subreport source is a file name that it has already loaded, or if it is the same URL.

For subreports that have expressions returning java.lang.String objects as the subreport source, representing file names, URLs or classpath resources, the default value for this flag is true.

Specified by:
setUsingCache in interface JRSubreport

getParametersMapExpression

public JRExpression getParametersMapExpression()
Specified by:
getParametersMapExpression in interface JRSubreport

setParametersMapExpression

public void setParametersMapExpression(JRExpression parametersMapExpression)

getParameters

public JRSubreportParameter[] getParameters()
Specified by:
getParameters in interface JRSubreport

getParametersMap

public java.util.Map getParametersMap()

addParameter

public void addParameter(JRSubreportParameter subreportParameter)
                  throws JRException
Throws:
JRException

removeParameter

public JRSubreportParameter removeParameter(java.lang.String name)

getConnectionExpression

public JRExpression getConnectionExpression()
Specified by:
getConnectionExpression in interface JRSubreport

setConnectionExpression

public void setConnectionExpression(JRExpression connectionExpression)

getDataSourceExpression

public JRExpression getDataSourceExpression()
Specified by:
getDataSourceExpression in interface JRSubreport

setDataSourceExpression

public void setDataSourceExpression(JRExpression dataSourceExpression)

getExpression

public JRExpression getExpression()
Specified by:
getExpression in interface JRSubreport

setExpression

public void setExpression(JRExpression expression)

getCopy

public JRChild getCopy(JRAbstractObjectFactory factory)
Specified by:
getCopy in interface JRChild

collectExpressions

public void collectExpressions(JRExpressionCollector collector)
Specified by:
collectExpressions in interface JRElement

writeXml

public void writeXml(JRXmlWriter xmlWriter)
Specified by:
writeXml in interface JRChild

addReturnValue

public void addReturnValue(JRSubreportReturnValue returnValue)
Adds a return value to the subreport.

Parameters:
returnValue - the return value to be added.

getReturnValues

public JRSubreportReturnValue[] getReturnValues()
Returns the list of values to be copied from the subreport into the master.

Specified by:
getReturnValues in interface JRSubreport
Returns:
the list of values to be copied from the subreport into the master.

getReturnValuesList

public java.util.List getReturnValuesList()
Returns the list of values to be copied from the subreport into the master.

Returns:
list of JRSubreportReturnValue objects

removeReturnValue

public boolean removeReturnValue(JRSubreportReturnValue returnValue)
Removes a return value from the subreport.

Parameters:
returnValue - the return value to be removed
Returns:
true if the return value was found and removed

isOwnUsingCache

public java.lang.Boolean isOwnUsingCache()
Description copied from interface: JRSubreport
Indicates if the engine is loading the current subreport from cache. Implementations of this method return the actual value for the internal flag that was explicitly set on this subreport.

Specified by:
isOwnUsingCache in interface JRSubreport
Returns:
Boolean.TRUE if the subreport should be loaded from cache, Boolean.FALSE otherwise or null in case the flag was never explicitly set on this subreport element

setUsingCache

public void setUsingCache(java.lang.Boolean isUsingCache)
Description copied from interface: JRSubreport
Specifies if the engine should be loading the current subreport from cache. If set to Boolean.TRUE, the reporting engine will try to recognize previously loaded subreports using their specified source. For example, it will recognize an subreport if the subreport source is a file name that it has already loaded, or if it is the same URL.

If set to null, the engine will rely on some default value which depends on the type of the subreport expression. The cache is turned on by default only for subreports that have java.lang.String objects in their expressions.

Specified by:
setUsingCache in interface JRSubreport


© 2001-2005 JasperSoft Corporation www.jaspersoft.com