Deserializing A Bean From XML |
|
| |
| |
This java source code is about Deserializing a Bean from XML...... |
| |
|
| |
// Deserialize an object
try {
XMLDecoder decoder = new XMLDecoder(new BufferedInputStream(
new FileInputStream("infilename.xml")));
// MyClass is declared in e7 Serializing a Bean to XML
MyClass o = (MyClass)decoder.readObject();
decoder.close();
// Use the object
int prop = o.getProp(); // 1
int[] props = o.getProps(); // [1,2,3]
} catch (FileNotFoundException e) {
}
Here is the XML data being deserialized:
<?xml version="1.0" encoding="UTF-8"?>
<java version="1.4.0" class="java.beans.XMLDecoder">
<object class="MyClass">
<void property="prop">
<int>1</int>
</void>
<void property="props">
<array class="int" length="3">
<void index="0">
<int>1</int>
</void>
<void index="1">
<int>2</int>
</void>
<void index="2">
<int>3</int>
</void>
</array>
</void>
</object>
</java>
|
|
| |
|
|
| |
Date entered :
17th Feb 2007
Rating : No Rating
Accessed :
5379
Submitted by :
javabill |
|
|
| |
|
|
| |
| |
|
Click each image to add this page to each site. |
|
|
| |
| |
|
| |
|
|
No comment available at the moment.Be the first one to make a comment
|
|
|
| |
|
|
Database error: Invalid SQL: select FLOOR( AVG(b.rating)) as avg_rating,a.sourcecode_id sourcecode_id ,title,description,author,category_id,skill_level,reference,reference_mail,reference_url,a.user_id user_id,date_entered,source,accessed,dev_id,file_url,total_comments,instruction,registered,authorised,fld_deletemark,fld_code_version,fld_searchkeyword,fld_code_status,category_id from tbl_sourcecode a LEFT JOIN tbl_sourcecodecomment b ON a.sourcecode_id = b.sourcecode_id LEFT JOIN tbl_codecategory c ON a.category_id = c.fld_categoryID where a.fld_deletemark = 'N' AND a.fld_enable_disable= 'Y' AND a.authorised='Y' AND c.fld_groupIDFK='4' AND a.sourcecode_id!='1282' GROUP BY a.sourcecode_id order by a.sourcecode_id DESC limit 0, 5
MySQL Error: 1030 (Got error 122 from storage engine)
Session halted.
Warning: Unknown(): write failed: Disk quota exceeded (122) in Unknown on line 0
Warning: Unknown(): Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp) in Unknown on line 0
| |