Package com.fasterxml.jackson.core.sym

Examples of com.fasterxml.jackson.core.sym.BytesToNameCanonicalizer$Bucket


    public CBORParser constructParser(int generalParserFeatures, int smileFeatures,
            boolean internNames,
            ObjectCodec codec, BytesToNameCanonicalizer rootByteSymbols)
        throws IOException, JsonParseException
    {
        BytesToNameCanonicalizer can = rootByteSymbols.makeChild(true, internNames);
        // We just need a single byte to recognize possible "empty" document.
        ensureLoaded(1);
        CBORParser p = new CBORParser(_context, generalParserFeatures, smileFeatures,
                codec, can,
                _in, _inputBuffer, _inputPtr, _inputEnd, _bufferRecyclable);
View Full Code Here


            ObjectCodec codec, BytesToNameCanonicalizer rootByteSymbols)
        throws IOException, JsonParseException
    {
      // TODO: upgrade to non-deprecated method in 2.5 (but not for 2.4, to allow
      // some level of interoperability with earlier versions)
        BytesToNameCanonicalizer can = rootByteSymbols.makeChild(true, internNames);
      // We just need a single byte, really, to know if it starts with header
        int end = _inputEnd;
        if (_inputPtr < end && _in != null) {
          int count = _in.read(_inputBuffer, end, _inputBuffer.length - end);
          if (count > 0) {
View Full Code Here

        if (enc == JsonEncoding.UTF8) {
            /* and without canonicalization, byte-based approach is not performance; just use std UTF-8 reader
             * (which is ok for larger input; not so hot for smaller; but this is not a common case)
             */
            if (canonicalize) {
                BytesToNameCanonicalizer can = rootByteSymbols.makeChild(canonicalize, intern);
                return new UTF8StreamJsonParser(_context, parserFeatures, _in, codec, can, _inputBuffer, _inputPtr, _inputEnd, _bufferRecyclable);
            }
        }
        return new ReaderBasedJsonParser(_context, parserFeatures, constructReader(), codec,
                rootCharSymbols.makeChild(canonicalize, intern));
View Full Code Here

        throws Exception
    {
        final int A_BYTES = 0x41414141; // "AAAA"
        final int B_BYTES = 0x42424242; // "BBBB"

        BytesToNameCanonicalizer nc = BytesToNameCanonicalizer.createRoot()
                .makeChild(JsonFactory.Feature.collectDefaults());
        assertNull(nc.findName(A_BYTES));
        assertNull(nc.findName(A_BYTES, B_BYTES));

        nc.addName("AAAA", new int[] { A_BYTES }, 1);
        Name n1 = nc.findName(A_BYTES);
        assertNotNull(n1);
        assertEquals("AAAA", n1.getName());
        nc.addName("AAAABBBB", new int[] { A_BYTES, B_BYTES }, 2);
        Name n2 = nc.findName(A_BYTES, B_BYTES);
        assertEquals("AAAABBBB", n2.getName());
        assertNotNull(n2);

        /* and let's then just exercise this method so it gets covered;
         * it's only used for debugging.
         */
        assertNotNull(nc.toString());
    }
View Full Code Here

            ObjectCodec codec, BytesToNameCanonicalizer rootByteSymbols)
        throws IOException, JsonParseException
    {
      // Replace with non-deprecated method in 2.5; leave this for 2.4 for improved
      // backwards compatibility
        BytesToNameCanonicalizer can = rootByteSymbols.makeChild(true, internNames);
        // We just need a single byte to recognize possible "empty" document.
        ensureLoaded(1);
        CBORParser p = new CBORParser(_context, generalParserFeatures, formatFeatures,
                codec, can,
                _in, _inputBuffer, _inputPtr, _inputEnd, _bufferRecyclable);
View Full Code Here

    public SmileParser constructParser(int generalParserFeatures, int smileFeatures,
            boolean internNames,
            ObjectCodec codec, BytesToNameCanonicalizer rootByteSymbols)
        throws IOException, JsonParseException
    {
        BytesToNameCanonicalizer can = rootByteSymbols.makeChild(true, internNames);
      // We just need a single byte, really, to know if it starts with header
      ensureLoaded(1);
        SmileParser p = new SmileParser(_context, generalParserFeatures, smileFeatures,
                codec, can,
                _in, _inputBuffer, _inputPtr, _inputEnd, _bufferRecyclable);
View Full Code Here

    public SmileParser constructParser(int generalParserFeatures, int smileFeatures,
            boolean internNames,
            ObjectCodec codec, BytesToNameCanonicalizer rootByteSymbols)
        throws IOException, JsonParseException
    {
        BytesToNameCanonicalizer can = rootByteSymbols.makeChild(true, internNames);
      // We just need a single byte, really, to know if it starts with header
      ensureLoaded(1);
        SmileParser p =  new SmileParser(_context, generalParserFeatures, smileFeatures,
            codec, can,
            _in, _inputBuffer, _inputPtr, _inputEnd, _bufferRecyclable);
View Full Code Here

        if (enc == JsonEncoding.UTF8) {
            /* and without canonicalization, byte-based approach is not performance; just use std UTF-8 reader
             * (which is ok for larger input; not so hot for smaller; but this is not a common case)
             */
            if (canonicalize) {
                BytesToNameCanonicalizer can = rootByteSymbols.makeChild(canonicalize, intern);
                return new UTF8StreamJsonParser(_context, parserFeatures, _in, codec, can, _inputBuffer, _inputPtr, _inputEnd, _bufferRecyclable);
            }
        }
        return new ReaderBasedJsonParser(_context, parserFeatures, constructReader(), codec,
                rootCharSymbols.makeChild(canonicalize, intern));
View Full Code Here

        if (enc == JsonEncoding.UTF8) {
            /* and without canonicalization, byte-based approach is not performance; just use std UTF-8 reader
             * (which is ok for larger input; not so hot for smaller; but this is not a common case)
             */
            if (canonicalize) {
                BytesToNameCanonicalizer can = rootByteSymbols.makeChild(canonicalize, intern);
                return new UTF8StreamJsonParser(_context, parserFeatures, _in, codec, can, _inputBuffer, _inputPtr, _inputEnd, _bufferRecyclable);
            }
        }
        return new ReaderBasedJsonParser(_context, parserFeatures, constructReader(), codec,
                rootCharSymbols.makeChild(canonicalize, intern));
View Full Code Here

        if (enc == JsonEncoding.UTF8) {
            /* and without canonicalization, byte-based approach is not performance; just use std UTF-8 reader
             * (which is ok for larger input; not so hot for smaller; but this is not a common case)
             */
            if (canonicalize) {
                BytesToNameCanonicalizer can = rootByteSymbols.makeChild(canonicalize, intern);
                return new UTF8StreamJsonParser(_context, parserFeatures, _in, codec, can,
                        _inputBuffer, _inputPtr, _inputEnd, _bufferRecyclable);
            }
        }
        return new ReaderBasedJsonParser(_context, parserFeatures, constructReader(), codec,
View Full Code Here

TOP

Related Classes of com.fasterxml.jackson.core.sym.BytesToNameCanonicalizer$Bucket

Copyright © 2018 www.massapicom. 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.