1 29 30 package com.caucho.quercus.servlet; 31 32 import com.caucho.config.ConfigException; 33 import com.caucho.util.L10N; 34 35 import javax.annotation.PostConstruct; 36 37 40 public class PhpClassConfig { 41 private static final L10N L = new L10N(PhpClassConfig.class); 42 43 private Class _type; 44 private String _name; 45 46 49 public void setType(Class cl) 50 { 51 _type = cl; 52 } 53 54 57 public Class getType() 58 { 59 return _type; 60 } 61 62 65 public void setName(String name) 66 { 67 _name = name; 68 } 69 70 73 public String getName() 74 { 75 return _name; 76 } 77 78 81 @PostConstruct 82 public void init() 83 throws ConfigException 84 { 85 if (_type == null) 86 throw new ConfigException(L.l("<class> requires a type.")); 87 88 if (_name == null) { 89 String name = _type.getName(); 90 91 int p = name.lastIndexOf('.'); 92 93 _name = name.substring(p + 1); 94 } 95 } 96 } 97 98 | Popular Tags |