Examples of Converter


Examples of org.cruxframework.crux.core.client.converter.TypeConverter.Converter

      for (String converterClassName : converterNames)
      {
        try
        {
          Class<?> converterClass = Class.forName(converterClassName);
          Converter annot = converterClass.getAnnotation(Converter.class);
          if (converters.containsKey(annot.value()))
          {
            throw new CruxGeneratorException("Duplicated Converter found: ["+annot.value()+"].");
          }
         
          converters.put(annot.value(), converterClass.getCanonicalName());
        }
        catch (ClassNotFoundException e)
        {
          logger.error("Error initializing Converters ["+converterClassName+"].",e);
        }
View Full Code Here

Examples of org.directwebremoting.extend.Converter

    }


    private Converter getConverter()
    {
        Converter converter = provider.get();
        if (calledSetConverterManager.compareAndSet(false, true))
        {
            converter.setConverterManager(converterManager);
        }
        return converter;
    }
View Full Code Here

Examples of org.eclipse.core.databinding.conversion.Converter

   
    //do the binding
    return dataBindingContext.bindValue(
        observedView.getValue(),
        observedValue,
        new UpdateValueStrategy().setConverter(new Converter(IMethod.class, String.class) {
         
          public Object convert(Object fromObject) {
            IField field = (IField)fromObject;
            String value = null;
           
View Full Code Here

Examples of org.eclipse.persistence.mappings.converters.Converter

            return;
        }
        // convert the value - if necessary
        Object objectValue = unmarshalRecord.getChildRecord().getCurrentObject();
        if (xmlCompositeCollectionMapping.hasConverter()) {
            Converter converter = xmlCompositeCollectionMapping.getConverter();
            if (converter instanceof XMLConverter) {
                objectValue = ((XMLConverter)converter).convertDataValueToObjectValue(objectValue, unmarshalRecord.getSession(), unmarshalRecord.getUnmarshaller());
            } else {
                objectValue = converter.convertObjectValueToDataValue(objectValue, unmarshalRecord.getSession());
            }
        }
        unmarshalRecord.addAttributeValue(this, objectValue, collection);
       
        if(xmlCompositeCollectionMapping.getContainerAccessor() != null) {
View Full Code Here

Examples of org.geotools.util.Converter

        }
       
        public Object convertToObject(String value, Locale locale) {
            for ( ConverterFactory factory : factories ) {
                try {
                    Converter converter = factory.createConverter( String.class, target, null );
                    if ( converter != null ) {
                        Object converted = converter.convert( value, target );
                        if ( converted != null ) {
                            return converted;
                        }
                    }
                }
View Full Code Here

Examples of org.graylog2.plugin.inputs.Converter

*/
public class NumericConverterTest {

    @Test
    public void testConvert() throws Exception {
        Converter hc = new NumericConverter(new HashMap<String, Object>());

        assertNull(hc.convert(null));
        assertEquals("", hc.convert(""));
        assertEquals("lol no number", hc.convert("lol no number"));
        assertEquals(9001, hc.convert("9001"));
        assertEquals(2147483648L, hc.convert("2147483648"));
        assertEquals(10.4D, hc.convert("10.4"));
        assertEquals(Integer.class, hc.convert("4").getClass());
    }
View Full Code Here

Examples of org.infinispan.filter.Converter

            return new IteratorAsCloseableIterator<>(initialValues.iterator());
         }
      });

      KeyValueFilter filter = mock(KeyValueFilter.class, withSettings().serializable());
      Converter converter = mock(Converter.class, withSettings().serializable());
      n.addListener(listener, filter, converter);
      verifyEvents(isClustered(listener), listener, initialValues);

      verify(filter, never()).accept(anyObject(), anyObject(), any(Metadata.class));
      verify(converter, never()).convert(anyObject(), anyObject(), any(Metadata.class));
View Full Code Here

Examples of org.jboss.as.clustering.controller.transform.SimpleAttributeConverter.Converter

                public String getRejectedMessage(Set<String> attributes) {
                    return InfinispanLogger.ROOT_LOGGER.indeterminiteStack();
                }
            };
            // Lookup the stack via the jgroups channel resource, if necessary
            Converter stackConverter = new Converter() {
                @Override
                public void convert(PathAddress address, String name, ModelNode value, ModelNode model, TransformationContext context) {
                    if (!value.isDefined()) {
                        PathAddress rootAddress = address.subAddress(0, address.size() - 3);
                        PathAddress subsystemAddress = rootAddress.append(JGroupsSubsystemResourceDefinition.PATH);
View Full Code Here

Examples of org.jboss.errai.databinding.client.api.Converter

  private <P> void updateWidgetsAndFireEvent(final String property, final P oldValue, final P newValue,
      final Widget excluding) {

    for (Binding binding : bindings.get(property)) {
      Widget widget = binding.getWidget();
      Converter converter = binding.getConverter();

      if (widget == excluding)
        continue;

      if (widget instanceof HasValue) {
View Full Code Here

Examples of org.jboss.forge.addon.convert.Converter

            if (input instanceof SelectComponent)
            {
               result.append(" Valid choices: [");
               Iterable<?> valueChoices = ((SelectComponent) input).getValueChoices();
               Converter itemLabelConverter = ((SelectComponent) input).getItemLabelConverter();
               for (Object choice : valueChoices)
               {
                  if (choice != null)
                  {
                     Object itemLabel = choice.toString();
                     if (itemLabelConverter != null)
                        itemLabel = itemLabelConverter.convert(choice);
                     result.append("\"" + itemLabel + "\" ");
                  }
               }
               result.append("] ");

               if (input.hasDefaultValue() && input.hasValue())
               {
                  result.append(" defaults to: [");
                  if (input instanceof ManyValued)
                  {
                     Iterable values = ((ManyValued) input).getValue();
                     if (values.iterator().hasNext())
                     {
                        for (Object value : values)
                        {
                           if (value != null)
                           {
                              Object itemLabel = value.toString();
                              if (itemLabelConverter != null)
                                 itemLabel = itemLabelConverter.convert(value);
                              result.append("\"" + itemLabel + "\" ");
                           }
                        }
                     }
                     else
                     {
                        Object value = input.getValue();
                        if (value != null)
                        {
                           Object itemLabel = value.toString();
                           if (itemLabelConverter != null)
                              itemLabel = itemLabelConverter.convert(value);
                           result.append("\"" + itemLabel + "\" ");
                        }
                     }
                  }
                  result.append("]");
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.