KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mmbase > datatypes > XmlDataType


1 /*
2
3 This software is OSI Certified Open Source Software.
4 OSI Certified is a certification mark of the Open Source Initiative.
5
6 The license (Mozilla version 1.0) can be read at the MMBase site.
7 See http://www.MMBase.org/license
8
9 */

10 package org.mmbase.datatypes;
11
12 /**
13  * The data associated with 'XML' values ({@link org.w3c.dom.Document}). At the moment this class is
14  * empty, but of course we forsee the possibility for restrictions on doc-type.
15  *
16  * @author Michiel Meeuwissen
17  * @version $Id: XmlDataType.java,v 1.5 2006/04/04 21:35:28 michiel Exp $
18  * @since MMBase-1.8
19  */

20 public class XmlDataType extends AbstractLengthDataType {
21
22     private static final long serialVersionUID = 1L; // increase this if object serialization changes (which we shouldn't do!)
23

24
25     public long getLength(Object JavaDoc value) {
26         // this is how Storage would serialize it:
27
return org.mmbase.util.xml.XMLWriter.write((org.w3c.dom.Document JavaDoc) value, false, true).length();
28     }
29
30     /**
31      * Constructor for xml data type.
32      * @param name the name of the data type
33      */

34     public XmlDataType(String JavaDoc name) {
35         super(name, org.w3c.dom.Document JavaDoc.class);
36     }
37
38 }
39
Popular Tags