public static Tag parseTag(String mojangson) throws MojangsonParseException {
  if (mojangson.startsWith(String.valueOf(STRING_QUOTES.getSymbol())) && mojangson.endsWith(String.valueOf(STRING_QUOTES.getSymbol()))) {
    return parseString(mojangson);
  }
  if (mojangson.endsWith(String.valueOf(BYTE_SUFFIX.getSymbol()))) {
    return parseByte(mojangson);
  }
  if (mojangson.endsWith(String.valueOf(DOUBLE_SUFFIX.getSymbol()))) {
    return parseDouble(mojangson);
  }
  if (mojangson.endsWith(String.valueOf(LONG_SUFFIX.getSymbol()))) {
    return parseLong(mojangson);
  }
  if (mojangson.endsWith(String.valueOf(FLOAT_SUFFIX.getSymbol()))) {
    return parseFloat(mojangson);
  }
  if (mojangson.endsWith(String.valueOf(SHORT_SUFFIX.getSymbol()))) {
    return parseShort(mojangson);
  }
  if (mojangson.startsWith(String.valueOf(ARRAY_START.getSymbol())) && mojangson.endsWith(String.valueOf(ARRAY_END.getSymbol()))) {
    return parseArray(mojangson);
  }
  if (mojangson.startsWith(String.valueOf(COMPOUND_START.getSymbol())) && mojangson.endsWith(String.valueOf(COMPOUND_END.getSymbol()))) {
    return parseCompound(mojangson);
  }
  try {
    return parseInt(mojangson);
  }
 catch (  MojangsonParseException e) {
    try {
      return parseLong(mojangson);
    }
 catch (    MojangsonParseException e1) {
      try {
        return parseDouble(mojangson);
      }
 catch (      MojangsonParseException e2) {
        return parseString(mojangson);
      }
    }
  }
}

public static Tag parseTag ( String mojangson ) throws MojangsonParseException { if ( mojangson . startsWith ( String . valueOf ( STRING_QUOTES . getSymbol ( ) ) ) && mojangson . endsWith ( String . valueOf ( STRING_QUOTES . getSymbol ( ) ) ) ) { return parseString ( mojangson ) ; } if ( mojangson . endsWith ( String . valueOf ( BYTE_SUFFIX . getSymbol ( ) ) ) ) { return parseByte ( mojangson ) ; } if ( mojangson . endsWith ( String . valueOf ( DOUBLE_SUFFIX . getSymbol ( ) ) ) ) { return parseDouble ( mojangson ) ; } if ( mojangson . endsWith ( String . valueOf ( LONG_SUFFIX . getSymbol ( ) ) ) ) { return parseLong ( mojangson ) ; } if ( mojangson . endsWith ( String . valueOf ( FLOAT_SUFFIX . getSymbol ( ) ) ) ) { return parseFloat ( mojangson ) ; } if ( mojangson . endsWith ( String . valueOf ( SHORT_SUFFIX . getSymbol ( ) ) ) ) { return parseShort ( mojangson ) ; } if ( mojangson . startsWith ( String . valueOf ( ARRAY_START . getSymbol ( ) ) ) && mojangson . endsWith ( String . valueOf ( ARRAY_END . getSymbol ( ) ) ) ) { return parseArray ( mojangson ) ; } if ( mojangson . startsWith ( String . valueOf ( COMPOUND_START . getSymbol ( ) ) ) && mojangson . endsWith ( String . valueOf ( COMPOUND_END . getSymbol ( ) ) ) ) { return parseCompound ( mojangson ) ; } try { return parseInt ( mojangson ) ; } catch ( MojangsonParseException e ) { try { return parseLong ( mojangson ) ; } catch ( MojangsonParseException e1 ) { try { return parseDouble ( mojangson ) ; } catch ( MojangsonParseException e2 ) { return parseString ( mojangson ) ; } } } }
detects the tag type of the mojangson string , and parses it . convenience method for other parse methods . this method will fall back to an inttag if it could not find an appropriate tag type , and to string if the value could not be parsed as an integer either .
