|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jaudiotagger.tag.mp4.Mp4TagField org.jaudiotagger.tag.mp4.field.Mp4TagTextField
public class Mp4TagTextField
Represents a single text field
Mp4 metadata normally held as follows:
MP4Box Parent contains :length (includes length of data child) (4 bytes) :name (4 bytes) :child with :length (4 bytes) :name 'Data' (4 bytes) :atom version (1 byte) :atom type flags (3 bytes) :null field (4 bytes) :data
Note:This class is initilized with the child data atom only, the parent data has already been processed, this may change as it seems that code should probably be enscapulated into this. Whereas the raw content returned by the getRawContent() contais the byte data for parent and child.
Field Summary | |
---|---|
protected java.lang.String |
content
|
protected int |
dataSize
|
Fields inherited from class org.jaudiotagger.tag.mp4.Mp4TagField |
---|
id, logger, parentHeader |
Constructor Summary | |
---|---|
Mp4TagTextField(java.lang.String id,
java.nio.ByteBuffer data)
Construct from File |
|
Mp4TagTextField(java.lang.String id,
java.lang.String content)
Construct new Field |
Method Summary | |
---|---|
protected void |
build(java.nio.ByteBuffer data)
Processes the data and sets the position of the data buffer to just after the end of this fields data ready for processing next field. |
void |
copyContent(TagField field)
This method copies the data of the given field to the current data. |
java.lang.String |
getContent()
Returns the content of the field. |
protected byte[] |
getDataBytes()
|
java.lang.String |
getEncoding()
Returns the current used charset encoding. |
Mp4FieldType |
getFieldType()
|
boolean |
isBinary()
Determines whether the represented field contains (is made up of) binary data, instead of text data. Software can identify fields to be displayed because they are human readable if this method returns false . |
boolean |
isEmpty()
Determines whether the content of the field is empty. |
void |
setContent(java.lang.String s)
Sets the content of the field. |
void |
setEncoding(java.lang.String s)
Sets the charset encoding used by the field. |
java.lang.String |
toString()
This method returns a human readable description of the fields contents. For text fields it should be the text itself. |
Methods inherited from class org.jaudiotagger.tag.mp4.Mp4TagField |
---|
getId, getIdBytes, getRawContent, getRawContentDataOnly, isBinary, isCommon |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.jaudiotagger.tag.TagField |
---|
getId, getRawContent, isBinary, isCommon |
Field Detail |
---|
protected int dataSize
protected java.lang.String content
Constructor Detail |
---|
public Mp4TagTextField(java.lang.String id, java.nio.ByteBuffer data) throws java.io.UnsupportedEncodingException
id
- parent iddata
- atom data
java.io.UnsupportedEncodingException
public Mp4TagTextField(java.lang.String id, java.lang.String content)
id
- parent idcontent
- data atom dataMethod Detail |
---|
protected void build(java.nio.ByteBuffer data) throws java.io.UnsupportedEncodingException
Mp4TagField
build
in class Mp4TagField
java.io.UnsupportedEncodingException
public void copyContent(TagField field)
TagField
copyContent
in interface TagField
field
- The field containing the data to be taken.public java.lang.String getContent()
TagTextField
getContent
in interface TagTextField
protected byte[] getDataBytes() throws java.io.UnsupportedEncodingException
getDataBytes
in class Mp4TagField
java.io.UnsupportedEncodingException
public Mp4FieldType getFieldType()
getFieldType
in class Mp4TagField
public java.lang.String getEncoding()
TagTextField
getEncoding
in interface TagTextField
public boolean isBinary()
TagField
false
.
isBinary
in interface TagField
true
if field represents binary data (not human
readable).public boolean isEmpty()
TagField
isEmpty
in interface TagField
true
if no data is stored (or empty String).public void setContent(java.lang.String s)
TagTextField
setContent
in interface TagTextField
s
- fields content.public void setEncoding(java.lang.String s)
TagTextField
setEncoding
in interface TagTextField
s
- charset.public java.lang.String toString()
TagField
toString
in interface TagField
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |