📄 sipaddress.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.4.2_10) on Wed Feb 28 12:31:09 CET 2007 -->
<TITLE>
SipAddress (JSR180 SIP API for J2ME)
</TITLE>
<META NAME="keywords" CONTENT="javax.microedition.sip.SipAddress class">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
parent.document.title="SipAddress (JSR180 SIP API for J2ME)";
}
</SCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A><A HREF="#skip-navbar_top" title="Skip navigation links"></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
PREV CLASS
<A HREF="../../../javax/microedition/sip/SipHeader.html" title="class in javax.microedition.sip"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../index.html" target="_top"><B>FRAMES</B></A>
<A HREF="SipAddress.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A><!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
javax.microedition.sip</FONT>
<BR>
Class SipAddress</H2>
<PRE>
java.lang.Object
<IMG SRC="../../../resources/inherit.gif" ALT="extended by"><B>javax.microedition.sip.SipAddress</B>
</PRE>
<HR>
<DL>
<DT>public class <B>SipAddress</B><DT>extends java.lang.Object</DL>
<P>
<tt>SipAddress</tt> provides a generic SIP address parser. This class can be used to parse either full SIP name addresses like: <tt>BigGuy <sip:UserA@atlanta.com></tt> or SIP/SIPS URIs like: <tt>sip:+13145551111@ss1.atlanta.com;user=phone</tt> or <tt>sips:alice@atlanta.com;transport=tcp</tt>. <p> Correspondingly, valid SIP addresses can be constructed with this class. <p> <tt>SipAddress</tt> has following functional requirements: <br> - <tt>SipAddress</tt> does not escape address strings. <br> - <tt>SipAddress</tt> ignores headers part of SIP URI. <br> - <tt>SipAddress</tt> valid scheme format is the same as defined in SIP BNF for absolute URI. <br> - The valid Contact address <code>"*"</code> is accepted in <tt>SipAddress</tt>. In this case <code>toString()</code> and <code>getURI()</code> return <code>"*"</code> all other accessor methods return <tt>null</tt> (or 0 as appropriate). This special address is immutable, no properties can be changed after the creation of this object. <p> It is not mandated that the implementation of <tt>SipAddress</tt> does any semantic checks in addition to ABNF syntax validation. Refer to RFC 3261 (page 149-151) for a list of possible semantic checks that an implementation MAY provide. <p> Reference, SIP 3261 [1] p.153 Example SIP and SIPS URIs and p.228 <tt>name-addr</tt> in SIP BNF specification.
<P>
<P>
<HR>
<P>
<!-- ======== NESTED CLASS SUMMARY ======== -->
<!-- =========== FIELD SUMMARY =========== -->
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<A NAME="constructor_summary"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../javax/microedition/sip/SipAddress.html#SipAddress(java.lang.String)">SipAddress</A></B>(java.lang.String address)</CODE>
<BR>
Construct a new <tt>SipAddress</tt> from string.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../javax/microedition/sip/SipAddress.html#SipAddress(java.lang.String, java.lang.String)">SipAddress</A></B>(java.lang.String displayName, java.lang.String URI)</CODE>
<BR>
Construct a new <tt>SipAddress</tt> from display name and URI.</TD>
</TR>
</TABLE>
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Method Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/sip/SipAddress.html#getDisplayName()">getDisplayName</A></B>()</CODE>
<BR>
Returns the display name of SIP address.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/sip/SipAddress.html#getHost()">getHost</A></B>()</CODE>
<BR>
Returns the host part of the SIP address.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/sip/SipAddress.html#getParameter(java.lang.String)">getParameter</A></B>(java.lang.String name)</CODE>
<BR>
Returns the value associated with the named URI parameter.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.lang.String[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/sip/SipAddress.html#getParameterNames()">getParameterNames</A></B>()</CODE>
<BR>
Returns a String array of all parameter names.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/sip/SipAddress.html#getPort()">getPort</A></B>()</CODE>
<BR>
Returns the port number of the SIP address.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/sip/SipAddress.html#getScheme()">getScheme</A></B>()</CODE>
<BR>
Returns the scheme of SIP address.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/sip/SipAddress.html#getURI()">getURI</A></B>()</CODE>
<BR>
Returns the URI part of the address (without parameters).</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/sip/SipAddress.html#getUser()">getUser</A></B>()</CODE>
<BR>
Returns the user part of SIP address.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/sip/SipAddress.html#removeParameter(java.lang.String)">removeParameter</A></B>(java.lang.String name)</CODE>
<BR>
Removes the named URI parameter.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/sip/SipAddress.html#setDisplayName(java.lang.String)">setDisplayName</A></B>(java.lang.String name)</CODE>
<BR>
Sets the display name.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/sip/SipAddress.html#setHost(java.lang.String)">setHost</A></B>(java.lang.String host)</CODE>
<BR>
Sets the host part of the SIP address.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/sip/SipAddress.html#setParameter(java.lang.String, java.lang.String)">setParameter</A></B>(java.lang.String name, java.lang.String value)</CODE>
<BR>
Sets the named URI parameter to the specified value.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/sip/SipAddress.html#setPort(int)">setPort</A></B>(int port)</CODE>
<BR>
Sets the port number of the SIP address.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/sip/SipAddress.html#setScheme(java.lang.String)">setScheme</A></B>(java.lang.String scheme)</CODE>
<BR>
Sets the scheme of SIP address.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/sip/SipAddress.html#setURI(java.lang.String)">setURI</A></B>(java.lang.String URI)</CODE>
<BR>
Sets the URI part of the SIP address (without parameters).</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/sip/SipAddress.html#setUser(java.lang.String)">setUser</A></B>(java.lang.String user)</CODE>
<BR>
Sets the user part of SIP address.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/sip/SipAddress.html#toString()">toString</A></B>()</CODE>
<BR>
Returns a fully qualified SIP address, with display name, URI and URI parameters.</TD>
</TR>
</TABLE>
<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TD><B>Methods inherited from class java.lang.Object</B></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>equals, getClass, hashCode, notify, notifyAll, wait, wait, wait</CODE></TD>
</TR>
</TABLE>
<P>
<!-- ============ FIELD DETAIL =========== -->
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TD>
</TR>
</TABLE>
<A NAME="SipAddress(java.lang.String)"><!-- --></A><H3>
SipAddress</H3>
<PRE>
public <B>SipAddress</B>(java.lang.String address)</PRE>
<DL>
<DD>Construct a new <tt>SipAddress</tt> from string. The string can be either name address: <p> <tt>Display Name <sip:user:password@host:port;uri-parameters></tt> <p> or plain SIP URI: <p> <tt>sip:user:password@host:port;uri-parameters</tt> <p> or the special address value: <code>"*"</code>.
<P>
<DT><B>Parameters:</B><DD><CODE>address</CODE> - SIP address as String<DT><B>Throws:</B><DD><CODE>java.lang.NullPointerException</CODE> - if address is null.<DD><CODE>java.lang.IllegalArgumentException</CODE> - if there was an error in parsing the address.</DL>
<HR>
<A NAME="SipAddress(java.lang.String, java.lang.String)"><!-- --></A><H3>
SipAddress</H3>
<PRE>
public <B>SipAddress</B>(java.lang.String displayName, java.lang.String URI)</PRE>
<DL>
<DD>Construct a new <tt>SipAddress</tt> from display name and URI.
<P>
<DT><B>Parameters:</B><DD><CODE>displayName</CODE> - user display name. If null or empty String then no display name is set.<DD><CODE>URI</CODE> - SIP URI<DT><B>Throws:</B><DD><CODE>java.lang.NullPointerException</CODE> - if URI is null.<DD><CODE>java.lang.IllegalArgumentException</CODE> - if there was an error in parsing the arguments.</DL>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -