State shift()

in src/main/java/com/alibaba/com/caucho/hessian/io/HessianDebugState.java [1734:1773]


        State shift(Object object) {
            if (_state == TYPE) {
                Object type = object;

                if (object instanceof Integer) {
                    int index = (Integer) object;

                    if (index >= 0 && index < _typeDefList.size())
                        type = _typeDefList.get(index);
                    else
                        type = "type-unknown(" + index + ")";
                } else if (object instanceof String)
                    _typeDefList.add((String) object);

                printObject("list " + type + " (#" + _refId + ")");

                if (_isLength) {
                    _state = VALUE;

                    if (_length == 0)
                        return _next;
                } else
                    _state = LENGTH;

                return this;
            } else if (_state == LENGTH) {
                _length = (Integer) object;

                if (!_isTyped)
                    printObject("list (#" + _refId + ")");

                _state = VALUE;

                if (_length == 0)
                    return _next;
                else
                    return this;
            } else
                return this;
        }