JAIN SIP API
v1.1 - 23rd June 2003

javax.sip.header
Interface AcceptLanguageHeader

All Superinterfaces:
java.lang.Cloneable, Header, Parameters, java.io.Serializable

public interface AcceptLanguageHeader
extends Parameters, Header

The Accept-Language header field is used in requests to indicate the preferred languages for reason phrases, session descriptions, or status responses carried as message bodies in the response. If no Accept-Language header field is present, the server SHOULD assume all languages are acceptable to the client. The q-value is used in a similar manner to AcceptHeader to indicate degrees of preference.

For Example:
Accept-Language: da, en-gb;q=0.8, en;q=0.7

See Also:
AcceptHeader

Field Summary
static java.lang.String NAME
          Name of AcceptLanguageHeader
 
Method Summary
 java.util.Locale getAcceptLanguage()
          Gets the language value of the AcceptLanguageHeader.
 float getQValue()
          Gets q-value of the media-range in AcceptLanguageHeader.
 void setAcceptLanguage(java.util.Locale language)
          Sets the language parameter of this AcceptLanguageHeader.
 void setQValue(float qValue)
          Sets q-value for media-range in AcceptLanguageHeader.
 
Methods inherited from interface javax.sip.header.Parameters
getParameter, getParameterNames, removeParameter, setParameter
 
Methods inherited from interface javax.sip.header.Header
clone, equals, getName, toString
 

Field Detail

NAME

public static final java.lang.String NAME
Name of AcceptLanguageHeader

See Also:
Constant Field Values
Method Detail

getQValue

public float getQValue()
Gets q-value of the media-range in AcceptLanguageHeader. A value of -1 indicates theq-value is not set.

Returns:
q-value of media-range, -1 if q-value is not set.

setQValue

public void setQValue(float qValue)
               throws InvalidArgumentException
Sets q-value for media-range in AcceptLanguageHeader. Q-values allow the user to indicate the relative degree of preference for that media-range, using the qvalue scale from 0 to 1. If no q-value is present, the media-range should be treated as having a q-value of 1.

Parameters:
qValue - - the new float value of the q-value, a value of -1 resets the qValue.
Throws:
InvalidArgumentException - if the q parameter value is not -1 or between 0 and 1.

getAcceptLanguage

public java.util.Locale getAcceptLanguage()
Gets the language value of the AcceptLanguageHeader.

Returns:
the language Locale value of this AcceptLanguageHeader

setAcceptLanguage

public void setAcceptLanguage(java.util.Locale language)
Sets the language parameter of this AcceptLanguageHeader.

Parameters:
language - - the new Locale value of the language of AcceptLanguageHeader

JAIN SIP API
v1.1 - 23rd June 2003

If you have any comments, please mail them to JAIN-SIP-INTEREST@java.sun.com after subscribing to the
JAIN-SIP-Interest list at http://archives.java.sun.com
Copyright - 2003 Sun Microsystems