Package net.sf.jasperreports.engine.util
Class JRSaver
- java.lang.Object
-
- net.sf.jasperreports.engine.util.JRSaver
-
public final class JRSaver extends Object
Utility class that can be used when serializable objects must be saved on disk or sent over the network through an output stream.Both the
JasperDesign
andJasperReport
classes implement thejava.io.Serializable
interface. This allows users to store their report templates as serialized objects either in their fully modifiable state (JasperDesign
objects) or in their compiled form (JasperReport
objects), using various methods exposed by this class.- Author:
- Teodor Danciu (teodord@users.sourceforge.net)
-
-
Field Summary
Fields Modifier and Type Field Description static String
EXCEPTION_MESSAGE_KEY_EXPRESSIONS_CLASS_FILE_SAVE_ERROR
static String
EXCEPTION_MESSAGE_KEY_FILE_SAVE_ERROR
static String
EXCEPTION_MESSAGE_KEY_OUTPUT_STREAM_SAVE_ERROR
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
saveClassSource(String source, File file)
static void
saveObject(Object obj, File file)
static void
saveObject(Object obj, OutputStream os)
static void
saveObject(Object obj, String fileName)
static void
saveResource(String resource, File file)
-
-
-
Field Detail
-
EXCEPTION_MESSAGE_KEY_EXPRESSIONS_CLASS_FILE_SAVE_ERROR
public static final String EXCEPTION_MESSAGE_KEY_EXPRESSIONS_CLASS_FILE_SAVE_ERROR
- See Also:
- Constant Field Values
-
EXCEPTION_MESSAGE_KEY_FILE_SAVE_ERROR
public static final String EXCEPTION_MESSAGE_KEY_FILE_SAVE_ERROR
- See Also:
- Constant Field Values
-
EXCEPTION_MESSAGE_KEY_OUTPUT_STREAM_SAVE_ERROR
public static final String EXCEPTION_MESSAGE_KEY_OUTPUT_STREAM_SAVE_ERROR
- See Also:
- Constant Field Values
-
-
Method Detail
-
saveObject
public static void saveObject(Object obj, String fileName) throws JRException
- Throws:
JRException
-
saveObject
public static void saveObject(Object obj, File file) throws JRException
- Throws:
JRException
-
saveObject
public static void saveObject(Object obj, OutputStream os) throws JRException
- Throws:
JRException
-
saveClassSource
public static void saveClassSource(String source, File file) throws JRException
- Throws:
JRException
-
-