1 9 package org.jahia.data.fields; 10 11 import java.util.Hashtable ; 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 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 43 private Hashtable loadFlags; 44 45 46 50 protected LoadFlags() 51 { 52 loadFlags = new Hashtable (); 53 loadFlags.put( new Integer (FieldTypes.INTEGER), new Integer (INTEGER) ); 54 loadFlags.put( new Integer (FieldTypes.SMALLTEXT), new Integer (SMALLTEXT) ); 55 loadFlags.put( new Integer (FieldTypes.BIGTEXT), new Integer (BIGTEXT) ); 56 loadFlags.put( new Integer (FieldTypes.DATE), new Integer (DATE) ); 57 loadFlags.put( new Integer (FieldTypes.PAGE), new Integer (PAGE) ); 58 loadFlags.put( new Integer (FieldTypes.FILE), new Integer (FILE) ); 59 loadFlags.put( new Integer (FieldTypes.APPLICATION), new Integer (APPLICATION) ); 60 loadFlags.put( new Integer (FieldTypes.FLOAT), new Integer (FLOAT) ); 61 loadFlags.put( new Integer (FieldTypes.BOOLEAN), new Integer (BOOLEAN) ); 62 loadFlags.put( new Integer (FieldTypes.COLOR), new Integer (COLOR) ); 63 loadFlags.put( new Integer (FieldTypes.SMALLTEXT_SHARED_LANG), new Integer (SMALLTEXT_SHARED_LANG) ); 64 } 66 70 public static synchronized LoadFlags getInstance() 71 { 72 if (theObject == null) { 73 theObject = new LoadFlags(); 74 } 75 return theObject; 76 } 78 79 80 84 public Hashtable getLoadFlags() 85 { 86 Hashtable out = (Hashtable ) loadFlags.clone(); 87 return out; 88 } 90 } 91 92 | Popular Tags |