Package org.apache.commons.beanutils

Examples of org.apache.commons.beanutils.LazyDynaBean


      }
      sb.append(")");
      return sb.toString();
     
    }else if(obj instanceof LazyDynaBean){
      LazyDynaBean bean = (LazyDynaBean)obj;
      return "DynaBean"+print_object(bean.getMap(),offset - 1);
    }else{
      Field[] slots = type.getFields();
      String ret = "<[" + type.getName() + "]";
      for (int ii = 0; ii < slots.length; ii++) {
        ret += "\n" + pad(offset) + "[" + slots[ii].getName() + " ";
View Full Code Here


    for(int i=0;i<rowCount;i++){
      List<LazyDynaBean> row = new ArrayList<LazyDynaBean>();
     
     
      for(int j=0;j<10;j++){
        LazyDynaBean column4Row = new LazyDynaBean();
       
       
      }
           
     
View Full Code Here

      CustomWebSecurityExpressionHandler filterSecurityInterceptor = (CustomWebSecurityExpressionHandler)StorageService.ctx.getBean("customExpressionHandler");
      EvaluationContext ctx = filterSecurityInterceptor.createEvaluationContext(authentication, request);
      for(String function:functions){
        String expression = "hasRole('ROLE_USER') and hasIpAddress('localhost')";
        Expression expr = PARSER.parseExpression(expression);
            LazyDynaBean bean = new LazyDynaBean();
            bean.set(function, ExpressionUtils.evaluateAsBoolean(expr, ctx));
            beans.add(bean);
      }
      resultInfo.setSucceed();
      resultInfo.setData(beans);
    }
View Full Code Here

   
    int size  = uploads.size();
    if(size==0){
      resultInfo.setFailed(FILE_UPLOAD_NO_FILE);
    }else if(size==1){
      LazyDynaBean bean = new LazyDynaBean();
      File f = uploads.get(0);
//      String fileName = f.getName();
      String fileName = null;
      if(uploadFileNames.size()>0){
        fileName = uploadFileNames.get(0);
      }
      if(fileName!=null){
        bean.set("fileName", fileName);
        int index = fileName.lastIndexOf(".");
        if(index>=0){
          String post = fileName.substring(index);
          String uuid = MyUUIDGen.getUUID();
          String targetFileName = upPath+"/"+uuid+post;
          File targetFile = new File(targetFileName);
          try {
            FileUtils.moveFile(f, targetFile);
            bean.set("saveName", targetFile.getName());
            resultInfo.setSucceed();
          } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
            bean.set("saveName", "");
            resultInfo.setFailed(FILE_UPLOAD_HAS_NO_POSTFIX);
          }
        }else{
          bean.set("saveName", "");
          resultInfo.setFailed(FILE_UPLOAD_HAS_NO_POSTFIX);
        }
      }else{
        bean.set("saveName", "");
        resultInfo.setFailed(FILE_UPLOAD_HAS_NO_POSTFIX);
      }
      beans.add(bean);
    }else{
      for(int i=0;i<uploads.size();i++){
        LazyDynaBean bean = new LazyDynaBean();
        File f = uploads.get(i);
//        String fileName = f.getName();
        String fileName = null;
        if(uploadFileNames.size()>i){
          fileName = uploadFileNames.get(i);
        }
        if(fileName!=null){
          bean.set("fileName", fileName);
          int index = fileName.lastIndexOf(".");
          if(index>=0){
            String post = fileName.substring(index);
            String uuid = MyUUIDGen.getUUID();
            String targetFileName = upPath+"/"+uuid+post;
            File targetFile = new File(targetFileName);
            try {
              FileUtils.moveFile(f, targetFile);
              bean.set("saveName", targetFile.getName());
              bean.set("message", FILE_UPLOAD_OK);
              bean.set("status", true);
            } catch (IOException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
              bean.set("saveName", "");
              bean.set("message", FILE_UPLOAD_HAS_NO_POSTFIX);
              bean.set("status", false);
            }
          }else{
            bean.set("saveName", "");
            bean.set("message", FILE_UPLOAD_HAS_NO_POSTFIX);
            bean.set("status", false);
          }
        }else{
          bean.set("fileName", "");
          bean.set("saveName", "");
          bean.set("message", FILE_UPLOAD_NO_NAME);
          bean.set("status", false);
        }
        beans.add(bean);
        if(f.isFile()&&f.exists()){
          f.delete();
        }
View Full Code Here

  public String getSSUI(){
//    ReportManagementService reportManagementService = (ReportManagementService)StorageService.ctx.getBean("reportManagementService");
//    resultInfo = reportManagementService.getReportTemplate(request.getParameter("id"));
    resultInfo = new OperResult();
    resultInfo.setSucceed();
    LazyDynaBean bean = new LazyDynaBean();
    bean.set("id","");
    try {
      BeanUtils.populate(bean, parameterMap);
    } catch (IllegalAccessException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
View Full Code Here

    /**
     * Default Constructor which creates a <code>LazyDynaBean</code> to
     * <i>back</i> this form.
     */
    public LazyValidatorForm() {
        super(new LazyDynaBean());
    }
View Full Code Here

     *
     * <p>Override this method if you require a different type of
     * <code>DynaBean</code>.</p>
     */
    protected DynaBean newIndexedBean(String name) {
        return new LazyDynaBean();
    }
View Full Code Here

    /**
     * Default Constructor which creates a <code>LazyDynaBean</code> to <i>back</i>
     * this form.
     */
    public LazyValidatorForm() {
        super(new LazyDynaBean());
    }
View Full Code Here

    *
    * <p>Override this method if you require a different type of
    *    <code>DynaBean</code>.</p>
    */
    protected DynaBean newIndexedBean(String name) {
        return new LazyDynaBean();
    }
View Full Code Here

    return personBean;
  }

  private static DynaBean createBean() {
    DynaBean bean = new LazyDynaBean();
    return bean;
  }
View Full Code Here

TOP

Related Classes of org.apache.commons.beanutils.LazyDynaBean

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.