Examples of TranslationException


Examples of com.codiform.moo.TranslationException

      Object target = createTargetMap( value, property, translationSource );
      if ( target instanceof Map ) {
        translateMap( (Map<Object, Object>)value, (Map<Object, Object>)target, property, translationSource );
        return target;
      } else {
        throw new TranslationException( "Cannot translate map to target of type: " + target.getClass().getName() );
      }
    } else {
      throw new TranslationException( "Cannot translate map from type: " + value.getClass().getName() );
    }
  }
View Full Code Here

Examples of com.codiform.moo.TranslationException

      if ( target instanceof Map ) {
        Map<Object, Object> targetMap = (Map<Object, Object>)target;
        targetMap.putAll( (Map<Object, Object>)value );
        return targetMap;
      } else {
        throw new TranslationException( "Cannot translate Map to target of type: " + target.getClass().getName() );
      }
    } else {
      throw new TranslationException( "Cannot translate collection from type: " + value.getClass().getName() );
    }
  }
View Full Code Here

Examples of com.codiform.moo.TranslationException

  @Override
  public <T> T getTranslationTargetInstance( Object source, Class<T> targetType ) {
    Class<? extends T> type = getDefaultTypeForTarget( targetType );
    if ( type == null ) {
      throw new TranslationException( "Cannot determine default collection type for type: " + targetType );
    } else {
      return construct( type );
    }
  }
View Full Code Here

Examples of com.codiform.moo.TranslationException

      if ( source instanceof String )
        return (String)source;
      else
        return source.toString();
    } catch ( Exception exception ) {
      throw new TranslationException( "Could not translate object " + source + " to String.", exception );
    }
  }
View Full Code Here

Examples of com.codiform.moo.TranslationException

   */
  public T create() {
    try {
      return destinationClass.newInstance();
    } catch (InstantiationException exception) {
      throw new TranslationException(String.format(
          "Error while instantiating %s", destinationClass),
          exception);
    } catch (IllegalAccessException exception) {
      throw new TranslationException(String.format(
          "Not allowed to instantiate %s", destinationClass),
          exception);
    }
  }
View Full Code Here

Examples of flex.messaging.io.amf.translator.TranslationException

   
                    beanProxy.setValue(bean, propName, decodedObject);
                }
                catch (Exception e)
                {
                    TranslationException ex = new TranslationException("Could not set object " + decodedObject + " on " + bean.getClass() + "'s " + propName);
                    ex.setCode("Server.Processing");
                    ex.setRootCause(e);
                    throw ex;
                }
            }
        }
View Full Code Here

Examples of flex.messaging.io.amf.translator.TranslationException

                }
            }
        }
        catch (Exception e)
        {
            TranslationException ex = new TranslationException("Could not create Map " + desiredClass, e);
            ex.setCode("Server.Processing");
            throw ex;
        }
    }
View Full Code Here

Examples of flex.messaging.io.amf.translator.TranslationException

            message.append("with remote type specified as '").append(aso.getType()).append("' ");
        }

        message.append("to an instance of ").append(desiredClass.toString());

        TranslationException ex = new TranslationException(message.toString());
        ex.setCode("Client.Message.Deserialize.InvalidType");
        throw ex;
    }
View Full Code Here

Examples of flex.messaging.io.amf.translator.TranslationException

                col = (Collection)desiredClass.newInstance();
            }
        }
        catch (Exception e)
        {
            TranslationException ex = new TranslationException("Could not create Collection " + desiredClass, e);
            ex.setCode("Server.Processing");
            throw ex;
        }

        if (col == null)
        {
View Full Code Here

Examples of flex.messaging.io.amf.translator.TranslationException

                    beanProxy.setValue(bean, propName, decodedObject);
                }
                catch (Exception e)
                {
                    TranslationException ex = new TranslationException("Could not set object " + decodedObject + " on " + bean.getClass() + "'s " + propName);
                    ex.setCode("Server.Processing");
                    ex.setRootCause(e);
                    throw ex;
                }
            }
        }
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.