FileDocCategorySizeDatePackage
AsfTagField.javaAPI DocJaudiotagger 2.0.44410Wed Mar 30 16:12:10 BST 2011org.jaudiotagger.tag.asf

AsfTagField

public class AsfTagField extends Object implements Cloneable, org.jaudiotagger.tag.TagField
This class encapsulates a {@link org.jaudiotagger.audio.asf.data.MetadataDescriptor}and provides access to it.
The metadata descriptor used for construction is copied.
author
Christian Laireiter (liree)

Fields Summary
protected org.jaudiotagger.audio.asf.data.MetadataDescriptor
toWrap
This descriptor is wrapped.
Constructors Summary
public AsfTagField(org.jaudiotagger.tag.asf.AsfFieldKey field)
Creates a tag field.

param
field the ASF field that should be represented.

        assert field != null;
        this.toWrap = new MetadataDescriptor(field.getHighestContainer(), field
                .getFieldName(), MetadataDescriptor.TYPE_STRING);
    
public AsfTagField(org.jaudiotagger.audio.asf.data.MetadataDescriptor source)
Creates an instance.

param
source The descriptor which should be represented as a {@link TagField}.

        assert source != null;
        // XXX Copy ? maybe not really.
        this.toWrap = source.createCopy();
    
public AsfTagField(String fieldKey)
Creates a tag field.

param
fieldKey The field identifier to use.

        assert fieldKey != null;
        this.toWrap = new MetadataDescriptor(AsfFieldKey.getAsfFieldKey(
                fieldKey).getHighestContainer(), fieldKey,
                MetadataDescriptor.TYPE_STRING);
    
Methods Summary
public java.lang.Objectclone()
{@inheritDoc}

        return super.clone();
    
public voidcopyContent(org.jaudiotagger.tag.TagField field)
{@inheritDoc}

        throw new UnsupportedOperationException("Not implemented yet.");
    
public org.jaudiotagger.audio.asf.data.MetadataDescriptorgetDescriptor()
Returns the wrapped metadata descriptor (which actually stores the values).

return
the wrapped metadata descriptor

        return this.toWrap;
    
public java.lang.StringgetId()
{@inheritDoc}

        return this.toWrap.getName();
    
public byte[]getRawContent()
{@inheritDoc}

        return this.toWrap.getRawData();
    
public voidisBinary(boolean value)
{@inheritDoc}

        if (!value && isBinary()) {
            throw new UnsupportedOperationException("No conversion supported.");
        }
        this.toWrap.setBinaryValue(this.toWrap.getRawData());
    
public booleanisBinary()
{@inheritDoc}

        return this.toWrap.getType() == MetadataDescriptor.TYPE_BINARY;
    
public booleanisCommon()
{@inheritDoc}

        // HashSet is safe against null comparison
        return AsfTag.COMMON_FIELDS.contains(AsfFieldKey
                .getAsfFieldKey(getId()));
    
public booleanisEmpty()
{@inheritDoc}

        return this.toWrap.isEmpty();
    
public java.lang.StringtoString()
{@inheritDoc}

        return this.toWrap.getString();