JML

net.sf.jml
Class MsnObject

java.lang.Object
  extended by net.sf.jml.MsnObject

public final class MsnObject
extends Object

This class represents a MsnObject from the MSN protocol.

Author:
Angel Barragán Chacón

Field Summary
static int TYPE_ADDIN_SAVED_STATE
          Type for Add in saved state.
static int TYPE_BACKGROUND
          Type for background.
static int TYPE_CUSTOM_EMOTICON
          Type for custom emoticons.
static int TYPE_DISPLAY_PICTURE
          Type for siaplay picture.
static int TYPE_DYNAMIC_DISPLAY_PICTURE
          Type for dinamic display picture.
static int TYPE_MSNP15_LOCATION
          Type for Location
static int TYPE_VOICE_CLIP
          Type for voice clips.
static int TYPE_WINKS
          Type for winks.
 
Method Summary
 boolean equals(Object object)
           
 String getCreator()
          Retrieve the creator for this MsnObject.
 String getFriendly()
          Retrieves the friendly name of the MsnObject.
static MsnObject getInstance(String creator, byte[] picture)
          Create an instance of MsnObject for a display picture.
static MsnObject getInstance(String creator, String pictureFileName)
          Create an instance of MsnObject for a display picture.
 String getLocation()
          Retrieves the location for this MsnObject.
 byte[] getMsnObj()
          Retrieves the MsnObject local data.
 String getSha1c()
          Retrieves the SHA value for the MsnObject properties data.
 String getSha1d()
          Retrieves the SHA of the MsnObject data.
 long getSize()
          Retrieves the size of the MsnObject data.
 int getType()
          Retrieves the type for the MsnObject.
 int hashCode()
           
static MsnObject parseMsnObject(String msnObject)
          Create a MsnObject instance from its representation as XML.
 void setCreator(String creator)
          Sets the creator for this MsnObject.
 void setFriendly(String friendly)
          Sets the friendly name for the MsnObject.
 void setLocation(String location)
          Sets the location for this MsnObject.
 void setSha1c(String sha1c)
          Sets the new SHA value for the MsnObject properties data.
 void setSha1d(String sha1d)
          Sets the new SHA value for the MsnObject data.
 void setSize(long size)
          Sets the new size for the MsnObject.
 void setType(int type)
          Sets the type for this MsnObject.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

TYPE_CUSTOM_EMOTICON

public static final int TYPE_CUSTOM_EMOTICON
Type for custom emoticons.

See Also:
Constant Field Values

TYPE_DISPLAY_PICTURE

public static final int TYPE_DISPLAY_PICTURE
Type for siaplay picture.

See Also:
Constant Field Values

TYPE_BACKGROUND

public static final int TYPE_BACKGROUND
Type for background.

See Also:
Constant Field Values

TYPE_DYNAMIC_DISPLAY_PICTURE

public static final int TYPE_DYNAMIC_DISPLAY_PICTURE
Type for dinamic display picture.

See Also:
Constant Field Values

TYPE_WINKS

public static final int TYPE_WINKS
Type for winks.

See Also:
Constant Field Values

TYPE_VOICE_CLIP

public static final int TYPE_VOICE_CLIP
Type for voice clips.

See Also:
Constant Field Values

TYPE_ADDIN_SAVED_STATE

public static final int TYPE_ADDIN_SAVED_STATE
Type for Add in saved state.

See Also:
Constant Field Values

TYPE_MSNP15_LOCATION

public static final int TYPE_MSNP15_LOCATION
Type for Location

See Also:
Constant Field Values
Method Detail

getInstance

public static MsnObject getInstance(String creator,
                                    byte[] picture)
                             throws JmlException
Create an instance of MsnObject for a display picture.

Parameters:
creator - Creator of the MsnObject.
picture - Data for the MsnObject.
Returns:
Instance of the MsnObject.
Throws:
JmlException - If an error happens.

getInstance

public static MsnObject getInstance(String creator,
                                    String pictureFileName)
                             throws JmlException
Create an instance of MsnObject for a display picture.

Parameters:
creator - Creator of the MsnObject.
pictureFileName - Filename where the picture object is stored.
Returns:
Instance of the MsnObject.
Throws:
JmlException - If an error happens.

parseMsnObject

public static MsnObject parseMsnObject(String msnObject)
Create a MsnObject instance from its representation as XML.

Parameters:
msnObject - XML representation of the MsnObject.
Returns:
Instance of the MsnObject.

getCreator

public String getCreator()
Retrieve the creator for this MsnObject.

Returns:
Cretor for this MsnObject.

setCreator

public void setCreator(String creator)
Sets the creator for this MsnObject.

Parameters:
creator - New creator for this MsnObject.

getSize

public long getSize()
Retrieves the size of the MsnObject data.

Returns:
MsnObject data size.

setSize

public void setSize(long size)
Sets the new size for the MsnObject.

Parameters:
size - the size to set Size for the data of the MsnObject.

getType

public int getType()
Retrieves the type for the MsnObject.

Returns:
Type for the MsnObject.

setType

public void setType(int type)
Sets the type for this MsnObject.

Parameters:
type - Type for the MsnObject.

getLocation

public String getLocation()
Retrieves the location for this MsnObject.

Returns:
Location for this MsnObject.

setLocation

public void setLocation(String location)
Sets the location for this MsnObject.

Parameters:
location - Location for this MsnObject.

getFriendly

public String getFriendly()
Retrieves the friendly name of the MsnObject.

Returns:
Friendly name for the MsnObject.

setFriendly

public void setFriendly(String friendly)
Sets the friendly name for the MsnObject.

Parameters:
friendly - New Friendly name.

getSha1d

public String getSha1d()
Retrieves the SHA of the MsnObject data.

Returns:
SHA value.

setSha1d

public void setSha1d(String sha1d)
Sets the new SHA value for the MsnObject data.

Parameters:
sha1d - the sha1d to set.

getSha1c

public String getSha1c()
Retrieves the SHA value for the MsnObject properties data.

Returns:
SHA value.

setSha1c

public void setSha1c(String sha1c)
Sets the new SHA value for the MsnObject properties data.

Parameters:
sha1c - the sha1c to set.

getMsnObj

public byte[] getMsnObj()
Retrieves the MsnObject local data.

Returns:
MsnObject local data.

toString

public String toString()
Overrides:
toString in class Object
See Also:
Object.toString()

equals

public boolean equals(Object object)
Overrides:
equals in class Object
See Also:
Object.equals(Object)

hashCode

public int hashCode()
Overrides:
hashCode in class Object

JML