/** * This method transforms a value of the source type into a value * of the target type. * @param value Incoming value of source type * @return Outgoing value of target type * @throws TransformationException if value is an incorrect input type or * the transformation fails */ public Object transformDirect(Object value) throws TransformationException { try { return Double.valueOf((String)value); } catch(NumberFormatException e) { throw new TransformationException(CorePlugin.Event.TEIID10078, CorePlugin.Util.gs(CorePlugin.Event.TEIID10078, value)); } }
private static void helpTransformException(Object value, Class<?> target, String msg) { try { Transform transform = DataTypeManager.getTransform(value.getClass(), target); transform.transform(value, target); fail("Expected to get an exception during the transformation"); //$NON-NLS-1$ } catch (TransformationException e) { if (msg != null) { assertEquals(msg, e.getMessage()); } } }
@Test public void testObjectToAnyTransformFailure() { Transform transform = DataTypeManager.getTransform(DefaultDataClasses.OBJECT, DefaultDataClasses.TIME); try { transform.transform("1", DefaultDataClasses.TIME); //$NON-NLS-1$ fail("expected exception"); //$NON-NLS-1$ } catch (TransformationException e) { assertEquals("TEIID10076 Invalid conversion from type class java.lang.Object with value '1' to type class java.sql.Time", e.getMessage()); //$NON-NLS-1$ } }
/** * This method transforms a value of the source type into a value * of the target type. * @param value Incoming value of source type * @return Outgoing value of target type * @throws TransformationException if value is an incorrect input type or * the transformation fails */ public Object transformDirect(Object value) throws TransformationException { try { return new BigInteger(((String)value).trim()); } catch(NumberFormatException e) { throw new TransformationException(CorePlugin.Event.TEIID10081, CorePlugin.Util.gs(CorePlugin.Event.TEIID10081, value)); } }
constant = new Constant(DataTypeManager.transformValue(strVal, escapeType), escapeType); } catch (TransformationException e) { {if (true) throw new ParseException(e.getMessage());} //$NON-NLS-1$ constant = new Constant(DataTypeManager.transformValue(strVal, escapeType), escapeType); } catch (TransformationException e) { {if (true) throw new ParseException(e.getMessage());} //$NON-NLS-1$
/** * This method transforms a value of the source type into a value * of the target type. * @param value Incoming value of source type * @return Outgoing value of target type * @throws TransformationException if value is an incorrect input type or * the transformation fails */ public Object transformDirect(Object value) throws TransformationException { try { return Short.valueOf(((String)value).trim()); } catch(NumberFormatException e) { throw new TransformationException(CorePlugin.Event.TEIID10071, CorePlugin.Util.gs(CorePlugin.Event.TEIID10071, value)); } }
constant = new Constant(DataTypeManager.transformValue(strVal, escapeType), escapeType); } catch (TransformationException e) { {if (true) throw new ParseException(e.getMessage());} //$NON-NLS-1$ constant = new Constant(DataTypeManager.transformValue(strVal, escapeType), escapeType); } catch (TransformationException e) { {if (true) throw new ParseException(e.getMessage());} //$NON-NLS-1$
/** * This method transforms a value of the source type into a value * of the target type. * @param value Incoming value of source type * @return Outgoing value of target type * @throws TransformationException if value is an incorrect input type or * the transformation fails */ public Object transformDirect(Object value) throws TransformationException { try { return Integer.valueOf(((String)value).trim()); } catch(NumberFormatException e) { throw new TransformationException(CorePlugin.Event.TEIID10072, CorePlugin.Util.gs(CorePlugin.Event.TEIID10072, value)); } }
constant = new Constant(DataTypeManager.transformValue(strVal, escapeType), escapeType); } catch (TransformationException e) { {if (true) throw new ParseException(e.getMessage());} //$NON-NLS-1$ constant = new Constant(DataTypeManager.transformValue(strVal, escapeType), escapeType); } catch (TransformationException e) { {if (true) throw new ParseException(e.getMessage());} //$NON-NLS-1$
/** * This method transforms a value of the source type into a value * of the target type. * @param value Incoming value of source type * @return Outgoing value of target type * @throws TransformationException if value is an incorrect input type or * the transformation fails */ public Object transformDirect(Object value) throws TransformationException { try { return Float.valueOf((String)value); } catch(NumberFormatException e) { throw new TransformationException(CorePlugin.Event.TEIID10077, CorePlugin.Util.gs(CorePlugin.Event.TEIID10077, value)); } }
/** * This method transforms a value of the source type into a value * of the target type. * @param value Incoming value of source type * @return Outgoing value of target type * @throws TransformationException if value is an incorrect input type or * the transformation fails */ public Object transformDirect(Object value) throws TransformationException { try { return Long.valueOf(((String)value).trim()); } catch(NumberFormatException e) { throw new TransformationException(CorePlugin.Event.TEIID10073, CorePlugin.Util.gs(CorePlugin.Event.TEIID10073, value)); } }
/** * This method transforms a value of the source type into a value * of the target type. * @param value Incoming value of source type * @return Outgoing value of target type * @throws TransformationException if value is an incorrect input type or * the transformation fails */ public Object transformDirect(Object value) throws TransformationException { try { return Byte.valueOf(((String)value).trim()); } catch(NumberFormatException e) { throw new TransformationException(CorePlugin.Event.TEIID10074, CorePlugin.Util.gs(CorePlugin.Event.TEIID10074, value)); } }
/** * This method transforms a value of the source type into a value * of the target type. * @param value Incoming value of source type * @return Outgoing value of target type * @throws TransformationException if value is an incorrect input type or * the transformation fails */ public Object transformDirect(Object value) throws TransformationException { try { return new BigDecimal(((String)value).trim()); } catch(NumberFormatException e) { throw new TransformationException(CorePlugin.Event.TEIID10063, CorePlugin.Util.gs(CorePlugin.Event.TEIID10063, value)); } }
/** * This method transforms a value of the source type into a value * of the target type. * @param value Incoming value of source type * @return Outgoing value of target type * @throws TransformationException if value is an incorrect input type or * the transformation fails */ public Object transformDirect(Object value) throws TransformationException { try { return Short.valueOf(((String)value).trim()); } catch(NumberFormatException e) { throw new TransformationException(CorePlugin.Event.TEIID10071, CorePlugin.Util.gs(CorePlugin.Event.TEIID10071, value)); } }
/** * This method transforms a value of the source type into a value * of the target type. * @param value Incoming value of source type * @return Outgoing value of target type * @throws TransformationException if value is an incorrect input type or * the transformation fails */ public Object transformDirect(Object value) throws TransformationException { try { return Integer.valueOf(((String)value).trim()); } catch(NumberFormatException e) { throw new TransformationException(CorePlugin.Event.TEIID10072, CorePlugin.Util.gs(CorePlugin.Event.TEIID10072, value)); } }
/** * This method transforms a value of the source type into a value * of the target type. * @param value Incoming value of source type * @return Outgoing value of target type * @throws TransformationException if value is an incorrect input type or * the transformation fails */ public Object transformDirect(Object value) throws TransformationException { try { return Byte.valueOf(((String)value).trim()); } catch(NumberFormatException e) { throw new TransformationException(CorePlugin.Event.TEIID10074, CorePlugin.Util.gs(CorePlugin.Event.TEIID10074, value)); } }
/** * This method transforms a value of the source type into a value * of the target type. * @param value Incoming value of source type * @return Outgoing value of target type * @throws TransformationException if value is an incorrect input type or * the transformation fails */ public Object transformDirect(Object value) throws TransformationException { try { return new BigDecimal(((String)value).trim()); } catch(NumberFormatException e) { throw new TransformationException(CorePlugin.Event.TEIID10063, CorePlugin.Util.gs(CorePlugin.Event.TEIID10063, value)); } }
/** * This method transforms a value of the source type into a value * of the target type. * @param value Incoming value of source type * @return Outgoing value of target type * @throws TransformationException if value is an incorrect input type or * the transformation fails */ public Object transformDirect(Object value) throws TransformationException { try { return Long.valueOf(((String)value).trim()); } catch(NumberFormatException e) { throw new TransformationException(CorePlugin.Event.TEIID10073, CorePlugin.Util.gs(CorePlugin.Event.TEIID10073, value)); } }
/** * This method transforms a value of the source type into a value * of the target type. * @param value Incoming value of source type * @return Outgoing value of target type * @throws TransformationException if value is an incorrect input type or * the transformation fails */ public Object transformDirect(Object value) throws TransformationException { try { return Double.valueOf((String)value); } catch(NumberFormatException e) { throw new TransformationException(CorePlugin.Event.TEIID10078, CorePlugin.Util.gs(CorePlugin.Event.TEIID10078, value)); } }
/** * This method transforms a value of the source type into a value * of the target type. * @param value Incoming value of source type * @return Outgoing value of target type * @throws TransformationException if value is an incorrect input type or * the transformation fails */ public Object transformDirect(Object value) throws TransformationException { try { return Float.valueOf((String)value); } catch(NumberFormatException e) { throw new TransformationException(CorePlugin.Event.TEIID10077, CorePlugin.Util.gs(CorePlugin.Event.TEIID10077, value)); } }