net.sourceforge.jsdp
Class Uri

java.lang.Object
  extended by net.sourceforge.jsdp.Uri
All Implemented Interfaces:
Serializable, Cloneable, Field

public class Uri
extends Object
implements Field

An Uri represents a u=<field value> field contained in a SDP message. The uri field should be a pointer to additional information about the conference.

Since:
0.1.0
Version:
1.0
Author:
Claudio Di Vita
See Also:
Serialized Form

Field Summary
protected  URL url
          The uri value
 
Fields inherited from interface net.sourceforge.jsdp.Field
ATTRIBUTE_FIELD, BANDWITH_FIELD, CONNECTION_FIELD, EMAIL_FIELD, END_OF_FIELD, INFORMATION_FIELD, KEY_FIELD, MEDIA_FIELD, ORIGIN_FIELD, PHONE_FIELD, REPEAT_TIME_FIELD, SESSION_NAME_FIELD, TIME_FIELD, TIMEZONE_FIELD, URI_FIELD, VERSION_FIELD
 
Constructor Summary
protected Uri()
          Creates a new Uri.
  Uri(String url)
          Creates a new Uri.
  Uri(URL url)
          Creates a new Uri.
 
Method Summary
 Object clone()
          Returns a clone of this field.
 char getType()
          Returns the type character for the field.
 String getURL()
          Returns the resource url.
static Uri parse(String field)
          Parse an input string and constructs the equivalent uri field.
 void setURL(String url)
          Sets the uri value.
 void setURL(URL url)
          Sets the uri value.
 String toString()
          Returns a string representation of the field.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

url

protected URL url
The uri value

Constructor Detail

Uri

protected Uri()
Creates a new Uri.


Uri

public Uri(String url)
    throws SDPException
Creates a new Uri.

Parameters:
url - the uri value
Throws:
SDPException - if the value specified is a not valid uri

Uri

public Uri(URL url)
Creates a new Uri.

Parameters:
url - the resource url
Method Detail

parse

public static Uri parse(String field)
                 throws SDPParseException
Parse an input string and constructs the equivalent uri field.

Parameters:
field - the string to parse
Returns:
a new Uri instance
Throws:
SDPParseException - if an error occurs while parsing

clone

public Object clone()
Returns a clone of this field.

Specified by:
clone in interface Field
Overrides:
clone in class Object
Returns:
a clone of this field

getType

public char getType()
Returns the type character for the field.

Specified by:
getType in interface Field
Returns:
the field type character: u

getURL

public String getURL()
Returns the resource url.

Returns:
an url

setURL

public void setURL(String url)
            throws IllegalArgumentException,
                   SDPException
Sets the uri value.

Parameters:
url - the resource url
Throws:
IllegalArgumentException - if the url is null
SDPException - if the value specified is a not valid uri

setURL

public void setURL(URL url)
            throws IllegalArgumentException
Sets the uri value.

Parameters:
url - the resource url
Throws:
IllegalArgumentException - if the url is null

toString

public String toString()
Returns a string representation of the field. The representation has the form: u=<uri>.

Specified by:
toString in interface Field
Overrides:
toString in class Object
Returns:
the string representation of the field


Copyright © 2004-2008. All Rights Reserved.