public class Mp4Tag extends AbstractTag
commonNumber, fields
Constructor and Description |
---|
Mp4Tag() |
Modifier and Type | Method and Description |
---|---|
void |
addField(FieldKey genericKey,
String... value)
Create new field and add it to the tag, with special handling for trackNo, discNo fields as we dont want multiple
fields to be created for these fields
|
TagField |
createArtworkField(byte[] data)
Create artwork field
|
TagField |
createCompilationField(boolean origValue)
Creates isCompilation field
It is useful to have this method because it handles ensuring that the correct value to represent a boolean
is stored in the underlying field format.
|
TagField |
createField(Artwork artwork)
Create artwork field
|
TagField |
createField(FieldKey genericKey,
String... values)
Create Tag Field using generic key
This should use the correct subclass for the key
|
TagField |
createField(Mp4FieldKey mp4FieldKey,
String value)
Create Tag Field using mp4 key
Uses the correct subclass for the key
|
void |
deleteField(FieldKey genericKey)
Delete fields with this generic key
|
void |
deleteField(Mp4FieldKey mp4Key)
Delete fields with this mp4key
|
List<TagField> |
get(Mp4FieldKey mp4FieldKey)
Retrieve the values that exists for this mp4keyId (this is the internalid actually used)
|
List<String> |
getAll(FieldKey genericKey)
Maps the generic key to the specific key and return the list of values for this field as strings
|
List<Artwork> |
getArtworkList() |
List<TagField> |
getFields(FieldKey genericKey)
Maps the generic key to the mp4 key and return the list of values for this field
|
String |
getFirst(Mp4FieldKey mp4Key)
Retrieve the first value that exists for this mp4key
|
Mp4TagField |
getFirstField(FieldKey genericKey) |
Mp4TagField |
getFirstField(Mp4FieldKey mp4Key) |
String |
getValue(FieldKey genericKey,
int index)
Retrieve the indexed value that exists for this generic key
|
boolean |
hasField(FieldKey genericKey)
Determines whether the tag has at least one field with the specified field key.
|
boolean |
hasField(Mp4FieldKey mp4FieldKey) |
protected boolean |
isAllowedEncoding(Charset enc)
Determines whether the given charset encoding may be used for the
represented tagging system.
|
void |
setField(FieldKey genericKey,
String... value)
Overidden to ensure cannot have both a genre field and a custom genre field
|
void |
setField(Mp4FieldKey fieldKey,
String value)
Set mp4 field
|
void |
setField(TagField field)
Set field, special handling for track and disc because they hold two fields
|
String |
toString()
(overridden)
|
addField, addField, deleteArtworkField, deleteField, getAll, getAll, getFieldCount, getFieldCountIncludingSubValues, getFields, getFields, getFirst, getFirst, getFirstArtwork, getFirstField, getItem, hasCommonFields, hasField, isEmpty, setEncoding, setField
protected boolean isAllowedEncoding(Charset enc)
AbstractTag
isAllowedEncoding
in class AbstractTag
enc
- charset encoding.true
if the given encoding can be used.public String toString()
AbstractTag
toString
in interface Tag
toString
in class AbstractTag
Object.toString()
public boolean hasField(FieldKey genericKey)
Tag
hasField
in interface Tag
hasField
in class AbstractTag
genericKey
- public boolean hasField(Mp4FieldKey mp4FieldKey)
mp4FieldKey
- public List<TagField> getFields(FieldKey genericKey) throws KeyNotFoundException
genericKey
- TagField
objects with the given "id".KeyNotFoundException
public List<String> getAll(FieldKey genericKey) throws KeyNotFoundException
genericKey
- KeyNotFoundException
public List<TagField> get(Mp4FieldKey mp4FieldKey) throws KeyNotFoundException
mp4FieldKey
- KeyNotFoundException
public String getValue(FieldKey genericKey, int index) throws KeyNotFoundException
genericKey
- KeyNotFoundException
public String getFirst(Mp4FieldKey mp4Key) throws KeyNotFoundException
mp4Key
- KeyNotFoundException
public Mp4TagField getFirstField(FieldKey genericKey) throws KeyNotFoundException
getFirstField
in interface Tag
getFirstField
in class AbstractTag
KeyNotFoundException
public Mp4TagField getFirstField(Mp4FieldKey mp4Key) throws KeyNotFoundException
KeyNotFoundException
public void deleteField(FieldKey genericKey) throws KeyNotFoundException
deleteField
in interface Tag
deleteField
in class AbstractTag
genericKey
- KeyNotFoundException
public void deleteField(Mp4FieldKey mp4Key) throws KeyNotFoundException
mp4Key
- KeyNotFoundException
public TagField createArtworkField(byte[] data)
data
- raw image dataFieldDataInvalidException
public TagField createField(Artwork artwork) throws FieldDataInvalidException
FieldDataInvalidException
public void addField(FieldKey genericKey, String... value) throws KeyNotFoundException, FieldDataInvalidException
addField
in interface Tag
addField
in class AbstractTag
genericKey
- value
- KeyNotFoundException
FieldDataInvalidException
public TagField createField(FieldKey genericKey, String... values) throws KeyNotFoundException, FieldDataInvalidException
createField
in interface Tag
createField
in class AbstractTag
genericKey
- values
- KeyNotFoundException
FieldDataInvalidException
public void setField(FieldKey genericKey, String... value) throws KeyNotFoundException, FieldDataInvalidException
setField
in interface Tag
setField
in class AbstractTag
genericKey
- value
- KeyNotFoundException
FieldDataInvalidException
public void setField(Mp4FieldKey fieldKey, String value) throws KeyNotFoundException, FieldDataInvalidException
fieldKey
- value
- KeyNotFoundException
FieldDataInvalidException
public void setField(TagField field)
setField
in interface Tag
setField
in class AbstractTag
field
- Tag.setField(org.jaudiotagger.tag.TagField)
public TagField createField(Mp4FieldKey mp4FieldKey, String value) throws KeyNotFoundException, FieldDataInvalidException
mp4FieldKey
- value
- KeyNotFoundException
FieldDataInvalidException
public List<Artwork> getArtworkList()
public TagField createCompilationField(boolean origValue) throws KeyNotFoundException, FieldDataInvalidException
Tag
KeyNotFoundException
FieldDataInvalidException
Copyright © 2005–2020 jthink.net. All rights reserved.