程序包 org.xmeta.util
类 UtilThing
- java.lang.Object
-
- org.xmeta.util.UtilThing
-
public class UtilThing extends Object
-
-
构造器概要
构造器 构造器 说明 UtilThing()
-
方法概要
所有方法 静态方法 具体方法 修饰符和类型 方法 说明 static voidchangeCoder(Thing thing, String coder)改变一个模型的编码格式。static ThinggetQuoteThing(Thing thing, String attribute)返回引用的模型,如果属性就不存在,那么就找根模型下的子模型。static ThinggetSelfQuoteThing(Thing thing, String attribute)返回只会连接到同一个根模型下的子模型,用在只会在模型内部连接的情况。static ThinggetThingFromAttributeOrChild(Thing thing, String attributeName, String childThingPath)通过模型属性获取模型定义的模型,或者通过指定的子模型的第一个子节点获取定义的模型。static ThinggetThingFromAttributeOrChilds(Thing thing, String attributeName, String childThingPath)通过模型属性获取模型定义的模型,或者通过指定的子模型的第一个子节点获取定义的模型。static ThinggetThingIfNotExistsCreate(String path, String thingManager, String descriptorForCreate)获取模型,如果不存在就创建一个。static ThinggetThingIfNotExistsCreate(String path, String thingManager, Thing forReplace)获取模型,如果不存在就用已有的模型创建一个。static booleanisDescriptorEquals(Thing descriptorThing, String descriptor)判断一个模型作为描述者时是否是给定的类型,即判断这个模型的路径以及所有继承模型的路径是否是指定的descritpor。static booleanisDescriptorEquals1(String descriptorFor, String descriptor)
-
-
-
方法详细资料
-
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- 改模型的属性名- 返回:
- 所连接的模型
-
-