01: /*
02: * Attribute.java
03: *
04: * Created on December 18, 2001, 10:55 AM
05: */
06:
07: package javax.sdp;
08:
09: /**
10: * An Attribute represents an a= fields contained within either a MediaDescription or a
11: * SessionDescription.
12: *
13: * An Attribute can be just an identity/name or a name-value pair.
14: *
15: * Here are some examples:
16: *
17: * a=recvonly
18: * identifies a rcvonly attribute with just a name
19: * a=rtpmap:0 PCMU/8000
20: * identifies the media format 0 has having the value PCMU/8000.
21: *
22: * If a value is present, it must be preceeded by the : character.
23: * @author deruelle
24: * @version 1.0
25: */
26: public interface Attribute extends Field {
27:
28: /** Returns the name of this attribute
29: * @throws SdpParseException if the name is not well formatted.
30: * @return a String identity.
31: */
32: public String getName() throws SdpParseException;
33:
34: /** Sets the id of this attribute.
35: * @param name the string name/id of the attribute.
36: * @throws SdpException if the name is null
37: */
38: public void setName(String name) throws SdpException;
39:
40: /** Determines if this attribute has an associated value.
41: * @throws SdpParseException if the value is not well formatted.
42: * @return true if the attribute has a value.
43: */
44: public boolean hasValue() throws SdpParseException;
45:
46: /** Returns the value of this attribute.
47: * @throws SdpParseException if the value is not well formatted.
48: * @return the value; null if the attribute has no associated value.
49: */
50: public String getValue() throws SdpParseException;
51:
52: /** Sets the value of this attribute.
53: * @param value the - attribute value
54: * @throws SdpException if the value is null.
55: */
56: public void setValue(String value) throws SdpException;
57:
58: }
|