Examples of Converter


Examples of com.sun.syndication.feed.synd.Converter

        this(SyndFeed.class, IGNORE_PROPERTIES);

        if (feed != null) {
            _feedType = feed.getFeedType();

            Converter converter = CONVERTERS.getConverter(_feedType);

            if (converter == null) {
                throw new IllegalArgumentException("Invalid feed type [" + _feedType + "]");
            }

            converter.copyInto(feed, this);
        }
    }
View Full Code Here

Examples of com.tacitknowledge.flip.aspectj.converters.Converter

                return getUntouchedDisabledValue(outputClass, value);
            }
           
            return evaluator.evaluate(context, m.group(1));
        } else {
            Converter converter = getConvertersHandler().getConverter(outputClass);
            if (converter == null) {
                return getUntouchedDisabledValue(outputClass, value);
            }
           
            return converter.convert(value, outputClass);
        }
    }
View Full Code Here

Examples of com.thoughtworks.xstream.converters.Converter

        private AssociatedConverterImpl(XStream xstream) {
            this.xstream = xstream;
        }

        private Converter findConverter(Class<?> t) {
            Converter result = cache.get(t);
            if (result != null)
                // ConcurrentHashMap does not allow null, so use this object to represent null
                return result == this ? null : result;
            try {
                if(t==null || t.getClassLoader()==null)
View Full Code Here

Examples of com.totsp.gwittir.client.beans.Converter

        images.getChildren()
              .add(
            new Binding(
                box, "value",
                new Converter() {
                public Object convert(Object original) {
                    if (original == null) {
                        return original;
                    } else {
                        return original.toString()
                                       .split(",");
                    }
                }
            }, search, "tags",
                new Converter() {
                public Object convert(Object original) {
                    if (original == null) {
                        return original;
                    } else {
                        String[] strings = (String[]) original;
View Full Code Here

Examples of com.vaadin.data.util.converter.Converter

        tf.setPropertyDataSource(new MethodProperty<Number>(nb, "number"));
        assertEquals(490, tf.getPropertyDataSource().getValue());
        assertEquals("490", tf.getValue());

        Converter c1 = tf.getConverter();

        tf.setPropertyDataSource(new MethodProperty<Number>(nb, "number"));
        Converter c2 = tf.getConverter();
        assertTrue(
                "StringToInteger converter is ok for integer types and should stay even though property is changed",
                c1 == c2);
        assertEquals(490, tf.getPropertyDataSource().getValue());
        assertEquals("490", tf.getValue());
View Full Code Here

Examples of com.xuggle.xuggler.Converter

  }
 
  @Test
  public void testDefineOptions()
  {
    converter = new Converter();
   
    Options options = converter.defineOptions();
   
    assertTrue("no options", options != null);
  }
View Full Code Here

Examples of converter.Converter

            Object objref = myEnv.lookup("ejb/SimpleConverter");

            ConverterHome home = (ConverterHome) PortableRemoteObject.narrow(objref,
                    ConverterHome.class);

            Converter currencyConverter = home.create();

            BigDecimal param = new BigDecimal("100.00");
            BigDecimal amount = currencyConverter.dollarToYen(param);

            System.out.println(amount);
            amount = currencyConverter.yenToEuro(param);
            System.out.println(amount);

            System.exit(0);

        } catch (Exception ex) {
View Full Code Here

Examples of cookxml.core.interfaces.Converter

      }

      if (value instanceof String)
      {
        Class targetClass = m_field.getType ();
        Converter converter = decodeEngine.getCookXml ().getTagLibrary ().getConverter (ns, targetClass);
        if (converter != null)
          value = converter.convert ((String)value, decodeEngine);
      }

      m_field.set (obj, value);
      if (!m_access)
      {
View Full Code Here

Examples of cucumber.deps.com.thoughtworks.xstream.converters.Converter

                Class clazz = (Class) type;
                if (clazz.isEnum()) {
                    return new EnumConverter(locale, clazz);
                }
                ConverterLookup converterLookup = getConverterLookup();
                Converter converter = converterLookup.lookupConverterForType((Class) type);
                return converter instanceof SingleValueConverter ? (SingleValueConverter) converter : null;
            } else {
                return null;
            }
        }
View Full Code Here

Examples of de.ddb.conversion.Converter

    final static Format B = new Format("B");

    public void testGetConverter() throws ConverterException {
        ConverterRegistry registry = new ConverterRegistry();

        Converter anyEncConverter = new GenericConverter(){
         
          // A, B, null, null
          {
            getConverterContext().setSourceFormat(A);
            getConverterContext().setTargetFormat(B);
            getConverterContext().setSourceEncoding(null);
            getConverterContext().setTargetEncoding(null);
          }

      public void convert(InputStream in, OutputStream out,
          ConversionParameters params) throws ConverterException,
          IOException
      {
        // TODO Auto-generated method stub
       
      }

      public void convert(Reader in, Writer out,
          ConversionParameters params) throws ConverterException,
          IOException
      {
        // TODO Auto-generated method stub
       
      }
         
        };
       
        Converter anySourceEncConverter = new GenericConverter(){
         
//          A, B, null, "UTF-8"
          {
            getConverterContext().setSourceFormat(A);
            getConverterContext().setTargetFormat(B);
            getConverterContext().setSourceEncoding(null);
            getConverterContext().setTargetEncoding("UTF-8");
          }

      public void convert(InputStream in, OutputStream out,
          ConversionParameters params) throws ConverterException,
          IOException
      {
        // TODO Auto-generated method stub
       
      }

      public void convert(Reader in, Writer out,
          ConversionParameters params) throws ConverterException,
          IOException
      {
        // TODO Auto-generated method stub
       
      }
         
        };
        Converter anyTargetEncConverter = new GenericConverter(){
         
//          A, B, "UTF-8", null
          {
            getConverterContext().setSourceFormat(A);
            getConverterContext().setTargetFormat(B);
            getConverterContext().setSourceEncoding("UTF-8");
            getConverterContext().setTargetEncoding(null);
          }

      public void convert(InputStream in, OutputStream out,
          ConversionParameters params) throws ConverterException,
          IOException
      {
        // TODO Auto-generated method stub
       
      }

      public void convert(Reader in, Writer out,
          ConversionParameters params) throws ConverterException,
          IOException
      {
        // TODO Auto-generated method stub
       
      }
         
        };
        Converter specifiedEncConverter = new GenericConverter(){
         
//          A, B, "UTF-8", "UTF-8"
          {
            getConverterContext().setSourceFormat(A);
            getConverterContext().setTargetFormat(B);
            getConverterContext().setSourceEncoding("UTF-8");
            getConverterContext().setTargetEncoding("UTF-8");
          }

      public void convert(InputStream in, OutputStream out,
          ConversionParameters params) throws ConverterException,
          IOException
      {
        // TODO Auto-generated method stub
       
      }

      public void convert(Reader in, Writer out,
          ConversionParameters params) throws ConverterException,
          IOException
      {
        // TODO Auto-generated method stub
       
      }
         
        };

        registry.addConverter(anySourceEncConverter);
        registry.addConverter(anyTargetEncConverter);
        registry.addConverter(specifiedEncConverter);

        Converter returnedConverter;

        returnedConverter = registry.getConverter(A.getName(), B.getName(),
                "egal", "UTF-8");
        assertTrue(anySourceEncConverter == returnedConverter);
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.