程序包 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 -