FileDocCategorySizeDatePackage
FrameBodyOWNE.javaAPI DocJaudiotagger 2.0.45468Wed Mar 30 16:12:02 BST 2011org.jaudiotagger.tag.id3.framebody

FrameBodyOWNE

public class FrameBodyOWNE extends AbstractID3v2FrameBody implements ID3v24FrameBody, ID3v23FrameBody
Ownership frame.

The ownership frame might be used as a reminder of a made transaction or, if signed, as proof. Note that the "USER" and "TOWN" frames are good to use in conjunction with this one. The frame begins, after the frame ID, size and encoding fields, with a 'price payed' field. The first three characters of this field contains the currency used for the transaction, encoded according to ISO-4217 alphabetic currency code. Concatenated to this is the actual price payed, as a numerical string using "." as the decimal separator. Next is an 8 character date string (YYYYMMDD) followed by a string with the name of the seller as the last field in the frame. There may only be one "OWNE" frame in a tag.

<Header for 'Ownership frame', ID: "OWNE">
Text encoding $xx
Price payed <text string> $00
Date of purch. <text string>
Seller<text string according to encoding>

For more details, please refer to the ID3 specifications:

author
: Paul Taylor
author
: Eric Farng
version
$Id: FrameBodyOWNE.java 836 2009-11-12 15:44:07Z paultaylor $

Fields Summary
Constructors Summary
public FrameBodyOWNE()
Creates a new FrameBodyOWNE datatype.

        //        this.setObject("Text Encoding", new Byte((byte) 0));
        //        this.setObject("Price Paid", "");
        //        this.setObject("Date Of Purchase", "");
        //        this.setObject("Seller", "");
    
public FrameBodyOWNE(FrameBodyOWNE body)

        super(body);
    
public FrameBodyOWNE(byte textEncoding, String pricePaid, String dateOfPurchase, String seller)
Creates a new FrameBodyOWNE datatype.

param
textEncoding
param
pricePaid
param
dateOfPurchase
param
seller

        this.setObjectValue(DataTypes.OBJ_TEXT_ENCODING, textEncoding);
        this.setObjectValue(DataTypes.OBJ_PRICE_PAID, pricePaid);
        this.setObjectValue(DataTypes.OBJ_PURCHASE_DATE, dateOfPurchase);
        this.setObjectValue(DataTypes.OBJ_SELLER_NAME, seller);
    
public FrameBodyOWNE(ByteBuffer byteBuffer, int frameSize)
Creates a new FrameBodyOWNE datatype.

param
byteBuffer
param
frameSize
throws
InvalidTagException if unable to create framebody from buffer

        super(byteBuffer, frameSize);
    
Methods Summary
public java.lang.StringgetIdentifier()
The ID3v2 frame identifier

return
the ID3v2 frame identifier for this frame type

        return ID3v24Frames.FRAME_ID_OWNERSHIP;
    
protected voidsetupObjectList()

        objectList.add(new NumberHashMap(DataTypes.OBJ_TEXT_ENCODING, this, TextEncoding.TEXT_ENCODING_FIELD_SIZE));
        objectList.add(new StringNullTerminated(DataTypes.OBJ_PRICE_PAID, this));
        objectList.add(new StringDate(DataTypes.OBJ_PURCHASE_DATE, this));
        objectList.add(new TextEncodedStringSizeTerminated(DataTypes.OBJ_SELLER_NAME, this));
    
public voidwrite(java.io.ByteArrayOutputStream tagBuffer)
If the seller name cannot be encoded using current encoder, change the encoder

        //Ensure valid for type
        setTextEncoding(ID3TextEncodingConversion.getTextEncoding(getHeader(), getTextEncoding()));

        //Ensure valid for data
        if (!((AbstractString) getObject(DataTypes.OBJ_SELLER_NAME)).canBeEncoded())
        {
            this.setTextEncoding(ID3TextEncodingConversion.getUnicodeTextEncoding(getHeader()));
        }
        super.write(tagBuffer);