Methods Summary |
---|
public void | accept(ID3Visitor oID3Visitor)
oID3Visitor.visitWXXXUrlLinkID3V2Frame(this);
|
public boolean | equals(java.lang.Object oOther)
if ((oOther == null) || (!(oOther instanceof WXXXUrlLinkID3V2Frame)))
{
return false;
}
WXXXUrlLinkID3V2Frame oOtherWXXX = (WXXXUrlLinkID3V2Frame)oOther;
return (m_sDescription.equals(oOtherWXXX.m_sDescription) &&
m_oTextEncoding.equals(oOtherWXXX.m_oTextEncoding) &&
m_sURL.equals(oOtherWXXX.m_sURL));
|
public java.lang.String | getDescription()Get the description of the URL stored in this frame.
return m_sDescription;
|
protected byte[] | getFrameId()
return "WXXX".getBytes();
|
public TextEncoding | getTextEncoding()Get the text encoding used for the description in this frame.
return m_oTextEncoding;
|
public java.lang.String | getUrl()Get the URL stored in this frame.
return m_sURL;
|
public void | setDescriptionAndUrl(java.lang.String sDescription, java.lang.String sUrl)Set the description of the URL to be stored in this frame, along with the actual URL.
TextEncoding oOrigTextEncoding = m_oTextEncoding;
String sOrigDescription = m_sDescription;
String sOrigURL = m_sURL;
if (sDescription == null)
{
throw new ID3Exception("Description cannot be null in WXXX frame.");
}
if (sUrl == null)
{
throw new ID3Exception("Url cannot be null in WXXX frame.");
}
m_oTextEncoding = TextEncoding.getDefaultTextEncoding();
m_sDescription = sDescription;
m_sURL = sUrl;
// try this update, and reverse it if it generates and error
try
{
notifyID3Observers();
}
catch (ID3Exception e)
{
m_oTextEncoding = oOrigTextEncoding;
m_sDescription = sOrigDescription;
m_sURL = sOrigURL;
throw e;
}
|
public void | setDescriptionAndUrl(java.lang.String sDescription, java.net.URL oURL)Set the description of the URL to be stored in this frame, along with the actual URL.
TextEncoding oOrigTextEncoding = m_oTextEncoding;
String sOrigDescription = m_sDescription;
String sOrigURL = m_sURL;
if (sDescription == null)
{
throw new ID3Exception("Description cannot be null in WXXX frame.");
}
if (oURL == null)
{
throw new ID3Exception("URL cannot be null in WXXX frame.");
}
m_oTextEncoding = TextEncoding.getDefaultTextEncoding();
m_sDescription = sDescription;
m_sURL = oURL.toExternalForm();
// try this update, and reverse it if it generates and error
try
{
notifyID3Observers();
}
catch (ID3Exception e)
{
m_oTextEncoding = oOrigTextEncoding;
m_sDescription = sOrigDescription;
m_sURL = sOrigURL;
throw e;
}
|
public void | setTextEncoding(TextEncoding oTextEncoding)Set the text encoding to be used for the description in this frame.
if (oTextEncoding == null)
{
throw new NullPointerException("Text encoding cannot be null.");
}
m_oTextEncoding = oTextEncoding;
|
public java.lang.String | toString()
return "User-defined URL: Description=[" + m_sDescription + "], URL=[" + m_sURL + "]";
|
protected void | writeBody(ID3DataOutputStream oIDOS)
oIDOS.writeUnsignedByte(m_oTextEncoding.getEncodingValue());
oIDOS.write(m_sDescription.getBytes(m_oTextEncoding.getEncodingString()));
// null separating content descriptor from lyrics
if (m_oTextEncoding.equals(TextEncoding.ISO_8859_1))
{
oIDOS.writeUnsignedByte(0);
}
else
{
oIDOS.writeUnsignedByte(0);
oIDOS.writeUnsignedByte(0);
}
// url
oIDOS.write(m_sURL.getBytes());
|