com.tencent.mm.sdk.modelmsg
Class WXAppExtendObject

java.lang.Object
  extended by com.tencent.mm.sdk.modelmsg.WXAppExtendObject
All Implemented Interfaces:
WXMediaMessage.IMediaObject

public class WXAppExtendObject
extends java.lang.Object
implements WXMediaMessage.IMediaObject

Derived class of WXMediaMessage.IMediaObject; used to describe a application object.
WXMediaMessage.IMediaObject的派生类,用于描述一个第三方应用对象

Used as the unique identifier of applications; returned by WeChat after authentication. See SendAuth.Req NOTE: extInfo, filePath and fileData can not be null at that same time.

filePath and fileData are not used at the same time.

外部应用本身用来标识其请求的唯一性,验证完成后,将由微信终端回传,参考SendAuth.Req

注意:extInfo, filePath和fileData不能同时为空

filePath和fileData不会同时被使用


Field Summary
 java.lang.String extInfo
          
Extend text data for applications

NOTE: 2KB at most.

 byte[] fileData
          
File binary data for applications NOTE: Content size should be within 10MB
供第三方使用的文件二进制数据 注意:内容大小不能超过10MB
 java.lang.String filePath
          
Local directory of the file provided for applications NOTE: The length should be within 10KB and content size within 10MB.
 
Fields inherited from interface com.tencent.mm.sdk.modelmsg.WXMediaMessage.IMediaObject
TYPE_APPDATA, TYPE_EMOJI, TYPE_FILE, TYPE_IMAGE, TYPE_MUSIC, TYPE_PRODUCT, TYPE_TEXT, TYPE_UNKNOWN, TYPE_URL, TYPE_VIDEO
 
Constructor Summary
WXAppExtendObject()
           
WXAppExtendObject(java.lang.String extInfo, byte[] fileData)
          
Constructor
构造函数
WXAppExtendObject(java.lang.String extInfo, java.lang.String filePath)
          
Constructor
构造函数
 
Method Summary
 boolean checkArgs()
          
Check validity of parameters of MediaObject
检查该MediaObject各个参数的合法性
 void serialize(Bundle data)
          
Serialize member variables to bundle object
将成员变量序列化到bundle对象中
 int type()
          
Load type of the current media object
获取当前媒体对象的类型
 void unserialize(Bundle data)
          
Deserialize bundle object to initialize member variables
通过反序列化bundle对象初始化成员变量
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

extInfo

public java.lang.String extInfo
Extend text data for applications

NOTE: 2KB at most.

供第三方使用的扩展文本数据

注意:限制长度不超过2KB


filePath

public java.lang.String filePath
Local directory of the file provided for applications

NOTE: The length should be within 10KB and content size within 10MB.
供第三方使用的文件本地路径

注意:长度不能超过10KB,内容大小不能超过10MB


fileData

public byte[] fileData
File binary data for applications

NOTE: Content size should be within 10MB
供第三方使用的文件二进制数据

注意:内容大小不能超过10MB

Constructor Detail

WXAppExtendObject

public WXAppExtendObject()

WXAppExtendObject

public WXAppExtendObject(java.lang.String extInfo,
                         byte[] fileData)
Constructor
构造函数

Parameters:
extInfo -
Extend text data provided for applications
供第三方使用的扩展文本数据
fileData -
File binary data provided for applications
供第三方使用的文件二进制数据

WXAppExtendObject

public WXAppExtendObject(java.lang.String extInfo,
                         java.lang.String filePath)
Constructor
构造函数

Parameters:
extInfo -
Extend text data provided for applications
供第三方使用的扩展文本数据
filePath -
File directory provided for applications
供第三方使用的文件本地路径
Method Detail

serialize

public void serialize(Bundle data)
Description copied from interface: WXMediaMessage.IMediaObject
Serialize member variables to bundle object
将成员变量序列化到bundle对象中

Specified by:
serialize in interface WXMediaMessage.IMediaObject
Parameters:
data -
Target bundle object
目标bundle对象

unserialize

public void unserialize(Bundle data)
Description copied from interface: WXMediaMessage.IMediaObject
Deserialize bundle object to initialize member variables
通过反序列化bundle对象初始化成员变量

Specified by:
unserialize in interface WXMediaMessage.IMediaObject
Parameters:
data -
Data source bundle object
数据源bundle对象

type

public int type()
Description copied from interface: WXMediaMessage.IMediaObject
Load type of the current media object
获取当前媒体对象的类型

Specified by:
type in interface WXMediaMessage.IMediaObject
Returns:
type
Type of the current media object
当前媒体对象的类型

checkArgs

public boolean checkArgs()
Description copied from interface: WXMediaMessage.IMediaObject
Check validity of parameters of MediaObject
检查该MediaObject各个参数的合法性

Specified by:
checkArgs in interface WXMediaMessage.IMediaObject
Returns:
True if all parameters are valid.
如果参数均合法,返回true