Examples of convertValue()


Examples of com.fasterxml.jackson.databind.ObjectMapper.convertValue()

   *            the new data
   */
  public final void setData(final Object data) {
    final ObjectMapper mapper = JOM.getInstance();
    error.put(DATA_S,
        data != null ? mapper.convertValue(data, JsonNode.class) : null);
  }
 
  /**
   * Gets the data.
   *
 
View Full Code Here

Examples of com.fasterxml.jackson.dataformat.xml.XmlMapper.convertValue()

        verifyIntArrayConversion(mapper, data, short[].class);
        verifyIntArrayConversion(mapper, data, long[].class);

        List<Number> expNums = _numberList(data, data.length);
        // Alas, due to type erasure, need to use TypeRef, not just class
        List<Integer> actNums = mapper.convertValue(data, new TypeReference<List<Integer>>() {});
        assertEquals(expNums, actNums);
    }

    public void testLongArrayToX() throws Exception
    {
View Full Code Here

Examples of com.opensymphony.xwork2.conversion.TypeConverter.convertValue()

    private Object doConvertToCollection(Map<String, Object> context, Object o, Member member, String prop, Object value, Class toType) {
        TypeConverter converter = container.getInstance(CollectionConverter.class);
        if (converter == null) {
            throw new XWorkException("TypeConverter with name [#0] must be registered first!", XWorkConstants.COLLECTION_CONVERTER);
        }
        return converter.convertValue(context, o, member, prop, value, toType);
    }

    private Object doConvertToArray(Map<String, Object> context, Object o, Member member, String prop, Object value, Class toType) {
        TypeConverter converter = container.getInstance(ArrayConverter.class);
        if (converter == null) {
View Full Code Here

Examples of com.opensymphony.xwork2.conversion.impl.XWorkConverter.convertValue()

                }
            }
        }

        XWorkConverter conv = ((Container)stack.getContext().get(ActionContext.CONTAINER)).getInstance(XWorkConverter.class);
        return conv.convertValue(stack.getContext(), result, asType);
    }

    /**
     * Returns a set from comma delimted Strings.
     * @param s The String to parse.
View Full Code Here

Examples of io.druid.jackson.DefaultObjectMapper.convertValue()

        "type", "and",
        "havingSpecs", ImmutableList.of(greaterMap, orMap)
    );

    ObjectMapper mapper = new DefaultObjectMapper();
    assertEquals(andHavingSpec,  mapper.convertValue(payloadMap, AndHavingSpec.class));
  }

  @Test
  public void testGreaterThanHavingSpec() {
    GreaterThanHavingSpec spec = new GreaterThanHavingSpec("metric", 10.003);
View Full Code Here

Examples of nexj.core.meta.integration.PrimitiveMessagePart.convertValue()

         Object datum = sRawRecordArray[i];
         FixedMessagePartMapping mapping = (FixedMessagePartMapping)fieldPart.getMapping();

         if (mapping.getFormat() == null)
         {
            datum = fieldPart.convertValue(datum);
         }
         else
         {
            if (m_primitiveFormatter == null)
            {
View Full Code Here

Examples of ognl.TypeConverter.convertValue()

        // Training

        // Since we have no idea what OGNL will stuff into that Map parameter,
        // we just ignore it.
        tc.convertValue(null, f, m, "value", d, String.class);
        tcc.setMatcher(new NullMeansIgnoreMatcher());

        tcc.setReturnValue("FROM-TYPE-CONVERTER");

        replayControls();
View Full Code Here

Examples of org.apache.commons.modeler.Registry.convertValue()

            // XXX convert value, use meta data to find type
             if( objValue==null && valueRef != null ) {
                 objValue=project.getReference(valueRef);
             }
             if( objValue==null ) {
                 objValue=registry.convertValue(type, value);

             }
            if( log.isDebugEnabled())
                log.debug("Setting " + oname + " " + attribute + " " +
                        objValue);
View Full Code Here

Examples of org.apache.hcatalog.mapreduce.HCatOutputStorageDriver.convertValue()

    HCatOutputStorageDriver osd = new RCFileOutputDriver();

    osd.setSchema(jc, schema);
    osd.initialize(jc, new Properties());

    BytesRefArrayWritable bytesWritableOutput = (BytesRefArrayWritable) osd.convertValue(record);

    assertTrue(bytesWritableOutput.compareTo(bytesWritable) == 0);
  }

  private byte[][] buildBytesArray() throws UnsupportedEncodingException {
View Full Code Here

Examples of org.apache.hcatalog.rcfile.RCFileOutputDriver.convertValue()

    HCatOutputStorageDriver osd = new RCFileOutputDriver();

    osd.setSchema(jc, schema);
    osd.initialize(jc, new Properties());

    BytesRefArrayWritable bytesWritableOutput = (BytesRefArrayWritable) osd.convertValue(record);

    assertTrue(bytesWritableOutput.compareTo(bytesWritable) == 0);
  }

  private byte[][] buildBytesArray() throws UnsupportedEncodingException {
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.