Examples of convert()


Examples of org.saiku.web.svg.Converter.convert()

      if (StringUtils.isBlank(svg)) {
        throw new Exception("Missing 'svg' parameter");
      }
      final InputStream in = new ByteArrayInputStream(svg.getBytes("UTF-8"));
      final ByteArrayOutputStream out = new ByteArrayOutputStream();
      converter.convert(in, out, size);
      out.flush();
      byte[] doc = out.toByteArray();
      return Response.ok(doc).type(converter.getContentType()).header(
          "content-disposition",
          "attachment; filename = chart." + converter.getExtension()).header(
View Full Code Here

Examples of org.slf4j.migrator.InplaceFileConverter.convert()

  }

 
  public void XtestNOP() throws IOException {
    InplaceFileConverter fc = new InplaceFileConverter(new EmptyRuleSet(), new NopProgressListener());
    fc.convert(new File("c:/varargs.txt"));
  }
}
View Full Code Here

Examples of org.sonatype.nexus.capability.CapabilityDescriptor.convert()

    final Map<String, String> newProps = Maps.newHashMap();
    oldProps.put("p1", "v1-converted");
    oldProps.put("p3", "v3");

    when(descriptor.convert(oldProps, 0)).thenReturn(newProps);

    underTest.load();

    verify(capabilityStorage).getAll();
    verify(descriptor, atLeastOnce()).version();
View Full Code Here

Examples of org.sonatype.nexus.client.rest.jersey.JerseyNexusClient.convert()

                  + (useDeleteFlag ? "?delete" : "")
          )
          .put(target);
    }
    catch (UniformInterfaceException e) {
      throw jerseyNexusClient.convert(e);
    }
    catch (ClientHandlerException e) {
      throw jerseyNexusClient.convert(e);
    }
  }
View Full Code Here

Examples of org.spout.api.protocol.reposition.RepositionManager.convert()

    if (ping != null) {
      ping.refresh();
    }

    final Point rawPosition = new Point(message.getPosition(), holder.getWorld());
    final Point newPosition = rmInverse.convert(rawPosition);
    final Point position = holder.getPhysics().getPosition();

    if (!(holder.getNetwork() instanceof VanillaPlayerNetworkComponent)) {
      throw new IllegalStateException("Using Vanilla Protocol without using VanillaNetworkSynchronizer");
    }
View Full Code Here

Examples of org.springframework.core.convert.ConversionService.convert()

  @Override
  protected BaseResponseObject getBaseResponseObject(RpcMessage<?> rpcMessage) {
    MindRpcMessageHolder holder = (MindRpcMessageHolder) rpcMessage.getBody();
    ConversionService conversionService = getConversionService();
    if(conversionService != null) {
      return (BaseResponseObject) conversionService.convert(holder, BaseObject.class);
    }
    return null;
  }

}
View Full Code Here

Examples of org.springframework.core.convert.converter.GenericConverter.convert()

      if (converter == null) {
        Printer<?> printer = annotationFormatterFactory.getPrinter(converterKey.getAnnotation(), converterKey.getFieldType());
        converter = new PrinterConverter(fieldType, printer, FormattingConversionService.this);
        cachedPrinters.put(converterKey, converter);
      }
      return converter.convert(source, sourceType, targetType);
    }
   
    public String toString() {
      return "@" + annotationType.getName() + " " + fieldType.getName() + " -> " + String.class.getName() + ": " + annotationFormatterFactory;
    }
View Full Code Here

Examples of org.springframework.core.convert.support.DefaultConversionService.convert()

  @Test
  public void testWithConversionService() {
    ConversionService conversionService = new DefaultConversionService();
    assertTrue(conversionService.canConvert(String.class, MediaType.class));
    MediaType mediaType = MediaType.parseMediaType("application/xml");
    assertEquals(mediaType, conversionService.convert("application/xml", MediaType.class));
  }

  @Test
  public void isConcrete() {
    assertTrue("text/plain not concrete", MediaType.TEXT_PLAIN.isConcrete());
View Full Code Here

Examples of org.springframework.core.convert.support.GenericConversionService.convert()

    CustomConversions conversions = new CustomConversions(Arrays.asList(CustomDateTimeConverter.INSTANCE));
    GenericConversionService conversionService = new DefaultConversionService();
    conversions.registerConvertersIn(conversionService);

    assertThat(conversionService.convert(new DateTime(), Date.class), is(new Date(0)));
  }

  /**
   * @see DATAMONGO-1001
   */
 
View Full Code Here

Examples of org.springframework.core.serializer.support.DeserializingConverter.convert()

  @Test
  public void serializeAndDeserializeString() {
    SerializingConverter toBytes = new SerializingConverter();
    byte[] bytes = toBytes.convert("Testing");
    DeserializingConverter fromBytes = new DeserializingConverter();
    assertEquals("Testing", fromBytes.convert(bytes));
  }

  @Test
  public void nonSerializableObject() {
    SerializingConverter toBytes = new SerializingConverter();
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.