@Override public Decoder<Object> getDecoder(int paramNum, State state) { if (paramNum == 0) { NestedDecoderState s = getDecoder(state); if (fixedIndex != null) { s.setIndex(fixedIndex); int index = getDecoder(state).getIndex(); if (index == -1) { getDecoder(state).setIndex(0); index = 0; NestedDecoderState s = getDecoder(state); s.setIndex(0); int ind = s.getIndex(); NestedDecoderState s = getDecoder(state); s.setIndex(1); int ind = s.getIndex();
@Override public Decoder<Object> getDecoder(int paramNum, State state) { if (paramNum == 0) { NestedDecoderState s = getDecoder(state); if (fixedIndex != null) { s.setIndex(fixedIndex); int index = getDecoder(state).getIndex(); if (index == -1) { getDecoder(state).setIndex(0); index = 0; NestedDecoderState s = getDecoder(state); s.setIndex(0); int ind = s.getIndex(); NestedDecoderState s = getDecoder(state); s.setIndex(1); int ind = s.getIndex();
@Override public Object decode(List<Object> parts, State state) { NestedDecoderState s = getDecoder(state); int index = s.getIndex(); index += s.incPartsIndex(); if (fixedIndex != null && parts.isEmpty()) { s.resetPartsIndex(); } if (index == -1 || (fixedIndex != null && state.getLevel() == 0)) { return decoders[decoders.length-1].decode(parts, state); } Object res = decoders[index].decode(parts, state); if (res == null) { index = s.incIndex() + s.getPartsIndex(); return decoders[index].decode(parts, state); } // TODO refactor it! Decoder<Object> decoder = decoders[index].getDecoder(0, state); if (decoder == RESET_INDEX) { s.setIndex(-1); } return res; }
@Override public Object decode(List<Object> parts, State state) { NestedDecoderState s = getDecoder(state); int index = s.getIndex(); index += s.incPartsIndex(); if (fixedIndex != null && parts.isEmpty()) { s.resetPartsIndex(); } if (index == -1 || (fixedIndex != null && state.getLevel() == 0)) { return decoders[decoders.length-1].decode(parts, state); } Object res = decoders[index].decode(parts, state); if (res == null) { index = s.incIndex() + s.getPartsIndex(); return decoders[index].decode(parts, state); } // TODO refactor it! Decoder<Object> decoder = decoders[index].getDecoder(0, state); if (decoder == RESET_INDEX) { s.setIndex(-1); } return res; }
@Override public Decoder<Object> getDecoder(int paramNum, State state) { if (paramNum == 0) { NestedDecoderState s = getDecoder(state); if (fixedIndex != null) { s.setIndex(fixedIndex); int index = getDecoder(state).getIndex(); if (index == -1) { getDecoder(state).setIndex(0); index = 0; NestedDecoderState s = getDecoder(state); s.setIndex(0); int ind = s.getIndex(); NestedDecoderState s = getDecoder(state); s.setIndex(1); int ind = s.getIndex();
@Override public Object decode(List<Object> parts, State state) { NestedDecoderState s = getDecoder(state); int index = s.getIndex(); index += s.incPartsIndex(); if (fixedIndex != null && parts.isEmpty()) { s.resetPartsIndex(); } if (index == -1 || (fixedIndex != null && state.getLevel() == 0)) { return decoders[decoders.length-1].decode(parts, state); } Object res = decoders[index].decode(parts, state); if (res == null) { index = s.incIndex() + s.getPartsIndex(); return decoders[index].decode(parts, state); } // TODO refactor it! Decoder<Object> decoder = decoders[index].getDecoder(0, state); if (decoder == RESET_INDEX) { s.setIndex(-1); } return res; }