Examples of parseObject()


Examples of com.alibaba.fastjson.parser.DefaultExtJSONParser.parseObject()

public class DefaultExtJSONParserTest_1 extends TestCase {

    public void test_0() throws Exception {
        DefaultExtJSONParser parser = new DefaultExtJSONParser("{\"f1\":true}");
        TestEntity entity = parser.parseObject(TestEntity.class);
        Assert.assertEquals(true, entity.isF1());
    }

    public void test_1() throws Exception {
        DefaultExtJSONParser parser = new DefaultExtJSONParser("{\"f2\":true}");
View Full Code Here

Examples of com.alibaba.fastjson.parser.DefaultJSONParser.parseObject()

        for (Feature featrue : features) {
            featureValues = Feature.config(featureValues, featrue, true);
        }

        DefaultJSONParser parser = new DefaultJSONParser(input, ParserConfig.getGlobalInstance(), featureValues);
        T value = (T) parser.parseObject(clazz);

        handleResovleTask(parser, value);

        parser.close();
View Full Code Here

Examples of com.alibaba.fastjson.parser.DefaultJSONParser.parseObject()

        for (Feature featrue : features) {
            featureValues = Feature.config(featureValues, featrue, true);
        }

        DefaultJSONParser parser = new DefaultJSONParser(input, config, featureValues);
        T value = (T) parser.parseObject(clazz);

        handleResovleTask(parser, value);

        parser.close();
View Full Code Here

Examples of com.alibaba.fastjson.parser.DefaultJSONParser.parseObject()

        for (Feature featrue : features) {
            featureValues = Feature.config(featureValues, featrue, true);
        }

        DefaultJSONParser parser = new DefaultJSONParser(input, length, ParserConfig.getGlobalInstance(), featureValues);
        T value = (T) parser.parseObject(clazz);

        handleResovleTask(parser, value);

        parser.close();
View Full Code Here

Examples of com.alibaba.fastjson.parser.deserializer.DefaultObjectDeserializer.parseObject()

        Entity object = new Entity();
        DefaultObjectDeserializer objectDeser = new DefaultObjectDeserializer();
        Exception error = null;
        try {
        objectDeser.parseObject(parser, object);
        } catch (JSONException ex) {
            error = ex;
        }
        Assert.assertNotNull(error);
    }
View Full Code Here

Examples of com.dci.intellij.dbn.common.locale.Formatter.parseObject()

    protected void setParameterValue(CallableStatement callableStatement, int parameterIndex, DBDataType dataType, String stringValue) throws SQLException {
        try {
            Object value = null;
            if (StringUtil.isNotEmptyOrSpaces(stringValue))  {
                Formatter formatter = Formatter.getInstance(getProject());
                value = formatter.parseObject(dataType.getTypeClass(), stringValue);
                value = dataType.getNativeDataType().getDataTypeDefinition().convert(value);
            }
            dataType.setValueToPreparedStatement(callableStatement, parameterIndex, value);

        } catch (SQLException e) {
View Full Code Here

Examples of com.ibm.icu.text.MessageFormat.parseObject()

        }

        pp.setIndex(0);
        Object[] fmta;

        fmta = (Object[]) msg.parseObject( source, pp );
        if (pp.getIndex() == 0) {
            errln("*** MSG parse (ustring, Object, parsepos ) error.");
        } else {
            if (fmta.length != 2) {
                errln("*** MSG parse (ustring, count, err) count err.");
View Full Code Here

Examples of com.projity.datatype.RateFormat.parseObject()

    Rate rate = null;
    if (matcher.group(2) != null) { // if text was empty use default
      if (!getParameters().isAllowDetailsEntry())
        throw new ParseException(Messages.getString("Message.cannotEnterUnits"),0);
      RateFormat format = resource.getRateFormat();
      rate = (Rate) format.parseObject(matcher.group(2));
      percent = rate.getValue();
//      Number percentNumber;
//      if (resource.isLabor())
//        percentNumber = percentFormat.parse(matcher.group(2)+ Settings.PERCENT); // force a percent sign at the end for labor.  If there are two, it is ignored
//      else //TODO allow parsing values like 3/d for material resources
View Full Code Here

Examples of com.webobjects.foundation.NSNumberFormatter.parseObject()

        } else if (className.equals("java.lang.Number") || className.equals("java.math.BigDecimal")) {
            String numberFormatterString = formatterForKey(selectedKey());
            NSNumberFormatter numberFormatter = new NSNumberFormatter(numberFormatterString);
            Object objectValue = null;
            try {
                objectValue = numberFormatter.parseObject((value != null) ? value.toString() : "");
            } catch (ParseException e) {
                if (NSLog.debugLoggingAllowedForLevelAndGroups(NSLog.DebugLevelDetailed, NSLog.DebugGroupWebObjects)) {
                    NSLog.debug.appendln(e);
                }
            }
View Full Code Here

Examples of com.webobjects.foundation.NSTimestampFormatter.parseObject()

        if (className.equals("com.webobjects.foundation.NSTimestamp")) {
            String dateFormatterString = formatterForKey(selectedKey());
            NSTimestampFormatter dateFormatter = new NSTimestampFormatter(dateFormatterString);
            Object objectValue = null;
            try {
                objectValue = dateFormatter.parseObject((value != null) ? value.toString() : "");
            } catch (ParseException e) {
                if (NSLog.debugLoggingAllowedForLevelAndGroups(NSLog.DebugLevelDetailed, NSLog.DebugGroupWebObjects)) {
                    NSLog.debug.appendln(e);
                }
            }
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.