Examples of Converter


Examples of org.apache.myfaces.config.impl.digester.elements.Converter

                    //the entry there takes precedence
                    boolean hasForClass = !Object.class.equals(conv.forClass());
                    boolean hasValue = conv.value().length() > 0;
                    if (hasForClass || hasValue)
                    {
                        Converter converter = new Converter();
                        if (hasForClass)
                        {
                            converter.setForClass(conv.forClass().getName());
                        }
                        if (hasValue)
                        {
                            converter.setConverterId(conv.value());
                        }
                        converter.setConverterClass(clazz.getName());
                        facesConfig.addConverter(converter);
                    }
                    else
                    {
                        // TODO MartinKoci MYFACES-3053
View Full Code Here

Examples of org.apache.myfaces.tobago.apt.annotation.Converter

      applyNamespace(element, namespace);
    }
  }

  private void addConverter(ClassDeclaration decl, List<Element> newConverters, Namespace namespace) {
    Converter converterAnn = decl.getAnnotation(Converter.class);
    Element converter = new Element(CONVERTER, namespace);
    if (converterAnn.id().length() > 0) {
      Element converterId = new Element(CONVERTER_ID, namespace);
      converterId.setText(converterAnn.id());
      converter.addContent(converterId);
    } else if (converterAnn.forClass().length() > 0) {
      Element converterForClass = new Element(CONVERTER_FOR_CLASS, namespace);
      converterForClass.setText(converterAnn.forClass());
      converter.addContent(converterForClass);
    }

    Element converterClass = new Element(CONVERTER_CLASS, namespace);
    converterClass.setText(decl.getQualifiedName());
View Full Code Here

Examples of org.apache.shindig.gadgets.rewrite.OsTemplateXmlLoaderRewriter.Converter

  public void setUp() {
    Injector injector = Guice.createInjector(new ParseModule(), new PropertiesModule());
    parser = injector.getInstance(GadgetHtmlParser.class);
    domImpl = injector.getInstance(DOMImplementation.class);
    doc = domImpl.createDocument(null, null, null);
    converter = new Converter(parser, domImpl);
  }
View Full Code Here

Examples of org.apache.struts2.util.IteratorGenerator.Converter

                }
            }
        }

        // converter
        Converter converter = null;
        if (converterAttr != null && converterAttr.length() > 0) {
            converter = (Converter) findValue(converterAttr);
        }

View Full Code Here

Examples of org.apache.tuscany.das.rdb.Converter

                   
                 if(null == converters[i - 1] )  
                 try{  
                   
                   
                    Converter convInstance = (Converter) Class.forName(
                            converter).newInstance();
                    converters[i - 1] = convInstance;
                } catch (Exception ex) {
                    throw new RuntimeException(ex);
                }
View Full Code Here

Examples of org.araneaframework.uilib.list.util.Converter

  protected void readBeanField(ResultSet resultSet, Object bean, String field)
  throws SQLException {
   
    String resultSetColumnName = (String) this.beanToResultSetMapping
    .get(field);
    Converter deconverter = (Converter) this.beanDeconverters.get(field);
   
    log.debug("Reading VO field '" + field + "' from ResultSet column '"
        + resultSetColumnName + "'.");
   
    Class valueType;
    if (deconverter != null) {
      valueType = deconverter.getDestinationType();
    } else {
      valueType = this.beanMapper.getBeanFieldType(field);
    }
   
    Object value = this.resultSetReader.readFromResultSet(
        resultSetColumnName, resultSet, valueType);
    if (deconverter != null) {
      value = deconverter.reverseConvert(value);
    }
    this.beanMapper.setBeanFieldValue(bean, field, value);
   
    log.debug("Read VO field '" + field + "' from ResultSet column '"
        + resultSetColumnName + "' with value '" + value + "'.");
View Full Code Here

Examples of org.bifrost.xmlio.config.Converter

      }
    }
   
   
    // We've got the type, figure out what converter to use
    Converter converter = pmap.getConverter();
    if (converter == null)
      converter = config.getConverter(paramClassName);
//    else
//    {
//      if (!pmap.getPropertyType().equals(paramClassName))
//      {
//        pmap.setPropertyType(paramClass);
//        converter = config.getConverter(paramClassName);
//        pmap.setConverter(converter);
//      }
//    }

    // If no converter is found, make sure we are not processing a text
    // node, we must be processing a subtag (an object).
    if (converter == null)
    {
      if (value instanceof java.lang.String)
      {
        logger.info("Warning, processing text but no converter found for "
            + paramClassName);
        return;
      }
    }

    // Found a setter so now lets make sure the attribute value is of the
    // correct type and then call the setter.
    Object[] params = null;
    if (value != null && paramClassName != null)
    { 
      params = new Object[1];
//      Converter converter = config.getConverter(paramClass);
      if (converter == null)
      {
        params[0] = value;
      }
      else
      {
        Object converterImpl = null;
       
        if (converter.getClass().getName().equals(converter.getClassname()))
          converterImpl = converter;
        else
        {
          ObjectFactory factory = config.getObjectFactory();
          converterImpl = factory.getInstance(converter.getClassname());
        }
        try
        {
          Class[] convTypes = new Class[1];
          convTypes[0] = value.getClass();
          Method parseMethod =
            converterImpl.getClass().getMethod(converter.getParseMethod(),
                convTypes);
          Object[] convParams = new Object[1];
          convParams[0] = value;
          params[0] = parseMethod.invoke(converterImpl, convParams);
        }
        catch(NoSuchMethodException nsme)
        {
          logger.info("No such method " + converter.getParseMethod());
        }
        catch (InvocationTargetException ite)
        {
          logger.info("Called method threw an exception.");
        }
View Full Code Here

Examples of org.cishell.service.conversion.Converter

    ServiceReference fileSaverServiceReference =
      this.bundleContext.getServiceReference(FileSaverService.class.getName());
    FileSaverService fileSaver =
      (FileSaverService) this.bundleContext.getService(fileSaverServiceReference);

    Converter converter =
      fileSaver.promptForConverter(datum, FileSaverService.ANY_FILE_EXTENSION);

    return converter.convert(datum);
  }
View Full Code Here

Examples of org.cishell.testing.convertertester.core.converter.graph.Converter

    //assign fault scores to each converter
   
    Map convToFaultScore = new HashMap();
   
    for (int ii = 0; ii < involvedCs.length; ii++) {
      Converter involvedC = (Converter) involvedCs[ii];
     
      Float oldFaultScore = (Float) convToFaultScore.get(involvedC);
      Float newFaultScore;
      if (oldFaultScore == null) {
        //first occurrence of this converter
       
        newFaultScore = DEFAULT_FAULT_SCORE;
        if (isConvThatFailed(involvedC, failFP)) {
          newFaultScore = new Float(newFaultScore.floatValue() *
              FAILED_CONV_PENALTY);
        }
       
      } else {
        //converter has occurred before
       
        newFaultScore = new Float(oldFaultScore.floatValue() +
            DEFAULT_FAULT_SCORE.floatValue() * REPEAT_PENALTY);
      }
     
      convToFaultScore.put(involvedC, newFaultScore);
 
    }
   

   
    //reduce fault scores of trusted converters
   
    float faultScoresTotal = 0.0f;
   
    Set convs = convToFaultScore.keySet();
    Iterator convIter = convs.iterator();
    while (convIter.hasNext()) {
      Converter convInvolved = (Converter) convIter.next();
      Float convFaultScore =
        (Float) convToFaultScore.get(convInvolved);
     
      if (trustedCList.contains(convInvolved)) {
        convFaultScore = new Float(convFaultScore.floatValue() *
            TRUSTED_CONV_PENALTY_REDUCTION);
      }
     
      convToFaultScore.put(convInvolved, convFaultScore);
      faultScoresTotal += convFaultScore.floatValue();
    }
   
    List resultCAFList = new ArrayList();
   
   
    //return chance each converter is at fault, based on fault scores.
   
    for (int ii = 0; ii < involvedCs.length; ii++) {
      Converter involvedC = involvedCs[ii];
     
      Float faultScore = (Float) convToFaultScore.get(involvedC);
     
      float normalizedFaultScore;
      if (faultScoresTotal != 0.0f) {
View Full Code Here

Examples of org.compass.core.converter.Converter

        // register custom converters
        Map converters = new HashMap();
        Map context = new HashMap();
        context.put("customConverters", converters);

        Converter converter = new StringMapConverter();
        configuration.registerConverter(StringMapConverter.CONVERTER_NAME, converter);
        converters.put(StringMapConverter.CONVERTER_NAME, converter);

        // register analyzers used internally
        configuration.getSettings().setSetting("compass.engine.analyzer.searchableplugin_whitespace.type", "whitespace");
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.