1 /*
2 * jSDP: A Java implementation of SDP protocol Copyright (C) 2007 Claudio Di
3 * Vita
4 */
5 package net.sourceforge.jsdp;
6
7 import java.io.Serializable;
8
9 /**
10 * A field is a line of text in the SDP message. Each field contain information
11 * specific some aspect of the session. There are several field types: each
12 * field type is identified by a unique character and has a fixed format for its
13 * content.
14 *
15 * @since 0.1.0
16 *
17 * @version 1.0
18 *
19 * @author <a href="mailto:cdivita@users.sourceforge.net">Claudio Di Vita</a>
20 */
21 public interface Field extends Cloneable, Serializable {
22
23 /** The field terminator characters sequence: <b>\r\n</b> */
24 public static final String END_OF_FIELD = "\r\n";
25
26 /** The attribute field char type character: <b>a</b> */
27 public static final char ATTRIBUTE_FIELD = 'a';
28
29 /** The bandwith field char type character: <b>b</b> */
30 public static final char BANDWITH_FIELD = 'b';
31
32 /** The connection field char type character: <b>c</b> */
33 public static final char CONNECTION_FIELD = 'c';
34
35 /** The email field char type character: <b>e</b> */
36 public static final char EMAIL_FIELD = 'e';
37
38 /** The information field char type character: <b>i</b> */
39 public static final char INFORMATION_FIELD = 'i';
40
41 /** The encryption key field char type character: <b>k</b> */
42 public static final char KEY_FIELD = 'k';
43
44 /** The media field char type character: <b>m</b> */
45 public static final char MEDIA_FIELD = 'm';
46
47 /** The origin field char type character: <b>o</b> */
48 public static final char ORIGIN_FIELD = 'o';
49
50 /** The phone field char type character: <b>p</b> */
51 public static final char PHONE_FIELD = 'p';
52
53 /** The repeat time field char type character: <b>r</b> */
54 public static final char REPEAT_TIME_FIELD = 'r';
55
56 /** The session name field char type character: <b>s</b> */
57 public static final char SESSION_NAME_FIELD = 's';
58
59 /** The time field char type character: <b>t</b> */
60 public static final char TIME_FIELD = 't';
61
62 /** The timezone field char type character: <b>z</b> */
63 public static final char TIMEZONE_FIELD = 'z';
64
65 /** The uri field char type character: <b>u</b> */
66 public static final char URI_FIELD = 'u';
67
68 /** The information field char type character: <b>v</b> */
69 public static final char VERSION_FIELD = 'v';
70
71 /**
72 * Returns a clone of this field.
73 *
74 * @return a clone of this field
75 */
76 public Object clone();
77
78 /**
79 * Returns the type character for the field.
80 *
81 * @return the field type character
82 */
83 public char getType();
84
85 /**
86 * Returns a string representation of the field. The representation has the
87 * form: <b><i><type></i>=<i><value></i></b>.
88 *
89 * @return the string representation of the field
90 */
91 public String toString();
92 }