KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mmbase > datatypes > processors > LastModified


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.processors;
11
12 import org.mmbase.bridge.*;
13 import java.util.Date JavaDoc;
14
15 /**
16  * This processor can be used as a 'commit' processor on a (datetime) field. The field will then be set
17  * to the current time when the node is committed.
18  *
19  * @author Michiel Meeuwissen
20  * @version $Id: LastModified.java,v 1.4 2006/02/14 22:46:41 michiel Exp $
21  * @since MMBase-1.8
22  * @see LastModifier
23  */

24
25 public class LastModified implements CommitProcessor {
26
27     private static final long serialVersionUID = 1L;
28
29     public void commit(Node node, Field field) {
30         node.setValueWithoutProcess(field.getName(), new Date JavaDoc());
31     }
32
33     public String JavaDoc toString() {
34         return "lastmodified";
35     }
36 }
37
Popular Tags