1 17 package org.apache.log.output.jms; 18 19 24 public class PropertyType 25 { 26 public static final int STATIC = 1; 27 public static final int CATEGORY = 2; 28 public static final int CONTEXT = 3; 29 public static final int MESSAGE = 4; 30 public static final int TIME = 5; 31 public static final int RELATIVE_TIME = 6; 32 public static final int THROWABLE = 7; 33 public static final int PRIORITY = 8; 34 35 39 40 public static final String STATIC_STR = "static"; 41 public static final String CATEGORY_STR = "category"; 42 public static final String CONTEXT_STR = "context"; 43 public static final String MESSAGE_STR = "message"; 44 public static final String TIME_STR = "time"; 45 public static final String RELATIVE_TIME_STR = "rtime"; 46 public static final String THROWABLE_STR = "throwable"; 47 public static final String PRIORITY_STR = "priority"; 48 49 public static int getTypeIdFor( final String type ) 50 { 51 if( type.equalsIgnoreCase( CATEGORY_STR ) ) 52 return CATEGORY; 53 else if( type.equalsIgnoreCase( STATIC_STR ) ) 54 return STATIC; 55 else if( type.equalsIgnoreCase( CONTEXT_STR ) ) 56 return CONTEXT; 57 else if( type.equalsIgnoreCase( MESSAGE_STR ) ) 58 return MESSAGE; 59 else if( type.equalsIgnoreCase( PRIORITY_STR ) ) 60 return PRIORITY; 61 else if( type.equalsIgnoreCase( TIME_STR ) ) 62 return TIME; 63 else if( type.equalsIgnoreCase( RELATIVE_TIME_STR ) ) 64 return RELATIVE_TIME; 65 else if( type.equalsIgnoreCase( THROWABLE_STR ) ) 66 { 67 return THROWABLE; 68 } 69 else 70 { 71 throw new IllegalArgumentException ( "Unknown Type " + type ); 72 } 73 } 74 } 75 76 | Popular Tags |