KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mmbase > bridge > util > FieldWrapper


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
11 package org.mmbase.bridge.util;
12
13 import java.util.Locale JavaDoc;
14 import java.util.Collection JavaDoc;
15 import org.mmbase.util.LocalizedString;
16 import org.mmbase.bridge.*;
17 import org.mmbase.datatypes.DataType;
18
19
20 /**
21  * Wraps another Field. You can use this if you want to implement Field, and want to base that
22  * implementation on a existing <code>Field</code> instance.
23  *
24  * @author Michiel Meeuwissen
25  * @version $Id: FieldWrapper.java,v 1.1 2006/07/18 13:49:36 michiel Exp $
26  * @since MMBase-1.8.1
27  */

28
29 public abstract class FieldWrapper implements Field {
30     protected final Field field;
31
32     public FieldWrapper(Field field) {
33         this.field = field;
34     }
35     public abstract NodeManager getNodeManager();
36
37     public int getState() { return Field.STATE_VIRTUAL; }
38
39     public DataType getDataType() { return field.getDataType(); }
40     public boolean isUnique() { return field.isUnique(); }
41     public boolean hasIndex() { return field.hasIndex(); }
42     public int getType() { return field.getType(); }
43     public int getListItemType() { return field.getListItemType(); }
44     public int getSearchPosition() { return field.getSearchPosition(); }
45     public int getListPosition() { return field.getListPosition(); }
46     public int getEditPosition() { return field.getEditPosition(); }
47     public int getStoragePosition() { return field.getStoragePosition(); }
48     public String JavaDoc getGUIType() { return field.getGUIType(); }
49     public boolean isRequired() { return field.isRequired(); }
50     public int getMaxLength() { return field.getMaxLength(); }
51     public Collection JavaDoc validate(Object JavaDoc value) { return field.validate(value); }
52     public boolean isVirtual() { return true; }
53     public boolean isReadOnly() { return true; }
54     public String JavaDoc getName() { return field.getName(); }
55     public String JavaDoc getGUIName() { return field.getGUIName(); }
56     public String JavaDoc getGUIName(Locale JavaDoc locale) { return field.getGUIName(locale); }
57     public LocalizedString getLocalizedGUIName() { return field.getLocalizedGUIName(); }
58     public void setGUIName(String JavaDoc g, Locale JavaDoc locale) { throw new UnsupportedOperationException JavaDoc(); }
59     public void setGUIName(String JavaDoc g) { throw new UnsupportedOperationException JavaDoc(); }
60     public LocalizedString getLocalizedDescription() { return field.getLocalizedDescription(); }
61     public String JavaDoc getDescription(Locale JavaDoc locale) { return field.getDescription(locale); }
62     public String JavaDoc getDescription() { return field.getDescription(); }
63     public void setDescription(String JavaDoc description, Locale JavaDoc locale) { throw new UnsupportedOperationException JavaDoc(); }
64     public void setDescription(String JavaDoc description) { throw new UnsupportedOperationException JavaDoc(); }
65
66
67     public Field getField() {
68         return field;
69     }
70 }
71
Popular Tags