Package com.ibm.icu.util

Examples of com.ibm.icu.util.StringTokenizer


  private static boolean isValidTE(String value)
  {
    if (value.trim().length() == 0)
      return true;

    StringTokenizer st = new StringTokenizer(value, ",");
    while (st.hasMoreElements())
    {
      String str = st.nextToken().trim();
      if (st.equals("trailers"))
        return true;

      int idx = str.indexOf(";");
      if (idx == -1)
      {
View Full Code Here


   */
  private static boolean isValidUserAgent(String value)
  {
    if (value.length() == 0)
      return false;
    StringTokenizer st = new StringTokenizer(value, " ");
    while (st.hasMoreElements())
    {
      String str = st.nextToken();
      if (!isProduct(str) && !isComment(str))
        return false;

    }

View Full Code Here

  private static boolean isValidAcceptLanguage(String value)
  {
    if (value.trim().length() == 0)
      return false;

    StringTokenizer st = new StringTokenizer(value, ",");
    while (st.hasMoreElements())
    {
      String str = st.nextToken().trim();
      int idx = str.indexOf(";");
      if (idx == -1)
      {
        if (!isToken(str))
          return false;
View Full Code Here

   */
  private static boolean isLanguageRange(String str)
  {
    if (str.trim().equals("*"))
      return true;
    StringTokenizer st = new StringTokenizer(str, "-");
    while (st.hasMoreElements())
    {
      if (!is8ALPHA(st.nextToken()))
        return false;
    }
    return true;
  }
View Full Code Here

  private static boolean isValidAcceptEncoding(String value)
  {
    if (value.trim().length() == 0)
      return false;

    StringTokenizer st = new StringTokenizer(value, ",");
    while (st.hasMoreElements())
    {
      String str = st.nextToken().trim();
      int idx = str.indexOf(";");
      if (idx == -1)
      {
        if (!isToken(str) && !str.equals("*"))
          return false;
View Full Code Here

  private static boolean isValidAcceptCharSet(String value)
  {
    if (value.trim().length() == 0)
      return false;

    StringTokenizer st = new StringTokenizer(value, ",");
    while (st.hasMoreElements())
    {
      String str = st.nextToken().trim();
      int idx = str.indexOf(";");
      if (idx == -1)
      {
        if (!isToken(str) && !str.equals("*"))
          return false;
View Full Code Here

  private static boolean isValidAccept(String value)
  {
    if (value.trim().length() == 0)
      return true;

    StringTokenizer st = new StringTokenizer(value, ",");
    while (st.hasMoreElements())
    {
      String str = st.nextToken().trim();
      int idx = str.indexOf(";");
      if (idx == -1)
      {
        if (!isMediaRange(str))
          return false;
View Full Code Here

  private static boolean isAcceptParams(String string)
  {
    if (string.trim().length() == 0)
      return false;

    StringTokenizer st = new StringTokenizer(string, ";");
    String str = st.nextToken();

    int idx = str.indexOf("=");
    if (idx == -1)
    {
      if (str.equals("q") || !isToken(str))
        return false;
    }
    else
    {
      if (str.substring(0, idx).equals("q"))
      {
        if (!isQValue(str.substring(idx + 1)))
          return false;
      }
      else
      {
        if (!isParameterWithoutValue(str))
          return false;
      }
    }

    while (st.hasMoreElements())
    {
      str = st.nextToken();
      if (!isParameterWithoutValue(str))
        return false;
    }
    return true;
  }
View Full Code Here

  private static boolean isExpectation(String value)
  {
    if (value.equals("100-continue"))
      return true;

    StringTokenizer st = new StringTokenizer(value, ";");
    while (st.hasMoreElements())
    {
      if (!isParameterWithoutValue(st.nextToken()))
        return false;
    }

    return true;
  }
View Full Code Here

   * @param value
   * @return boolean
   */
  private static boolean isCredentials(String value)
  {
    StringTokenizer st = new StringTokenizer(value, " ");
    if (!isToken(st.nextToken()))
      return false;

    while (st.hasMoreElements())
    {
      String param = st.nextToken(",");
      if (!isParameter(param))
        return false;
    }
    return true;
  }
View Full Code Here

TOP

Related Classes of com.ibm.icu.util.StringTokenizer

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.