Methods Summary |
---|
public java.lang.Object | clone()Copies the current instance.
AttributeField retval = new AttributeField();
if (attribute != null)
retval.attribute = (NameValue) this.attribute.clone();
return retval;
|
public java.lang.String | encode()Gets the string encoded version of this object.
String encoded_string = ATTRIBUTE_FIELD;
if (attribute != null) encoded_string += attribute.encode();
return encoded_string + Separators.NEWLINE;
|
public NameValue | getAttribute()Gets the current attribute.
return attribute;
|
public java.lang.String | getName()Returns the name of this attribute
NameValue nameValue = getAttribute();
if (nameValue == null)
return null;
else {
String name = nameValue.getName();
if (name == null)
return null;
else return name;
}
|
public java.lang.String | getValue()Returns the value of this attribute.
NameValue nameValue = getAttribute();
if (nameValue == null)
return null;
else {
Object value = nameValue.getValue();
if (value == null)
return null;
else if (value instanceof String)
return (String)value;
else
return value.toString();
}
|
public boolean | hasValue()Determines if this attribute has an associated value.
NameValue nameValue = getAttribute();
if (nameValue == null)
return false;
else {
Object value = nameValue.getValue();
if (value == null)
return false;
else return true;
}
|
public void | setAttribute(NameValue a)Sets the attribute member.
attribute = a;
attribute.setSeparator(Separators.COLON);
|
public void | setName(java.lang.String name)Sets the id of this attribute.
if (name == null)
throw new SdpException("The name is null");
else {
NameValue nameValue = getAttribute();
if (nameValue == null)
nameValue = new NameValue();
nameValue.setName(name);
setAttribute(nameValue);
}
|
public void | setValue(java.lang.String value)Sets the value of this attribute.
if (value == null)
throw new SdpException("The value is null");
else {
NameValue nameValue = getAttribute();
if (nameValue == null)
nameValue = new NameValue();
nameValue.setValue(value);
setAttribute(nameValue);
}
|
public java.lang.String | toString()Returns the encoded string of the attribute field contents.
return this.encode();
|