org.apache.lenya.util
Class Query
java.lang.Object
org.apache.lenya.util.Query
public class Query
- extends java.lang.Object
Utility class to analyze a query string of the form
key1=value1&key2=value2&...
.
Access is not thread-safe.
Invalid parts (not a valid key-value-pair) are omitted.
Constructor Summary |
Query(java.lang.String string)
Creates a query object with default values for the pair and key-value
delimiters. |
Query(java.lang.String string,
java.lang.String pairDelimiter,
java.lang.String keyValueDelimiter)
Creates a query object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
PAIR_DELIMITER
protected static final java.lang.String PAIR_DELIMITER
- See Also:
- Constant Field Values
KEY_VALUE_DELIMITER
protected static final java.lang.String KEY_VALUE_DELIMITER
- See Also:
- Constant Field Values
Query
public Query(java.lang.String string)
- Creates a query object with default values for the pair and key-value
delimiters.
- Parameters:
string
- The query string.
Query
public Query(java.lang.String string,
java.lang.String pairDelimiter,
java.lang.String keyValueDelimiter)
- Creates a query object.
- Parameters:
string
- The string.pairDelimiter
- The delimiter between key-value pairs.keyValueDelimiter
- The delimiter between key and value.
getValue
public java.lang.String getValue(java.lang.String key)
getValue
public java.lang.String getValue(java.lang.String key,
java.lang.String defaultValue)
getKeyValueDelimiter
public java.lang.String getKeyValueDelimiter()
getPairDelimiter
public java.lang.String getPairDelimiter()
removeValue
public void removeValue(java.lang.String key)
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
Copyright © 1999-2006 Apache Software Foundation. All Rights Reserved.