public class VorbisCommentTag extends AbstractTag
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_VENDOR |
private static java.util.EnumMap<FieldKey,VorbisCommentFieldKey> |
tagFieldToOggField |
commonNumber, fields
Constructor and Description |
---|
VorbisCommentTag()
Only used within Package, hidden because it doesnt set Vendor
which should be done when created by end user
|
Modifier and Type | Method and Description |
---|---|
void |
addField(Artwork artwork)
Add artwork field
|
void |
addField(java.lang.String vorbisCommentKey,
java.lang.String value)
Create and add field with name of vorbisCommentkey
|
void |
addField(TagField field)
Add Field
|
TagField |
createCompilationField(boolean value)
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,
java.lang.String value)
Create Tag Field using generic key
|
TagField |
createField(java.lang.String vorbisCommentFieldKey,
java.lang.String value)
Create Tag Field using ogg key
This method is provided to allow you to create key of any value because VorbisComment allows
arbitary keys.
|
TagField |
createField(VorbisCommentFieldKey vorbisCommentFieldKey,
java.lang.String value)
Create Tag Field using ogg key
|
private MetadataBlockDataPicture |
createMetadataBlockDataPicture(Artwork artwork)
Create MetadataBlockPicture field, this is the preferred way of storing artwork in VorbisComment tag now but
has to be base encoded to be stored in VorbisComment
|
static VorbisCommentTag |
createNewTag()
Use to construct a new tag properly initialized
|
void |
deleteArtworkField()
Delete all instance of artwork Field
|
void |
deleteField(FieldKey genericKey)
Delete fields with this generic key
|
void |
deleteField(VorbisCommentFieldKey vorbisCommentFieldKey)
Delete fields with this vorbisCommentFieldKey
|
java.util.List<TagField> |
get(VorbisCommentFieldKey vorbisCommentKey)
Retrieve the first value that exists for this vorbis comment key
|
java.util.List<java.lang.String> |
getAll(FieldKey genericKey)
Maps the generic key to the ogg key and return the list of values for this field as strings
|
byte[] |
getArtworkBinaryData()
Retrieve artwork raw data when using the deprecated COVERART format
|
java.util.List<Artwork> |
getArtworkList() |
java.lang.String |
getArtworkMimeType()
Retrieve artwork mimeType when using deprecated COVERART format
|
java.util.List<TagField> |
getFields(FieldKey genericKey)
Maps the generic key to the ogg key and return the list of values for this field
|
java.lang.String |
getFirst(VorbisCommentFieldKey vorbisCommentKey)
Retrieve the first value that exists for this vorbis comment key
|
TagField |
getFirstField(FieldKey genericKey) |
java.lang.String |
getValue(FieldKey genericKey,
int index)
Retrieve String value of the nth tag field that exists for this generic key
|
java.lang.String |
getVendor() |
boolean |
hasField(FieldKey genericKey)
Determines whether the tag has at least one field with the specified field key.
|
boolean |
hasField(VorbisCommentFieldKey vorbisFieldKey) |
protected boolean |
isAllowedEncoding(java.lang.String enc)
Determines whether the given charset encoding may be used for the
represented tagging system.
|
boolean |
isEmpty()
Is this tag empty
|
void |
setArtworkField(byte[] data,
java.lang.String mimeType)
Deprecated.
|
void |
setField(Artwork artwork)
Create and set artwork field
|
void |
setField(java.lang.String vorbisCommentKey,
java.lang.String value)
Create and set field with name of vorbisCommentkey
|
void |
setVendor(java.lang.String vendor)
Set the vendor, known as the encoder generally
We dont want this to be blank, when written to file this field is written to a different location
to all other fields but user of library can just reat it as another field
|
java.lang.String |
toString()
(overridden)
|
addField, deleteField, getAll, getFieldCount, getFieldCountIncludingSubValues, getFields, getFields, getFirst, getFirst, getFirstArtwork, getFirstField, getItem, hasCommonFields, hasField, setEncoding, setField, setField
private static java.util.EnumMap<FieldKey,VorbisCommentFieldKey> tagFieldToOggField
public static final java.lang.String DEFAULT_VENDOR
VorbisCommentTag()
public static VorbisCommentTag createNewTag()
public java.lang.String getVendor()
public void setVendor(java.lang.String vendor)
vendor
- protected boolean isAllowedEncoding(java.lang.String enc)
AbstractTag
isAllowedEncoding
in class AbstractTag
enc
- charset encoding.true
if the given encoding can be used.public java.lang.String toString()
AbstractTag
toString
in interface Tag
toString
in class AbstractTag
Object.toString()
public TagField createField(FieldKey genericKey, java.lang.String value) throws KeyNotFoundException, FieldDataInvalidException
createField
in interface Tag
createField
in class AbstractTag
genericKey
- is the generic keyvalue
- to storeKeyNotFoundException
FieldDataInvalidException
public TagField createField(VorbisCommentFieldKey vorbisCommentFieldKey, java.lang.String value) throws KeyNotFoundException, FieldDataInvalidException
vorbisCommentFieldKey
- value
- KeyNotFoundException
FieldDataInvalidException
public TagField createField(java.lang.String vorbisCommentFieldKey, java.lang.String value)
vorbisCommentFieldKey
- value
- public java.util.List<TagField> getFields(FieldKey genericKey) throws KeyNotFoundException
genericKey
- TagField
objects with the given "id".KeyNotFoundException
public java.util.List<java.lang.String> getAll(FieldKey genericKey) throws KeyNotFoundException
genericKey
- KeyNotFoundException
public java.util.List<TagField> get(VorbisCommentFieldKey vorbisCommentKey) throws KeyNotFoundException
vorbisCommentKey
- KeyNotFoundException
public java.lang.String getValue(FieldKey genericKey, int index) throws KeyNotFoundException
Tag
KeyNotFoundException
public java.lang.String getFirst(VorbisCommentFieldKey vorbisCommentKey) throws KeyNotFoundException
vorbisCommentKey
- KeyNotFoundException
public boolean hasField(FieldKey genericKey)
Tag
hasField
in interface Tag
hasField
in class AbstractTag
genericKey
- public boolean hasField(VorbisCommentFieldKey vorbisFieldKey)
vorbisFieldKey
- public void deleteField(FieldKey genericKey) throws KeyNotFoundException
deleteField
in interface Tag
deleteField
in class AbstractTag
genericKey
- KeyNotFoundException
public void deleteField(VorbisCommentFieldKey vorbisCommentFieldKey) throws KeyNotFoundException
vorbisCommentFieldKey
- KeyNotFoundException
public byte[] getArtworkBinaryData()
public java.lang.String getArtworkMimeType()
public boolean isEmpty()
Overridden because check for size of one because there is always a vendor tag unless just created an empty vorbis tag as part of flac tag in which case size could be zero
isEmpty
in interface Tag
isEmpty
in class AbstractTag
true
if tag contains no field.Tag.isEmpty()
public void addField(TagField field)
Overidden because there can only be one vendor set
addField
in interface Tag
addField
in class AbstractTag
field
-
Changed so add empty fields
public TagField getFirstField(FieldKey genericKey) throws KeyNotFoundException
getFirstField
in interface Tag
getFirstField
in class AbstractTag
KeyNotFoundException
public java.util.List<Artwork> getArtworkList()
private MetadataBlockDataPicture createMetadataBlockDataPicture(Artwork artwork) throws FieldDataInvalidException
FieldDataInvalidException
public TagField createField(Artwork artwork) throws FieldDataInvalidException
artwork
- FieldDataInvalidException
public void setField(Artwork artwork) throws FieldDataInvalidException
setField
in interface Tag
setField
in class AbstractTag
FieldDataInvalidException
public void addField(Artwork artwork) throws FieldDataInvalidException
addField
in interface Tag
addField
in class AbstractTag
artwork
- FieldDataInvalidException
@Deprecated public void setArtworkField(byte[] data, java.lang.String mimeType)
data
- raw image datamimeType
- mimeType of data
public void setField(java.lang.String vorbisCommentKey, java.lang.String value) throws KeyNotFoundException, FieldDataInvalidException
vorbisCommentKey
- value
- KeyNotFoundException
FieldDataInvalidException
public void addField(java.lang.String vorbisCommentKey, java.lang.String value) throws KeyNotFoundException, FieldDataInvalidException
vorbisCommentKey
- value
- KeyNotFoundException
FieldDataInvalidException
public void deleteArtworkField() throws KeyNotFoundException
deleteArtworkField
in interface Tag
deleteArtworkField
in class AbstractTag
KeyNotFoundException
public TagField createCompilationField(boolean value) throws KeyNotFoundException, FieldDataInvalidException
Tag
KeyNotFoundException
FieldDataInvalidException
Copyright © 2005-2013 java.net. All Rights Reserved.