Examples of config()


Examples of br.com.caelum.vraptor.serialization.DeserializerConfig.config()

   
          deserializee.setWithoutRoot(isWithoutRoot(parameterNames, root));
         
          for(Class<? extends DeserializerConfig> option: method.getMethod().getAnnotation(Consumes.class).options()) {
            DeserializerConfig config = container.instanceFor(option);
            config.config(deserializee);
          }
         
          for (int i = 0; i < types.length; i++) {
            Parameter parameter = parameterNames[i];
            JsonElement node = root.get(parameter.getName());
View Full Code Here

Examples of co.cask.cdap.internal.app.deploy.InMemoryConfigurator.config()

   * @param archive Location of archive.
   */
  @Override
  public void process(Location archive) throws Exception {
    InMemoryConfigurator inMemoryConfigurator = new InMemoryConfigurator(id, archive);
    ListenableFuture<ConfigResponse> result = inMemoryConfigurator.config();
    //TODO: Check with Terence on how to handle this stuff.
    ConfigResponse response = result.get(120, TimeUnit.SECONDS);
    ApplicationSpecification specification = adapter.fromJson(response.get());
    if (appId != null) {
      specification = new ForwardingApplicationSpecification(specification) {
View Full Code Here

Examples of com.alibaba.fastjson.JSONReader.config()

import com.alibaba.fastjson.parser.Feature;

public class JSONReaderTest_0 extends TestCase {
  public void test_read() throws Exception {
    JSONReader reader = new JSONReader(new StringReader("{}"));
    reader.config(Feature.AllowArbitraryCommas, true);
   
    JSONObject object = (JSONObject) reader.readObject();
    Assert.assertNotNull(object);
   
    reader.close();
View Full Code Here

Examples of com.alibaba.fastjson.JSONWriter.config()

public class JSONWriterTest_2 extends TestCase {

    public void test_writer() throws Exception {
        StringWriter out = new StringWriter();
        JSONWriter writer = new JSONWriter(out);
        writer.config(SerializerFeature.UseSingleQuotes, true);
        writer.startObject();
        writer.writeObject("a");
        writer.writeObject("1");
       
        writer.writeObject("b");
View Full Code Here

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

        Assert.assertEquals("[1, 2, 3]", list.toString());
    }

    public void test_1() throws Exception {
        DefaultExtJSONParser parser = new DefaultExtJSONParser("[1,2,3]");
        parser.config(Feature.AllowArbitraryCommas, true);
        List list = new ArrayList();
        parser.parseArray(int.class, list);
        Assert.assertEquals("[1, 2, 3]", list.toString());
    }
View Full Code Here

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

public class DefaultJSONParserTest extends TestCase {

  public void test_double() {
    DefaultJSONParser parser = new DefaultJSONParser("3.4");
    parser.config(Feature.UseBigDecimal, false);
    Assert.assertEquals("3.4", parser.getInput());
    Assert.assertEquals(false, parser.isEnabled(Feature.UseBigDecimal));
    Object result = parser.parse();
    Assert.assertEquals(3.4D, result);
  }
View Full Code Here

Examples of com.alibaba.fastjson.parser.JSONScanner.config()

        Assert.assertEquals(false, new JSONScanner("2000-02-10T00:00:00.00a").scanISO8601DateIfMatch());
    }

    public void test_2() throws Exception {
        JSONScanner lexer = new JSONScanner("2000-02-10T00:00:00.000");
        lexer.config(Feature.AllowISO8601DateFormat, true);
        Assert.assertEquals(true, lexer.scanISO8601DateIfMatch());
        Assert.assertEquals(JSONToken.LITERAL_ISO8601_DATE, lexer.token());
        lexer.nextToken();
        Assert.assertEquals(JSONToken.EOF, lexer.token());
    }
View Full Code Here

Examples of com.alibaba.fastjson.serializer.JSONSerializer.config()

        SerializeWriter out = new SerializeWriter();

        try {
            JSONSerializer serializer = new JSONSerializer(out);
            for (com.alibaba.fastjson.serializer.SerializerFeature feature : features) {
                serializer.config(feature, true);
            }

            serializer.write(object);

            return out.toString();
View Full Code Here

Examples of com.alibaba.fastjson.serializer.JSONSerializer.config()

        SerializeWriter out = new SerializeWriter();

        try {
            JSONSerializer serializer = new JSONSerializer(out);
            for (com.alibaba.fastjson.serializer.SerializerFeature feature : features) {
                serializer.config(feature, true);
            }

            serializer.config(SerializerFeature.WriteDateUseDateFormat, true);

            if (dateFormat != null) {
View Full Code Here

Examples of com.alibaba.fastjson.serializer.JSONSerializer.config()

            JSONSerializer serializer = new JSONSerializer(out);
            for (com.alibaba.fastjson.serializer.SerializerFeature feature : features) {
                serializer.config(feature, true);
            }

            serializer.config(SerializerFeature.WriteDateUseDateFormat, true);

            if (dateFormat != null) {
                serializer.setDateFormat(dateFormat);
            }
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.