public interface ThingCoder
| 限定符和类型 | 字段和说明 |
|---|---|
static String |
CHILDREN
特殊属性名,用于保存模型的字节列表
|
static String |
DESCRIPTORS
描述者属性
|
static String |
EXTENDS
继承属性
|
static String |
LAST_MODIFIED
特殊属性名,用于保存模型的最后修改日期
|
static String |
XMETA_ID
特殊属性名,用于保存模型的节点ID
|
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
acceptType(String type)
是否是制定类型的编码者。
|
void |
decode(Thing thing,
InputStream in,
long lastModifyed)
解码一个输入流到事物中。
|
void |
decodeIndex(ThingIndex thingIndex,
InputStream in,
long lastModifyed)
只解码用于索引事物的部分,事物索引通常用于UI的导航中。
|
void |
encode(Thing thing,
OutputStream out)
编码一个事物到输出流中。
|
String[] |
getCodeTypes()
返回编码器所支持的所有类型。
|
String |
getType()
返回编码器的类型,通常是文件的后缀名。
|
void encode(Thing thing, OutputStream out)
thing - 事物out - 输出流void decode(Thing thing, InputStream in, long lastModifyed)
thing - 事物in - 输入流lastModifyed - 如果为0表示解码时不能获取时间,可能需要在格式中去解void decodeIndex(ThingIndex thingIndex, InputStream in, long lastModifyed)
thingIndex - 事物索引in - 输入流lastModifyed - 如果为0表示解码时不能获取时间,可能需要在格式中去解String getType()
String[] getCodeTypes()
boolean acceptType(String type)
type - 类型Copyright © 2022 xworker.org. All rights reserved.