|
JClass DesktopViews 6.3.0 API Documentation |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.klg.jclass.datasource.beans.SerializedProperties
Serializes and deserializes a bean component to/from a file. Serialization file is a physical file that serialized a bean component. It is used at design-time. When the bean component is deployed, there is no guarantee that the serialization file saved at design-time is located at a directory that is accessible at run-time. Thus, a resource name relative to a class loader is used to specify where to get the serialized bean component.
A resource is identified by a String that is /-separated sequence of substrings. e.g. resource/jclass/datasource/mydb.ser
ClassLoader
,
Serialized FormField Summary | |
protected String |
defaultSerializationFileBase
Default serialization file (base part) at design time. |
protected String |
resourceName
resource name relative to a class loader. |
protected String |
serializationFile
Serialization file for this bean component at design time. |
Constructor Summary | |
SerializedProperties()
|
Method Summary | |
void |
addJCDataListener(com.klg.jclass.datasource.beans.JCDataListener listener)
Adds the specified listener to receive JCDataEvent objects. |
void |
fireJCDataEvent(com.klg.jclass.datasource.beans.JCDataEvent event)
Inform registered listeners of a JCDataEvent. |
static com.klg.jclass.datasource.beans.SerializedProperties |
fromFile(String file)
Deserializes a serialization file to get a bean component. |
static com.klg.jclass.datasource.beans.SerializedProperties |
fromResource(ClassLoader cl,
String resource_name)
Instantiates a SerializedProperties from a resource. |
static com.klg.jclass.datasource.beans.SerializedProperties |
fromResource(Class caller_class,
String resource_name)
Instantiates a SerializedProperties from a resource. |
protected static String |
getDefaultSerializationFile(String base,
int counter)
Gets a default serialization file name. |
String |
getDefaultSerializationFileToOpen()
Gets a default serialization file name to open. |
String |
getResourceName()
Gets resource name relative to a class loader. |
String |
getSerializationFile()
Gets the bean component serialization file. |
boolean |
isResourceNameSpecified()
Indicates if resource name has been specified. |
protected boolean |
isSameString(String s1,
String s2)
Returns if two strings are equal. |
boolean |
isSerializationRequired()
Indicates if serialization is required. |
void |
removeJCDataListener(com.klg.jclass.datasource.beans.JCDataListener listener)
Removes the specified listener so it no longer receives JCDataEvent objects. |
protected void |
setChanged()
Override to set isSerializationRequired to true. |
protected void |
setDefaultSerializationFileBase(String base)
Sets the default serialization file base part. |
void |
setResourceName(String s)
Sets resource name relative to a class loader. |
void |
setSerializationFile(String s)
Sets the bean component serialization file. |
static void |
toFile(com.klg.jclass.datasource.beans.SerializedProperties comp,
String file)
Serializes the bean component to a file. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected String serializationFile
protected String resourceName
protected String defaultSerializationFileBase
Constructor Detail |
public SerializedProperties()
Method Detail |
public void setSerializationFile(String s)
public String getSerializationFile()
public void setResourceName(String s)
public String getResourceName()
public boolean isResourceNameSpecified()
public boolean isSerializationRequired()
public static com.klg.jclass.datasource.beans.SerializedProperties fromResource(ClassLoader cl, String resource_name) throws ClassNotFoundException, IOException
cl
- class loader used to get the resource.resource_name
- resource name relative to a class loader
to the bean component. It must have the right extension.
ClassNotFoundException
- If the class can't be loaded.
IOException
- If an IO exception occurs.ClassLoader
public static com.klg.jclass.datasource.beans.SerializedProperties fromResource(Class caller_class, String resource_name) throws ClassNotFoundException, IOException
caller_class
- class that uses the serialized bean component.resource_name
- resource name relative to a class loader
to the bean component. It must have right extension.
ClassNotFoundException
- If the class can't be loaded.
IOException
- If an IO exception occurs.ClassLoader
public static com.klg.jclass.datasource.beans.SerializedProperties fromFile(String file) throws FileNotFoundException, ClassNotFoundException, IOException
file
- serialization file. Itmust have the right extension.
FileNotFoundException
- If the file find operation fails.
ClassNotFoundException
- If the class cannot be found.
IOException
- If an IO exception occurs.public static void toFile(com.klg.jclass.datasource.beans.SerializedProperties comp, String file) throws FileNotFoundException, IOException
comp
- bean component to be serialized.file
- name of the file used to serialize the bean component.
FileNotFoundException
IOException
protected static String getDefaultSerializationFile(String base, int counter)
protected void setDefaultSerializationFileBase(String base)
public String getDefaultSerializationFileToOpen()
protected boolean isSameString(String s1, String s2)
protected void setChanged()
public void addJCDataListener(com.klg.jclass.datasource.beans.JCDataListener listener)
listener
- A listener.public void removeJCDataListener(com.klg.jclass.datasource.beans.JCDataListener listener)
listener
- A listener.public void fireJCDataEvent(com.klg.jclass.datasource.beans.JCDataEvent event)
event
- The JCDataEvent.
|
Copyright © 2004 Quest Software Inc.. All rights reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |