|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jaudiotagger.audio.generic.AbstractTag
org.jaudiotagger.tag.asf.AsfTag
public final class AsfTag
Tag implementation for ASF.
| Nested Class Summary | |
|---|---|
private static class |
AsfTag.AsfFieldIterator
This iterator is used to iterator an Iterator with
TagField objects and returns them by casting to
AsfTagField. |
| Field Summary | |
|---|---|
static java.util.Set<AsfFieldKey> |
COMMON_FIELDS
Stores a list of field keys, which identify common fields. |
private boolean |
copyFields
|
private static java.util.EnumMap<FieldKey,AsfFieldKey> |
tagFieldToAsfField
This map contains the mapping from FieldKey to
AsfFieldKey. |
| Fields inherited from class org.jaudiotagger.audio.generic.AbstractTag |
|---|
commonNumber, fields |
| Constructor Summary | |
|---|---|
AsfTag()
Creates an empty instance. |
|
AsfTag(boolean copy)
Creates an instance and sets the field conversion property. |
|
AsfTag(Tag source,
boolean copy)
Creates an instance and copies the fields of the source into the own structure. |
|
| Method Summary | |
|---|---|
void |
addCopyright(java.lang.String copyRight)
Creates a field for copyright and adds it. |
void |
addField(TagField field)
Add field |
void |
addRating(java.lang.String rating)
Creates a field for rating and adds it. |
private void |
copyFrom(Tag source)
This method copies tag fields from the source. |
private TagField |
copyFrom(TagField source)
If isCopyingFields() is true, Creates a copy of
source, if its not empty-However, plain TagField objects can only be transformed into
binary fields using their TagField.getRawContent() method. |
AsfTagCoverField |
createArtworkField(byte[] data)
Create artwork field |
AsfTagTextField |
createCopyrightField(java.lang.String content)
Creates a field for storing the copyright. |
AsfTagCoverField |
createField(Artwork artwork)
Creates an AsfTagCoverField from given artwork |
AsfTagTextField |
createField(AsfFieldKey asfFieldKey,
java.lang.String value)
Create tag text field using ASF key Uses the correct subclass for the key. |
AsfTagTextField |
createField(FieldKey genericKey,
java.lang.String value)
Create a new field based on generic key, used internally by the library |
AsfTagTextField |
createRatingField(java.lang.String content)
Creates a field for storing the copyright. |
void |
deleteField(AsfFieldKey fieldKey)
Removes all fields which are stored to the provided field key. |
void |
deleteField(FieldKey fieldKey)
Delete any fields with this key |
java.util.List<Artwork> |
getArtworkList()
|
java.util.Iterator<AsfTagField> |
getAsfFields()
This method iterates through all stored fields. This method can only be used if this class has been created with field conversion turned on. |
java.util.List<TagField> |
getCopyright()
Returns a list of stored copyrights. |
java.util.List<TagField> |
getFields(FieldKey fieldKey)
Returns a list of TagField objects whose "id"
is the specified one. |
java.lang.String |
getFirst(FieldKey genericKey)
Retrieve the first value that exists for this generic key |
java.lang.String |
getFirstCopyright()
Returns the Copyright. |
AsfTagField |
getFirstField(FieldKey genericKey)
|
java.lang.String |
getFirstRating()
Returns the Rating. |
java.util.List<TagField> |
getRating()
Returns a list of stored ratings. |
java.lang.String |
getValue(FieldKey genericKey,
int index)
Retrieve String value of the nth tag field that exists for this generic key |
protected boolean |
isAllowedEncoding(java.lang.String enc)
Determines whether the given charset encoding may be used for the represented tagging system. |
boolean |
isCopyingFields()
If true, the copyFrom(TagField) method creates a
new AsfTagField instance and copies the content from the source.This method is utilized by addField(TagField) and
setField(TagField).So if true it is ensured that the AsfTag instance
has its own copies of fields, which cannot be modified after assignment
(which could pass some checks), and it just stores AsfTagField
objects.Only then getAsfFields() can work. |
private boolean |
isValidField(TagField field)
Check field is valid and can be added to this tag |
void |
setCopyright(java.lang.String Copyright)
Sets the copyright. |
void |
setField(TagField field)
Set field Changed:Just because field is empty it doesn't mean it should be deleted. |
void |
setRating(java.lang.String rating)
Sets the Rating. |
| Methods inherited from class org.jaudiotagger.audio.generic.AbstractTag |
|---|
addField, addField, deleteArtworkField, deleteField, getFieldCount, getFieldCountIncludingSubValues, getFields, getFields, getFirst, getFirstArtwork, getFirstField, getItem, getSubValue, hasCommonFields, hasField, isEmpty, setEncoding, setField, setField, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final java.util.Set<AsfFieldKey> COMMON_FIELDS
private static final java.util.EnumMap<FieldKey,AsfFieldKey> tagFieldToAsfField
FieldKey to
AsfFieldKey.
private final boolean copyFields
isCopyingFields()| Constructor Detail |
|---|
public AsfTag()
public AsfTag(boolean copy)
copy - look at isCopyingFields().
public AsfTag(Tag source,
boolean copy)
throws java.io.UnsupportedEncodingException
source - source to read tag fields from.copy - look at isCopyingFields().
java.io.UnsupportedEncodingException - TagField.getRawContent() which may be called| Method Detail |
|---|
public void addField(TagField field)
addField in interface TagaddField in class AbstractTagfield - The field to add.
Changed so add empty fieldspublic void addCopyright(java.lang.String copyRight)
copyRight - copyright contentpublic void addRating(java.lang.String rating)
rating - rating.private void copyFrom(Tag source)
source - source to read tag fields from.private TagField copyFrom(TagField source)
isCopyingFields() is true, Creates a copy of
source, if its not empty-TagField objects can only be transformed into
binary fields using their TagField.getRawContent() method.
source - source field to copy.
null if the field is empty (empty byte[] or blank
string}.public AsfTagCoverField createField(Artwork artwork)
AsfTagCoverField from given artwork
artwork - artwork to create a ASF field from.
public AsfTagCoverField createArtworkField(byte[] data)
data - raw image data
public AsfTagTextField createCopyrightField(java.lang.String content)
content - Copyright value.
AsfTagTextFieldpublic AsfTagTextField createRatingField(java.lang.String content)
content - Rating value.
AsfTagTextField
public AsfTagTextField createField(AsfFieldKey asfFieldKey,
java.lang.String value)
asfFieldKey - field key to create field for.value - string value for the created field.
public AsfTagTextField createField(FieldKey genericKey,
java.lang.String value)
throws KeyNotFoundException,
FieldDataInvalidException
Only textual data supported at the moment. The genericKey will be mapped to the correct implementation key and return a TagField.
createField in interface TagcreateField in class AbstractTaggenericKey - is the generic keyvalue - to store
KeyNotFoundException
FieldDataInvalidExceptionpublic void deleteField(AsfFieldKey fieldKey)
fieldKey - fields to remove.
public void deleteField(FieldKey fieldKey)
throws KeyNotFoundException
deleteField in interface TagdeleteField in class AbstractTagKeyNotFoundException
public java.util.List<TagField> getFields(FieldKey fieldKey)
throws KeyNotFoundException
TagField objects whose "id"
is the specified one.
getFields in interface TaggetFields in class AbstractTagfieldKey - The field id.
TagField objects with the given "id".
KeyNotFoundExceptionpublic java.util.List<Artwork> getArtworkList()
public java.util.Iterator<AsfTagField> getAsfFields()
public java.util.List<TagField> getCopyright()
public java.lang.String getFirst(FieldKey genericKey)
throws KeyNotFoundException
getFirst in interface TaggetFirst in class AbstractTagKeyNotFoundException
public java.lang.String getValue(FieldKey genericKey,
int index)
throws KeyNotFoundException
KeyNotFoundExceptionpublic java.lang.String getFirstCopyright()
public AsfTagField getFirstField(FieldKey genericKey)
throws KeyNotFoundException
getFirstField in interface TaggetFirstField in class AbstractTagKeyNotFoundExceptionpublic java.lang.String getFirstRating()
public java.util.List<TagField> getRating()
protected boolean isAllowedEncoding(java.lang.String enc)
isAllowedEncoding in class AbstractTagenc - charset encoding.
true if the given encoding can be used.public boolean isCopyingFields()
true, the copyFrom(TagField) method creates a
new AsfTagField instance and copies the content from the source.addField(TagField) and
setField(TagField).true it is ensured that the AsfTag instance
has its own copies of fields, which cannot be modified after assignment
(which could pass some checks), and it just stores AsfTagField
objects.getAsfFields() can work. otherwise
IllegalStateException is thrown.
private boolean isValidField(TagField field)
field - field to add
true if field may be added.public void setField(TagField field)
setField in interface TagsetField in class AbstractTagfield - The field to add.Tag.setField(org.jaudiotagger.tag.TagField)public void setCopyright(java.lang.String Copyright)
Copyright - the copyright to set.public void setRating(java.lang.String rating)
rating - the rating to set.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||