org.eclipse.jetty.util
类 QuotedStringTokenizer

java.lang.Object
  继承者 java.util.StringTokenizer
      继承者 org.eclipse.jetty.util.QuotedStringTokenizer
所有已实现的接口:
Enumeration<Object>

public class QuotedStringTokenizer
extends StringTokenizer

StringTokenizer with Quoting support. This class is a copy of the java.util.StringTokenizer API and the behaviour is the same, except that single and double quoted string values are recognised. Delimiters within quotes are not considered delimiters. Quotes can be escaped with '\'.

另请参见:
StringTokenizer

构造方法摘要
QuotedStringTokenizer(String str)
           
QuotedStringTokenizer(String str, String delim)
           
QuotedStringTokenizer(String str, String delim, boolean returnDelimiters)
           
QuotedStringTokenizer(String str, String delim, boolean returnDelimiters, boolean returnQuotes)
           
 
方法摘要
 int countTokens()
          Not implemented.
 boolean getDouble()
           
 boolean getSingle()
           
 boolean hasMoreElements()
           
 boolean hasMoreTokens()
           
 Object nextElement()
           
 String nextToken()
           
 String nextToken(String delim)
           
static void quote(Appendable buffer, String input)
          Quote a string into an Appendable.
static String quote(String s)
          Quote a string.
static boolean quoteIfNeeded(Appendable buf, String s, String delim)
          Quote a string into a StringBuffer only if needed.
static String quoteIfNeeded(String s, String delim)
          Quote a string.
 void setDouble(boolean d)
           
 void setSingle(boolean single)
           
static String unquote(String s)
           
static String unquote(String s, boolean lenient)
          Unquote a string.
static String unquoteOnly(String s)
           
static String unquoteOnly(String s, boolean lenient)
          Unquote a string, NOT converting unicode sequences
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

QuotedStringTokenizer

public QuotedStringTokenizer(String str,
                             String delim,
                             boolean returnDelimiters,
                             boolean returnQuotes)

QuotedStringTokenizer

public QuotedStringTokenizer(String str,
                             String delim,
                             boolean returnDelimiters)

QuotedStringTokenizer

public QuotedStringTokenizer(String str,
                             String delim)

QuotedStringTokenizer

public QuotedStringTokenizer(String str)
方法详细信息

hasMoreTokens

public boolean hasMoreTokens()
覆盖:
StringTokenizer 中的 hasMoreTokens

nextToken

public String nextToken()
                 throws NoSuchElementException
覆盖:
StringTokenizer 中的 nextToken
抛出:
NoSuchElementException

nextToken

public String nextToken(String delim)
                 throws NoSuchElementException
覆盖:
StringTokenizer 中的 nextToken
抛出:
NoSuchElementException

hasMoreElements

public boolean hasMoreElements()
指定者:
接口 Enumeration<Object> 中的 hasMoreElements
覆盖:
StringTokenizer 中的 hasMoreElements

nextElement

public Object nextElement()
                   throws NoSuchElementException
指定者:
接口 Enumeration<Object> 中的 nextElement
覆盖:
StringTokenizer 中的 nextElement
抛出:
NoSuchElementException

countTokens

public int countTokens()
Not implemented.

覆盖:
StringTokenizer 中的 countTokens

quoteIfNeeded

public static String quoteIfNeeded(String s,
                                   String delim)
Quote a string. The string is quoted only if quoting is required due to embedded delimiters, quote characters or the empty string.

参数:
s - The string to quote.
delim - the delimiter to use to quote the string
返回:
quoted string

quote

public static String quote(String s)
Quote a string. The string is quoted only if quoting is required due to embeded delimiters, quote characters or the empty string.

参数:
s - The string to quote.
返回:
quoted string

quote

public static void quote(Appendable buffer,
                         String input)
Quote a string into an Appendable. The characters ", \, \n, \r, \t, \f and \b are escaped

参数:
buffer - The Appendable
input - The String to quote.

quoteIfNeeded

public static boolean quoteIfNeeded(Appendable buf,
                                    String s,
                                    String delim)
Quote a string into a StringBuffer only if needed. Quotes are forced if any delim characters are present.

参数:
buf - The StringBuffer
s - The String to quote.
delim - String of characters that must be quoted.
返回:
true if quoted;

unquoteOnly

public static String unquoteOnly(String s)

unquoteOnly

public static String unquoteOnly(String s,
                                 boolean lenient)
Unquote a string, NOT converting unicode sequences

参数:
s - The string to unquote.
lenient - if true, will leave in backslashes that aren't valid escapes
返回:
quoted string

unquote

public static String unquote(String s)

unquote

public static String unquote(String s,
                             boolean lenient)
Unquote a string.

参数:
s - The string to unquote.
返回:
quoted string

getDouble

public boolean getDouble()
返回:
handle double quotes if true

setDouble

public void setDouble(boolean d)
参数:
d - handle double quotes if true

getSingle

public boolean getSingle()
返回:
handle single quotes if true

setSingle

public void setSingle(boolean single)
参数:
single - handle single quotes if true


Copyright © 2013. All Rights Reserved.