KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mmbase > bridge > jsp > taglib > FieldProviderTEI


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.bridge.jsp.taglib;
11
12 /**
13  * The TEI class for Field (type) Providers.
14  * In fact a simplified version of WriterTEI (can only provide Field an FieldValue).
15  *
16  * @author Michiel Meeuwissen
17  * @version $Id: FieldProviderTEI.java,v 1.4 2005/01/30 16:46:35 nico Exp $
18  * @since MMBase-1.7
19  */

20
21 public class FieldProviderTEI extends WriterTEI {
22
23     protected String JavaDoc defaultType() {
24         return "field";
25     }
26
27     protected String JavaDoc getType(String JavaDoc typeAttribute) {
28         String JavaDoc type;
29         switch (WriterHelper.stringToType(typeAttribute)) {
30             case WriterHelper.TYPE_FIELD:
31                 type = org.mmbase.bridge.Field.class.getName(); break;
32             case WriterHelper.TYPE_FIELDVALUE:
33                 type = org.mmbase.bridge.FieldValue.class.getName(); break;
34             default:
35                 //type = "java.lang.Object";
36
throw new RuntimeException JavaDoc("Unsupported type '" + typeAttribute + "'");
37             }
38         return type;
39
40     }
41
42
43     public FieldProviderTEI() {
44         super();
45     }
46
47
48 }
49
Popular Tags