public abstract class AbstractID3v2Frame extends AbstractTagFrame implements TagTextField
Modifier and Type | Class and Description |
---|---|
class |
AbstractID3v2Frame.StatusFlags |
Modifier and Type | Field and Description |
---|---|
protected int |
frameSize |
protected String |
identifier |
protected static String |
TYPE_FRAME |
protected static String |
TYPE_FRAME_SIZE |
protected static String |
UNSUPPORTED_ID |
frameBody
logger
Modifier | Constructor and Description |
---|---|
protected |
AbstractID3v2Frame()
Create an empty frame
|
|
AbstractID3v2Frame(AbstractID3v2Frame frame)
Create a frame based on another frame
|
|
AbstractID3v2Frame(AbstractID3v2FrameBody body)
Create a frame based on a body
|
|
AbstractID3v2Frame(String identifier)
Create a new frame with empty body based on identifier
|
Modifier and Type | Method and Description |
---|---|
void |
copyContent(TagField field)
This method copies the data of the given field to the current data.
|
void |
createStructure()
Return String Representation of frame
|
boolean |
equals(Object obj)
Returns true if this datatype and its body equals the argument and its
body.
|
String |
getContent()
Returns the content of the field.
|
Charset |
getEncoding()
Returns the current used charset encoding.
|
org.jaudiotagger.tag.id3.AbstractID3v2Frame.EncodingFlags |
getEncodingFlags() |
protected abstract int |
getFrameHeaderSize() |
protected abstract int |
getFrameIdSize() |
protected abstract int |
getFrameSizeSize() |
String |
getId()
Return the frame identifier, this only identifies the frame it does not provide a unique
key, when using frames such as TXXX which are used by many fields *
|
String |
getIdentifier()
Return the frame identifier
|
protected String |
getLoggingFilename()
Retrieve the logging filename to be used in debugging
|
byte[] |
getRawContent()
This method delivers the binary representation of the fields data in
order to be directly written to the file.
|
AbstractID3v2Frame.StatusFlags |
getStatusFlags() |
void |
isBinary(boolean b)
This method will set the field to represent binary data.
Some implementations may support conversions. As of now (Octobre 2005) there is no implementation really using this method to perform useful operations. |
boolean |
isEmpty()
Determines whether the content of the field is empty.
|
protected boolean |
isPadding(byte[] buffer) |
protected AbstractID3v2FrameBody |
readBody(String identifier,
AbstractID3v2FrameBody body)
This creates a new body based of type identifier but populated by the data
in the body.
|
protected AbstractID3v2FrameBody |
readBody(String identifier,
ByteBuffer byteBuffer,
int frameSize)
Read the frame body from the specified file via the buffer
|
protected AbstractID3v2FrameBody |
readEncryptedBody(String identifier,
ByteBuffer byteBuffer,
int frameSize)
Read the frameBody when frame marked as encrypted
|
protected String |
readIdentifier(ByteBuffer byteBuffer)
Get the next frame id, throwing an exception if unable to do this and check against just having padded data
|
void |
setContent(String content)
Sets the content of the field.
|
protected void |
setLoggingFilename(String loggingFilename)
Set logging filename when construct tag for read from file
|
abstract void |
write(ByteArrayOutputStream tagBuffer) |
getBody, isSubsetOf, setBody, toString
getSize, read
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
setEncoding
protected static final String TYPE_FRAME
protected static final String TYPE_FRAME_SIZE
protected static final String UNSUPPORTED_ID
protected String identifier
protected int frameSize
protected AbstractID3v2Frame()
public AbstractID3v2Frame(AbstractID3v2Frame frame)
frame
- public AbstractID3v2Frame(AbstractID3v2FrameBody body)
body
- public AbstractID3v2Frame(String identifier)
identifier
- protected abstract int getFrameIdSize()
protected abstract int getFrameSizeSize()
protected abstract int getFrameHeaderSize()
protected String getLoggingFilename()
protected void setLoggingFilename(String loggingFilename)
loggingFilename
- public String getId()
public String getIdentifier()
getIdentifier
in class AbstractTagItem
public void copyContent(TagField field)
TagField
copyContent
in interface TagField
field
- The field containing the data to be taken.protected AbstractID3v2FrameBody readEncryptedBody(String identifier, ByteBuffer byteBuffer, int frameSize) throws InvalidFrameException, InvalidDataTypeException
identifier
- byteBuffer
- frameSize
- InvalidFrameException
InvalidDataTypeException
InvalidTagException
protected boolean isPadding(byte[] buffer)
protected AbstractID3v2FrameBody readBody(String identifier, ByteBuffer byteBuffer, int frameSize) throws InvalidFrameException, InvalidDataTypeException
identifier
- the frame identifierbyteBuffer
- to read the frame body fromframeSize
- InvalidFrameException
- unable to construct a framebody from the dataInvalidDataTypeException
protected String readIdentifier(ByteBuffer byteBuffer) throws PaddingException, InvalidFrameException
byteBuffer
- PaddingException
InvalidFrameException
protected AbstractID3v2FrameBody readBody(String identifier, AbstractID3v2FrameBody body) throws InvalidFrameException
identifier
- to determine type of the framebody
- InvalidFrameException
- if unable to construct a framebody for the identifier and body provided.public byte[] getRawContent()
TagField
getRawContent
in interface TagField
public abstract void write(ByteArrayOutputStream tagBuffer)
public void isBinary(boolean b)
TagField
public boolean isEmpty()
TagField
public AbstractID3v2Frame.StatusFlags getStatusFlags()
public org.jaudiotagger.tag.id3.AbstractID3v2Frame.EncodingFlags getEncodingFlags()
public void createStructure()
public boolean equals(Object obj)
AbstractTagFrame
getSubId
id string.equals
in class AbstractTagFrame
obj
- datatype to determine equality ofpublic String getContent()
getContent
in interface TagTextField
public Charset getEncoding()
getEncoding
in interface TagTextField
public void setContent(String content)
setContent
in interface TagTextField
content
- fields content.Copyright © 2005–2020 jthink.net. All rights reserved.