Examples of convert()


Examples of org.apache.bsf.util.type.TypeConvertor.convert()

    if (fieldType.isAssignableFrom (value.type)) {
    fieldVal = value.value;
    } else if (tcr != null) {
    TypeConvertor cvtor = tcr.lookup (value.type, fieldType);
    if (cvtor != null) {
      fieldVal = cvtor.convert (value.type, fieldType, value.value);
    } else {
      okeydokey = false;
    }
    } else {
    okeydokey = false;
View Full Code Here

Examples of org.apache.cloudstack.utils.qemu.QemuImg.convert()

                    qemu.create(destFile, backingFile);
                } else if (format == PhysicalDiskFormat.RAW) {
                    QemuImgFile sourceFile = new QemuImgFile(template.getPath(), template.getFormat());
                    QemuImgFile destFile = new QemuImgFile(disk.getPath(), PhysicalDiskFormat.RAW);
                    QemuImg qemu = new QemuImg();
                    qemu.convert(sourceFile, destFile);
                }
            } else {
                format = PhysicalDiskFormat.RAW;
                disk = new KVMPhysicalDisk(destPool.getSourceDir() + "/" + newUuid, newUuid, destPool);
                disk.setFormat(format);
View Full Code Here

Examples of org.apache.commons.beanutils.ConvertUtilsBean.convert()

      type = Class.forName(field.getType());
      List<T> rs = CollectUtils.newArrayList();
      if (properties.isEmpty()) {
        ConvertUtilsBean converter = Converter.getDefault();
        for (String data : datas) {
          rs.add((T) converter.convert(data, type));
        }
        return rs;
      } else {
        properties.clear();
        int startIndex=0;
View Full Code Here

Examples of org.apache.commons.beanutils.Converter.convert()

    if (srcFieldValue == null || destFieldClass == null || (srcFieldValue.equals("") && !destFieldClass.equals(String.class))) {
      return null;
    }
    Converter converter = getPrimitiveOrWrapperConverter(destFieldClass, dateFormatContainer);
    try {
      return converter.convert(destFieldClass, srcFieldValue);
    } catch (org.apache.commons.beanutils.ConversionException e) {
      throw new org.dozer.converters.ConversionException(e);
    }
  }
View Full Code Here

Examples of org.apache.commons.beanutils.converters.ArrayConverter.convert()

          StringConverter stringConverter = new StringConverter();
          ArrayConverter arrayConverter = new ArrayConverter(String[].class, stringConverter);
          arrayConverter.setDelimiter(';');
          arrayConverter.setAllowedChars(new char[]{ '@','_' });

          String[] emailList = (String[]) arrayConverter.convert(String[].class, emailaddresses);

          if (emailList.length > 0)
          {
            String shortFilename = JUtility.getFilenameFromPath(getExportFilename());
            mail.postMail(emailList, "Commande4j User Report requested by "+Common.userList.getUser(Common.sessionID).getUserId()+" from [" + Common.hostList.getHost(getHostID()).getSiteDescription() + "] on " + JUtility.getClientName(), "See attached report.\n", shortFilename, getExportFilename());
View Full Code Here

Examples of org.apache.commons.beanutils.locale.LocaleConvertUtilsBean.convert()

      }
      Object[] params = new Object[m.groupCount()+1];
      params[0] = req;
      for (int i=1;i<=m.groupCount();i++) {
        LocaleConvertUtilsBean converter = new LocaleConvertUtilsBean();
        params[i] = converter.convert(m.group(i), paramTypes[i]);
      }

      return new MethodObjectParams(this.clazz, method, params);
    } else {
      log.warn("Called execute on url,  but pattern did not match: " + url);
View Full Code Here

Examples of org.apache.commons.beanutils.locale.converters.DateLocaleConverter.convert()

      DateLocaleConverter converter = new DateLocaleConverter(locale,
          datePattern);
      // It does not accept dates with months greater than 12 and days
      // greater than 31.
      // It accepts years greater than the current year.
      converter.convert(date, datePattern);
      SimpleDateFormat formatter = new SimpleDateFormat(datePattern,
          locale);
      return formatter.parse(date);
    } catch (Exception e) {
      return null;
View Full Code Here

Examples of org.apache.commons.beanutils.locale.converters.IntegerLocaleConverter.convert()

     *
     * @param input the input string
     */
    private void checkConversionWithNullDefault(String input) {
        Converter converter = new IntegerLocaleConverter(null, Locale.US);
        assertNull("Wrong result", converter.convert(Integer.class, input));
    }

    /**
     * Tests a conversion passing in null.
     */
 
View Full Code Here

Examples of org.apache.ddlutils.platform.DefaultValueHelper.convert()

                        // we should also adapt the default value
                        if (column.getDefaultValue() != null)
                        {
                            DefaultValueHelper helper = getPlatform().getSqlBuilder().getDefaultValueHelper();

                            column.setDefaultValue(helper.convert(column.getDefaultValue(), origType, targetType));
                        }
                    }
                    // we also promote the default size if the column has no size
                    // spec of its own
                    if ((column.getSize() == null) && getPlatformInfo().hasSize(targetType))
View Full Code Here

Examples of org.apache.directory.api.ldap.model.schema.AttributesFactory.convert()

                if ( schemaObject instanceof AttributeType )
                {
                    AttributeType attributeType = ( AttributeType ) schemaObject;

                    Entry attributeTypeEntry = factory.convert( attributeType, schema, null );

                    attributeTypeEntries.add( attributeTypeEntry );
                }
            }
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.