程序包 org.xmeta.codes

类 JsonThingCoder

    • 构造器详细资料

      • JsonThingCoder

        public JsonThingCoder()
    • 方法详细资料

      • encode

        public void encode​(Thing thing,
                           OutputStream out)
        从接口复制的说明: ThingCoder
        编码一个模型到输出流中。
        指定者:
        encode 在接口中 ThingCoder
        参数:
        thing - 模型
        out - 输出流
      • decode

        public void decode​(Thing thing,
                           InputStream in,
                           long lastModifyed)
        从接口复制的说明: ThingCoder
        解码一个输入流到模型中。
        指定者:
        decode 在接口中 ThingCoder
        参数:
        thing - 模型
        in - 输入流
        lastModifyed - 如果为0表示解码时不能获取时间,可能需要在格式中去解
      • decodeIndex

        public void decodeIndex​(ThingIndex thingIndex,
                                InputStream in,
                                long lastModifyed)
        从接口复制的说明: ThingCoder
        只解码用于索引模型的部分,模型索引通常用于UI的导航中。
        指定者:
        decodeIndex 在接口中 ThingCoder
        参数:
        thingIndex - 模型索引
        in - 输入流
        lastModifyed - 如果为0表示解码时不能获取时间,可能需要在格式中去解
      • getType

        public String getType()
        从接口复制的说明: ThingCoder
        返回编码器的类型,通常是文件的后缀名。
        指定者:
        getType 在接口中 ThingCoder
        返回:
        类型
      • acceptType

        public boolean acceptType​(String type)
        从接口复制的说明: ThingCoder
        是否是制定类型的编码者。
        指定者:
        acceptType 在接口中 ThingCoder
        参数:
        type - 类型
        返回:
        如果是返回ture,否则返回false
      • getCodeTypes

        public String[] getCodeTypes()
        从接口复制的说明: ThingCoder
        返回编码器所支持的所有类型。
        指定者:
        getCodeTypes 在接口中 ThingCoder
        返回:
        编码器所支持的所有类型。