java.beans.XMLEncoder.getOwner()方法的使用及代码示例

x33g5p2x  于2022-02-02 转载在 其他  
字(2.6k)|赞(0)|评价(0)|浏览(107)

本文整理了Java中java.beans.XMLEncoder.getOwner()方法的一些代码示例,展示了XMLEncoder.getOwner()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XMLEncoder.getOwner()方法的具体详情如下:
包路径:java.beans.XMLEncoder
类名称:XMLEncoder
方法名:getOwner

XMLEncoder.getOwner介绍

暂无

代码示例

代码示例来源:origin: org.swinglabs.swingx/swingx-beaninfo

@Override
    protected void initialize(Class type, Object oldInstance,
        Object newInstance, Encoder out) {
//            p("image painter delegate called");
      super.initialize(type, oldInstance,  newInstance, out);
      //p("old instance = " + oldInstance);
      //p("owner = " + ((XMLEncoder)out).getOwner());
      PersistenceOwner owner = (PersistenceOwner)((XMLEncoder)out).getOwner();
      ImagePainter ip = (ImagePainter)oldInstance;
//            p("need to convert string: " + ip.getImageString());
//            String s = owner.toXMLURL(ip.getImageString());
//            p("converted to: " + s);
        //out.writeExpression(new Expression(oldInstance,owner,"fromXMLURL",new Object[]{ip.getImageString()}));
        //out.writeStatement(new Statement(owner,"fromXMLURL",new Object[]{ip.getImageString()}));
        //out.writeStatement(new Statement(oldInstance,"setImageString",new Object[]{
        //new Expression(oldInstance,owner,"fromXMLURL",new Object[]{ip.getImageString()})
        //}));
        
      out.writeStatement(new Statement(oldInstance,"setResolver",new Object[]{owner}));
//            out.writeStatement(new Statement(oldInstance,"setImageString",new Object[]{s}));
    }
  }

代码示例来源:origin: org.swinglabs/swingx-beaninfo

@Override
    protected void initialize(Class type, Object oldInstance,
        Object newInstance, Encoder out) {
//            p("image painter delegate called");
      super.initialize(type, oldInstance,  newInstance, out);
      //p("old instance = " + oldInstance);
      //p("owner = " + ((XMLEncoder)out).getOwner());
      PersistenceOwner owner = (PersistenceOwner)((XMLEncoder)out).getOwner();
      ImagePainter ip = (ImagePainter)oldInstance;
//            p("need to convert string: " + ip.getImageString());
      String s = owner.toXMLURL(ip.getImageString());
//            p("converted to: " + s);
        //out.writeExpression(new Expression(oldInstance,owner,"fromXMLURL",new Object[]{ip.getImageString()}));
        //out.writeStatement(new Statement(owner,"fromXMLURL",new Object[]{ip.getImageString()}));
        //out.writeStatement(new Statement(oldInstance,"setImageString",new Object[]{
        //new Expression(oldInstance,owner,"fromXMLURL",new Object[]{ip.getImageString()})
        //}));
        
      out.writeStatement(new Statement(oldInstance,"setResolver",new Object[]{owner}));
      out.writeStatement(new Statement(oldInstance,"setImageString",new Object[]{s}));
    }
  }

相关文章