KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jahia > data > fields > LoadFlags


1 //
2
// LoadFlags
3
// you can combine all those values to do a mask !
4
// for example (BIGTEXT | SMALLTEXT | HTTPLINK)
5
// DJ 05.01.2001
6
//
7
//
8

9 package org.jahia.data.fields;
10
11 import java.util.Hashtable JavaDoc;
12
13
14 public class LoadFlags {
15
16     public static final int INTEGER = 1;
17     public static final int SMALLTEXT = 2;
18     public static final int BIGTEXT = 4;
19     public static final int DATE = 8;
20     public static final int PAGE = 16;
21     public static final int FILE = 32;
22     //public static final int IMAGE = 64;
23
//public static final int AUDIOCLIP = 128;
24
//public static final int VIDEOCLIP = 256;
25
public static final int APPLICATION = 512;
26     public static final int FLOAT = 1024;
27     public static final int BOOLEAN = 2048;
28     public static final int COLOR = 4096;
29     public static final int SMALLTEXT_SHARED_LANG = 8192;
30
31     public static final int NEWSFEED = 1*65536;
32     public static final int DATASOURCE = 2*65536;
33
34     public static final int NOTHING = 0;
35     public static final int ALL = -1;
36     public static final int TEXTS = BIGTEXT | SMALLTEXT | COLOR | SMALLTEXT_SHARED_LANG;
37
38     private static LoadFlags theObject;
39
40     /**
41      * @associates Integer
42      */

43     private Hashtable JavaDoc loadFlags;
44
45
46     /***
47         * constructor
48         *
49         */

50     protected LoadFlags()
51     {
52         loadFlags = new Hashtable JavaDoc();
53         loadFlags.put( new Integer JavaDoc(FieldTypes.INTEGER), new Integer JavaDoc(INTEGER) );
54         loadFlags.put( new Integer JavaDoc(FieldTypes.SMALLTEXT), new Integer JavaDoc(SMALLTEXT) );
55         loadFlags.put( new Integer JavaDoc(FieldTypes.BIGTEXT), new Integer JavaDoc(BIGTEXT) );
56         loadFlags.put( new Integer JavaDoc(FieldTypes.DATE), new Integer JavaDoc(DATE) );
57         loadFlags.put( new Integer JavaDoc(FieldTypes.PAGE), new Integer JavaDoc(PAGE) );
58         loadFlags.put( new Integer JavaDoc(FieldTypes.FILE), new Integer JavaDoc(FILE) );
59         loadFlags.put( new Integer JavaDoc(FieldTypes.APPLICATION), new Integer JavaDoc(APPLICATION) );
60         loadFlags.put( new Integer JavaDoc(FieldTypes.FLOAT), new Integer JavaDoc(FLOAT) );
61         loadFlags.put( new Integer JavaDoc(FieldTypes.BOOLEAN), new Integer JavaDoc(BOOLEAN) );
62         loadFlags.put( new Integer JavaDoc(FieldTypes.COLOR), new Integer JavaDoc(COLOR) );
63         loadFlags.put( new Integer JavaDoc(FieldTypes.SMALLTEXT_SHARED_LANG), new Integer JavaDoc(SMALLTEXT_SHARED_LANG) );
64     } // end constructor
65

66     /***
67         * returns a single instance of the object
68         *
69         */

70     public static synchronized LoadFlags getInstance()
71     {
72         if (theObject == null) {
73             theObject = new LoadFlags();
74         }
75         return theObject;
76     } // end getInstance
77

78
79
80     /***
81         * gets available field types
82         *
83         */

84     public Hashtable JavaDoc getLoadFlags()
85     {
86         Hashtable JavaDoc out = (Hashtable JavaDoc) loadFlags.clone();
87         return out;
88     } // end getFieldTypes
89

90 }
91
92 // end LoadFlags
93
Popular Tags