Examples of ConversionException


Examples of org.directwebremoting.ConversionException

    @Override public OutboundVariable convertOutbound(Object data, OutboundContext outctx) throws ConversionException {
        try {
            return new NonNestedOutboundVariable(data == null ? "null" : "'" + cipherer.encrypt(((UUID) data).toString()) + "'");
        } catch (Exception e) {
            throw new ConversionException(data.getClass(), new IWebMvcException("Could not generate encrypted UUID from: " + data, e));
        }
    }
View Full Code Here

Examples of org.directwebremoting.ConversionException

        return value < 0 ? null : paramType.getEnumConstants()[value];
    }

    @Override public OutboundVariable convertOutbound(Object data, OutboundContext outctx) {
        Class<?> enumClass = data.getClass();
        if (!enumClass.isEnum()) throw new ConversionException(enumClass);
        int pos = -1;
        Object[] enums = enumClass.getEnumConstants();
        for (int index = 0; index < enums.length; index++)
            if (enums[index] == data)
                pos = index;
        if (pos < 0) throw new ConversionException(enumClass);
        return new NonNestedOutboundVariable("{position: " + pos + ", displayable: \'" + messageResolver.getMessage(enumClass.getSimpleName() + "." + ((Enum<?>) data).name(), null, WebContextLocale.getActiveLocale()) + "\'}");
    }
View Full Code Here

Examples of org.directwebremoting.ConversionException

            String className = LocalUtil.urlDecode(data.getValue());
            try {
                Assert.isEncrypted(decipherer, className);
                return ClassUtils.forName(decipherer.decrypt(className));
            } catch (Exception cne) {
                throw new ConversionException(paramType, new IWebMvcException("Could not convert class from: " + className, cne));
            }
      }
      return null;
    }
View Full Code Here

Examples of org.directwebremoting.ConversionException

        try {
            String name = ClassUtils.getActualClass(data).getName();
            if (name.indexOf("_$$_javassist") > 0) name = name.substring(0, name.indexOf("_$$_javassist"));
            return new NonNestedOutboundVariable(data == null ? "null" : "'" + cipherer.encrypt(name) + "'");
        } catch (Exception e) {
            throw new ConversionException(data.getClass(), new IWebMvcException("Could not generate encrypted class name from: " + data, e));
        }
    }
View Full Code Here

Examples of org.directwebremoting.ConversionException

            try {
                String points = data.getValue();
                rating.setRating(hasText(points) ? Double.parseDouble(points) : 0D);
                return rating;
            } catch (Exception e) {
                throw new ConversionException(paramType, new IWebMvcException("Could not convert Rating from: " + data, e));
            }
      }
        return null;
    }
View Full Code Here

Examples of org.eclipse.sapphire.ConversionException

            {
                // Intentionally ignored.
            }
        }
       
        throw new ConversionException();
    }
View Full Code Here

Examples of org.freeplane.plugin.script.proxy.ConversionException

                return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(string);
      else
        return new SimpleDateFormat("yyyy-MM-dd HH:mm").parse(string);
    }
    catch (ParseException e) {
      throw new ConversionException(e);
    }
  }
View Full Code Here

Examples of org.jamesii.core.model.symbolic.convert.ConversionException

    } catch (NoFactoryFoundException nothingFound) {
      if (targetFormat.equals(SimpleDocument.class)) {
        return new DefaultConverter();
      }

      throw new ConversionException("Configuration problem: No converter for "
          + this.getClass().getCanonicalName() + " to a document of type "
          + targetFormat + " exists!", nothingFound);
    }
    pb.setValue(this);
    return cF.create(pb, SimSystem.getRegistry().createContext());
View Full Code Here

Examples of org.jboss.forge.addon.convert.exception.ConversionException

      {
         return constructor.newInstance(source);
      }
      catch (Exception e)
      {
         throw new ConversionException("Could not convert [" + source + "] to type [" + getTargetType() + "]", e);
      }
   }
View Full Code Here

Examples of org.jdesktop.binding.metadata.ConversionException

                convertedValue = componentValue;
            }
        }
        else {
            if (!elementClass.isAssignableFrom(componentValue.getClass())) {
                throw new ConversionException("cannot assign component value");
            } else {
                convertedValue = componentValue;
            }
        }
        return convertedValue;
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.