Spring是很灵活的。写一个Factory类就成,:
public class PsFactory extends AbstractFactoryBean {    protected Object createInstance() throws Exception {
        PropertySet ps=new PropertySet();
        for (Iterator it = map.keySet().iterator(); it.hasNext();) {
            String  key = (String)it.next();
            ps.setProperty(key,map.get(key));
        }
        return ps;
    }    private Map map;    public void setMap(Map map) {
        this.map = map;
    }    public Class getObjectType() {
        return PropertySet.class;
    }
}"是个接口static变量返回一个int型"
怎么象绕口令似的..................

解决方案 »

  1.   

    很感谢!三天还没有人答复,我会把分全给你。这样我不是要自己写很多类。不太爽,有没有直接通过xxx.xml注入的。"是个接口static变量返回一个int型"
    怎么象绕口令似的..................
       呵呵。是我表达不清楚么?看原型:
    public interface LicenseProductCode extends Serializable-----------------------
    Field Summary 
    -----------------------
    static int LicenseProductCodeArcEditor 
                
    static int LicenseProductCodeArcInfo 
                
    static int LicenseProductCodeArcServer 
                
    static int LicenseProductCodeArcView 
                
    static int LicenseProductCodeEngine 
                
    static int LicenseProductCodeEngineGeoDB 
     
    --------------------------
      

  2.   

    那没办法啊,你那个PropertySet又不是标准的java bean,你必须写个类告诉Spring容器如何初始化bean。你看看PropertySet暴露一个map或properties属性没有。