Package org.sblim.slp
Class ServiceLocationAttribute
- java.lang.Object
-
- org.sblim.slp.ServiceLocationAttribute
-
- All Implemented Interfaces:
java.io.Serializable
public class ServiceLocationAttribute extends java.lang.Object implements java.io.Serializable
Service location attribute- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ServiceLocationAttribute(java.lang.String pString)
Construct a service location attribute from a String.ServiceLocationAttribute(java.lang.String pId, java.util.Vector pValues)
Construct a service location attribute.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
static java.lang.String
escapeId(java.lang.String pId)
Returns an escaped version of the id parameter, suitable for inclusion in a query.static java.lang.String
escapeValue(java.lang.Object pValue)
Returns a String containing the escaped value parameter as a string, suitable for inclusion in a query.java.lang.String
getId()
Returns the attribute's name.java.util.Vector
getValues()
Returns a cloned vector of attribute values, or null if the attribute is a keyword attribute.int
hashCode()
java.lang.String
toString()
-
-
-
Constructor Detail
-
ServiceLocationAttribute
public ServiceLocationAttribute(java.lang.String pId, java.util.Vector pValues)
Construct a service location attribute. Errors in the id or values vector result in an IllegalArgumentException.- Parameters:
pId
- The attribute name. The String can consist of any Unicode character.pValues
- A Vector of one or more attribute values. Vector contents must be uniform in type and one of Integer, String, Boolean, or byte[]. If the attribute is a keyword attribute, then the parameter should be null. String values can consist of any Unicode character.
-
ServiceLocationAttribute
public ServiceLocationAttribute(java.lang.String pString) throws ServiceLocationException
Construct a service location attribute from a String.- Parameters:
pString
- The string to parse- Throws:
ServiceLocationException
- When the string parsing failed
-
-
Method Detail
-
escapeId
public static java.lang.String escapeId(java.lang.String pId)
Returns an escaped version of the id parameter, suitable for inclusion in a query. Any reserved characters as specified in [7] are escaped using UTF-8 encoding. If any characters in the tag are illegal, throws IllegalArgumentException.- Parameters:
pId
- The attribute id to escape. ServiceLocationException is thrown if any characters are illegal for an attribute tag.- Returns:
- The escaped version
-
escapeValue
public static java.lang.String escapeValue(java.lang.Object pValue)
Returns a String containing the escaped value parameter as a string, suitable for inclusion in a query. If the parameter is a string, any reserved characters as specified in [7] are escaped using UTF-8 encoding. If the parameter is a byte array, then the escaped string begins with the nonUTF-8 sequence `\ff` and the rest of the string consists of the escaped bytes, which is the encoding for opaques. If the value parameter is a Boolean or Integer, then the returned string contains the object converted into a string. If the value is any type other than String, Integer, Boolean or byte[], an IllegalArgumentException is thrown.- Parameters:
pValue
- The attribute value to be converted into a string and escaped.- Returns:
- The escaped value
-
getValues
public java.util.Vector getValues()
Returns a cloned vector of attribute values, or null if the attribute is a keyword attribute. If the attribute is single-valued, then the vector contains only one object.- Returns:
- The value vector
-
getId
public java.lang.String getId()
Returns the attribute's name.- Returns:
- The name (id)
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-