Examples of SerializableString


Examples of com.facebook.presto.jdbc.internal.jackson.core.SerializableString

   
    @Deprecated // since 2.3
    public static ObjectIdWriter construct(JavaType idType, String propName,
            ObjectIdGenerator<?> generator, boolean alwaysAsId)
    {
        SerializableString serName = (propName == null) ? null : new SerializedString(propName);
        return new ObjectIdWriter(idType, serName, generator, null, alwaysAsId);
    }
View Full Code Here

Examples of com.facebook.presto.jdbc.internal.jackson.core.SerializableString

     * representation of the simple name.
     *
     * @since 2.4
     */
    public SerializableString simpleAsEncoded(MapperConfig<?> config) {
        SerializableString sstr = _encodedSimple;
        if (sstr == null) {
            sstr = config.compileString(_simpleName);
            _encodedSimple = sstr;
        }
        return sstr;
View Full Code Here

Examples of com.facebook.presto.jdbc.internal.jackson.core.SerializableString

            // Need to assume String(ified) ids, for now... could add 'long' variant?
            jgen.writeObjectId(String.valueOf(id));
            return;
        }
       
        SerializableString name = w.propertyName;
        if (name != null) {
            jgen.writeFieldName(name);
            w.serializer.serialize(id, jgen, provider);
        }
    }
View Full Code Here

Examples of com.fasterxml.jackson.core.SerializableString

    @Deprecated
    @Override
    protected RisonGenerator _createJsonGenerator(Writer out, IOContext ctxt) throws IOException {
        RisonGenerator gen = new RisonGenerator(ctxt, _generatorFeatures, _risonGeneratorFeatures, _objectCodec, out);
        SerializableString rootSep = _rootValueSeparator;
        if (rootSep != DefaultPrettyPrinter.DEFAULT_ROOT_VALUE_SEPARATOR) {
            gen.setRootValueSeparator(rootSep);
        }
        return gen;
    }
View Full Code Here

Examples of com.fasterxml.jackson.core.SerializableString

    }

    public SerializableString findRootName(Class<?> rootType, MapperConfig<?> config)
    {
        ClassKey key = new ClassKey(rootType);
        SerializableString name = _rootNames.get(key);
        if (name != null) {
            return name;
        }
        BeanDescription beanDesc = config.introspectClassAnnotations(rootType);
        AnnotationIntrospector intr = config.getAnnotationIntrospector();
View Full Code Here

Examples of com.fasterxml.jackson.core.SerializableString

        final String DOC = "{\"name\":123,\"name2\":14,\"x\":\"name\"}";
        JsonFactory jf = new JsonFactory();
        JsonParser jp = useStream ?
            jf.createParser(new ByteArrayInputStream(DOC.getBytes("UTF-8")))
            : jf.createParser(new StringReader(DOC));
        SerializableString NAME = new SerializedString("name");
        assertFalse(jp.nextFieldName(NAME));
        assertToken(JsonToken.START_OBJECT, jp.getCurrentToken());
        assertTrue(jp.nextFieldName(NAME));
        assertToken(JsonToken.FIELD_NAME, jp.getCurrentToken());
        assertEquals(NAME.getValue(), jp.getCurrentName());
        assertEquals(NAME.getValue(), jp.getText());
        assertFalse(jp.nextFieldName(NAME));
        assertToken(JsonToken.VALUE_NUMBER_INT, jp.getCurrentToken());
        assertEquals(123, jp.getIntValue());

        assertFalse(jp.nextFieldName(NAME));
View Full Code Here

Examples of com.fasterxml.jackson.core.SerializableString

        for (int i = 0; i < TESTROUNDS; ++i) {
            sb.append(DOC_PART);
        }
        final String DOC = sb.toString();
       
        SerializableString fieldName = new SerializedString("fieldName");
        JsonFactory jf = new JsonFactory();
        JsonParser parser = useStream ?
            jf.createParser(new ByteArrayInputStream(DOC.getBytes("UTF-8")))
            : jf.createParser(new StringReader(DOC));
View Full Code Here

Examples of com.fasterxml.jackson.core.SerializableString

    }

    private void _testIssue38(boolean useStream) throws Exception
    {
        final String DOC = "{\"field\" :\"value\"}";
        SerializableString fieldName = new SerializedString("field");
        JsonFactory jf = new JsonFactory();
        JsonParser parser = useStream ?
            jf.createParser(new ByteArrayInputStream(DOC.getBytes("UTF-8")))
            : jf.createParser(new StringReader(DOC));
        assertEquals(JsonToken.START_OBJECT, parser.nextToken());
View Full Code Here

Examples of com.fasterxml.jackson.core.SerializableString

                : f.createParser(new StringReader(DOC));
        assertToken(JsonToken.START_OBJECT, parser.nextToken());
        rnd = new Random(1);
        for (int i = 0; i < count; ++i) {
            int exp = rnd.nextInt();
            SerializableString expName = new SerializedString("f"+exp);
            assertTrue(parser.nextFieldName(expName));
            assertToken(JsonToken.VALUE_NUMBER_INT, parser.nextToken());
            assertEquals(exp % 1000, parser.getIntValue());
        }
        assertToken(JsonToken.END_OBJECT, parser.nextToken());
View Full Code Here

Examples of com.fasterxml.jackson.core.SerializableString

    public void testAppending() throws IOException
    {
        final String INPUT = "\"quo\\ted\"";
        final String QUOTED = "\\\"quo\\\\ted\\\"";
       
        SerializableString sstr = new SerializedString(INPUT);
        // sanity checks first:
        assertEquals(sstr.getValue(), INPUT);
        assertEquals(QUOTED, new String(sstr.asQuotedChars()));

        ByteArrayOutputStream bytes = new ByteArrayOutputStream();
        assertEquals(QUOTED.length(), sstr.writeQuotedUTF8(bytes));
        assertEquals(QUOTED, bytes.toString("UTF-8"));
        bytes.reset();
        assertEquals(INPUT.length(), sstr.writeUnquotedUTF8(bytes));
        assertEquals(INPUT, bytes.toString("UTF-8"));

        byte[] buffer = new byte[100];
        assertEquals(QUOTED.length(), sstr.appendQuotedUTF8(buffer, 3));
        assertEquals(QUOTED, new String(buffer, 3, QUOTED.length()));
        Arrays.fill(buffer, (byte) 0);
        assertEquals(INPUT.length(), sstr.appendUnquotedUTF8(buffer, 5));
        assertEquals(INPUT, new String(buffer, 5, INPUT.length()));
    }
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.