Parses the current token as a list of integers.
@param parser
@return List of {@link Integer}s
@throws IOException
@throws JsonFormatException
@author vvakame
432596
public static List<Integer> parserIntegerList(JsonPullParser parser) throws IOException,
			JsonFormatException {

		State eventType = parser.getEventType();
		if (eventType == State.VALUE_NULL) {
			return null;
		}
		if (eventType != State.START_ARRAY) {
			throw new IllegalStateException("not started brace!");
		}
		List<Integer> list = new ArrayList<Integer>();
		while (parser.lookAhead() != State.END_ARRAY) {
			eventType = parser.getEventType();
			if (eventType == State.VALUE_NULL) {
				list.add(null);
			} else if (eventType == State.VALUE_LONG) {
				list.add((int) parser.getValueLong());
			} else {
				throw new IllegalStateException("unexpected state. expected=VALUE_LONG, but get="
						+ eventType.toString());
			}
		}
		parser.getEventType();
		return list;
	}
532599
public final void addParser(@NotNull final ParserConfig parser) {
        Contract.requireArgNotNull("parser", parser);
        if (list == null) {
            list = new ArrayList<>();
        }
        list.add(parser);
    }
459701
public T parse(String jsonString) throws IOException {
        JsonParser jsonParser = LoganSquare.JSON_FACTORY.createParser(jsonString);
        jsonParser.nextToken();
        return parse(jsonParser);
    }
781536
public static Short parserShort(JsonPullParser parser) throws IOException, JsonFormatException {

		State eventType = parser.getEventType();
		if (eventType == State.VALUE_NULL) {
			return null;
		} else if (eventType == State.VALUE_LONG) {
			return (short) parser.getValueLong();
		} else {
			throw new IllegalStateException("unexpected state. expected=VALUE_LONG, but get="
					+ eventType.toString());
		}
	}
86579
@SuppressWarnings("unchecked")
  <T> T parse(Class<T> clazz) throws JsonParserException {
    advanceToken();
    Object parsed = currentValue();
    if (advanceToken() != Token.EOF)
      throw createParseException(null, "Expected end of input, got " + token, true);
    if (clazz != Object.class && (parsed == null || clazz != parsed.getClass()))
      throw createParseException(null, "JSON did not contain the correct type, expected " + clazz.getName()
          + ".", true);
    return (T)(parsed);
  }
191999
public static int[] parseInts(String nums, String sperator) {
        String[] ss = StringUtils.split(nums, sperator);
        int[] ints = new int[ss.length];
        for (int i = 0; i < ss.length; i++) {
            ints[i] = Integer.parseInt(ss[i]);
        }
        return ints;
    }
1194767
public <T> T parse(byte[] in, JsonReaderI<T> mapper) throws ParseException {
		this.base = mapper.base;
		this.in = in;
		this.len = in.length;
		return parse(mapper);
	}
1159770
public List<T> parseList(byte[] byteArray) throws IOException {
        JsonParser jsonParser = LoganSquare.JSON_FACTORY.createParser(byteArray);
        jsonParser.nextToken();
        return parseList(jsonParser);
    }
250041
public T parse(InputStream is) throws IOException {
        JsonParser jsonParser = LoganSquare.JSON_FACTORY.createParser(is);
        jsonParser.nextToken();
        return parse(jsonParser);
    }
716188
public static Character parserCharacter(JsonPullParser parser) throws IOException,
			JsonFormatException {

		State eventType = parser.getEventType();
		if (eventType == State.VALUE_NULL) {
			return null;
		} else if (eventType == State.VALUE_STRING) {
			String str = parser.getValueString();
			if (str.length() != 1) {
				throw new IllegalStateException(
						"unexpected value. expecte string size is 1. but get=" + str);
			}
			return str.charAt(0);
		} else {
			throw new IllegalStateException("unexpected state. expected=VALUE_STRING, but get="
					+ eventType.toString());
		}
	}
1225732
protected void parseIntegerLists(TokenList tokens) {
        TokenList.Token t = tokens.getFirst();
        if( t == null || t.next == null )
            return;

        int state = 0;

        TokenList.Token start = null;
        TokenList.Token prev = t;

        boolean last = false;
        while( true ) {
            if( state == 0 ) {
                if( isVariableInteger(t) ) {
                    start = t;
                    state = 1;
                }
            } else if( state == 1 ) {
                // var ?
                if( isVariableInteger(t)) {                 // see if its explicit number sequence
                    state = 2;
                } else {  // just scalar integer, skip
                    state = 0;
                }
            } else if ( state == 2 ) {
                // var var ....
                if( !isVariableInteger(t) ) {
                    // create explicit list sequence
                    IntegerSequence sequence = new IntegerSequence.Explicit(start,prev);
                    VariableIntegerSequence varSequence = functions.getManagerTemp().createIntegerSequence(sequence);
                    replaceSequence(tokens, varSequence, start, prev);
                    state = 0;
                }
            }

            if( last ) {
                break;
            } else if( t.next == null ) {
                // handle the case where it is the last token in the sequence
                last = true;
            }
            prev = t;
            t = t.next;
        }
    }
524140
protected JinglePayloadType parsePayload(final XmlPullParser parser) {
        int ptId = 0;
        String ptName;
        int ptChannels = 0;

        try {
            ptId = Integer.parseInt(parser.getAttributeValue("", "id"));
        } catch (Exception e) {
        }

        ptName = parser.getAttributeValue("", "name");

        try {
            ptChannels = Integer.parseInt(parser.getAttributeValue("", "channels"));
        } catch (Exception e) {
        }

        return new JinglePayloadType(new PayloadType(ptId, ptName, ptChannels));
    }
879811
@SuppressWarnings("unchecked")
    public <T> List<T> readListOf(Class<T> type) throws IOException
    {
        if (_parser.isExpectedStartArrayToken()) {
            return (List<T>) new CollectionReader(List.class, _readerLocator.findReader(type)).read(this, _parser);
        }
        if (_parser.hasToken(JsonToken.VALUE_NULL)) {
            return null;
        }
        throw JSONObjectException.from(_parser,
                "Can not read a List: expect to see START_ARRAY ('['), instead got: "+ValueReader._tokenDesc(_parser));
    }
1245826
@Nonnull
  public static ESuccess parseJson (@Nonnull @WillClose final Reader aReader,
                                    @Nonnull final IJsonParserHandler aParserHandler)
  {
    return parseJson (aReader, aParserHandler, (IJsonParserCustomizeCallback) null, (IJsonParseExceptionCallback) null);
  }
977008
public static <T extends Enum<T>>List<T> parserEnumList(JsonPullParser parser, Class<T> clazz)
			throws IOException, JsonFormatException {

		State eventType = parser.getEventType();
		if (eventType == State.VALUE_NULL) {
			return null;
		}
		if (eventType != State.START_ARRAY) {
			throw new IllegalStateException("not started brace!");
		}
		List<T> list = new ArrayList<T>();
		while (parser.lookAhead() != State.END_ARRAY) {
			eventType = parser.getEventType();
			if (eventType == State.VALUE_NULL) {
				list.add(null);
			} else if (eventType == State.VALUE_STRING) {
				T obj = Enum.valueOf(clazz, parser.getValueString());
				list.add(obj);
			} else {
				throw new IllegalStateException("unexpected state. expected=VALUE_STRING, but get="
						+ eventType.toString());
			}
		}
		parser.getEventType();
		return list;
	}
581197
public List<T> parseList(InputStream is) throws IOException {
        JsonParser jsonParser = LoganSquare.JSON_FACTORY.createParser(is);
        jsonParser.nextToken();
        return parseList(jsonParser);
    }
1172854
public static Object parseWithException(InputStream in) throws IOException, ParseException {
		return new JSONParser(DEFAULT_PERMISSIVE_MODE).parse(in, defaultReader.DEFAULT);
	}