程序包 org.xmeta.util

类 UtilThing


  • public class UtilThing
    extends Object
    • 构造器详细资料

      • UtilThing

        public UtilThing()
    • 方法详细资料

      • getThingFromAttributeOrChilds

        public static Thing getThingFromAttributeOrChilds​(Thing thing,
                                                          String attributeName,
                                                          String childThingPath)
        通过模型属性获取模型定义的模型,或者通过指定的子模型的第一个子节点获取定义的模型。
        参数:
        thing - 模型
        attributeName - 属性名
        childThingPath - 子模型路径
        返回:
        模型
      • getThingFromAttributeOrChild

        public static Thing getThingFromAttributeOrChild​(Thing thing,
                                                         String attributeName,
                                                         String childThingPath)
        通过模型属性获取模型定义的模型,或者通过指定的子模型的第一个子节点获取定义的模型。
        参数:
        thing - 模型
        attributeName - 属性名
        childThingPath - 子模型路径
        返回:
        模型
      • isDescriptorEquals

        public static boolean isDescriptorEquals​(Thing descriptorThing,
                                                 String descriptor)
        判断一个模型作为描述者时是否是给定的类型,即判断这个模型的路径以及所有继承模型的路径是否是指定的descritpor。
        参数:
        descriptorThing - 描述者模型
        descriptor - 描述者
        返回:
        是否
      • isDescriptorEquals1

        public static boolean isDescriptorEquals1​(String descriptorFor,
                                                  String descriptor)
      • getThingIfNotExistsCreate

        public static Thing getThingIfNotExistsCreate​(String path,
                                                      String thingManager,
                                                      String descriptorForCreate)
        获取模型,如果不存在就创建一个。
        参数:
        path - 路径
        thingManager - 模型管理器
        descriptorForCreate - 描述者
        返回:
        模型
      • getThingIfNotExistsCreate

        public static Thing getThingIfNotExistsCreate​(String path,
                                                      String thingManager,
                                                      Thing forReplace)
        获取模型,如果不存在就用已有的模型创建一个。
        参数:
        path - 路径
        thingManager - 模型管理器
        forReplace - 是否覆盖
        返回:
        模型
      • getQuoteThing

        public static Thing getQuoteThing​(Thing thing,
                                          String attribute)
        返回引用的模型,如果属性就不存在,那么就找根模型下的子模型。如果是子模型,那么替换路径。
        参数:
        thing -
        attribute -
        返回:
      • getSelfQuoteThing

        public static Thing getSelfQuoteThing​(Thing thing,
                                              String attribute)
        返回只会连接到同一个根模型下的子模型,用在只会在模型内部连接的情况。
        参数:
        thing - 模型
        attribute - 改模型的属性名
        返回:
        所连接的模型
      • changeCoder

        public static void changeCoder​(Thing thing,
                                       String coder)
        改变一个模型的编码格式。
        参数:
        thing -
        coder -