类的使用
org.xmeta.Thing
使用Thing的程序包
程序包
说明
-
org.xmeta中Thing的使用
修饰符和类型方法说明把自己拷贝一个新的模型到指定的模型管理器的指定目录下。MetaThing.createAttribute(String name) MetaThing.createThing(String name) Thing.detach()克隆一个新模型,新的模型是瞬态的。Thing.detach(boolean detachToTransient) 已过时。Thing.getActionThing(String name) 获得指定动作的模型定义。Thing.getAttributeDescriptor(String name) 根据指定的属性名称获取该属性的描述者。Thing.getChildAt(int index) 返回指定索引位置的子节点,如果超出范围返回null。Thing.getChildBy(Thing refChild, int index) 获取参考子节点的相对位置的子节点,首先找到参考子节点的位置索引,然后和目标index相加获得最终的索引位置。Thing.getClassThing()Thing.getDescriptor()返回模型的主要的描述者。Thing.getParent()返回本模型的父模型。Thing.getQuotedThing(String attribute) 返回属性所指向的引用的模型,如果不存在替换为根模型的路径当前的根模型开始寻找。Thing.getRoot()返回本模型的最根级(顶层)父模型,如果当前模型已经是根模型,那么返回自身。Action.getThing()通过模型的名称获得当前目录下的模型。获取模型。通过指定的子模型的路径获取一个子模型。ThingActionListenerProvider.getThing()通过模型的名称取得模型。通过模型的路径来访问具体的模型。通过模型的路径获取指定的模型,如果存在那么使用给定的descriptor创建模型,并保存到指定的thingManager下。World.loadThingFromClasspath(String thingPath) 从类的路径中装载模型。修饰符和类型方法说明Thing.getActionsThings()Thing.getActionThings()返回本模型的所有的动作定义,包括自身定义的、描述者定义的和继承定义的。Thing.getActionThings(String name) 获取一个模型的指定动作的所有定义。Thing.getAllAttributesDescriptors()取本模型的所有描述者所定义属性描述列表。Thing.getAllChilds()获得所有的直接第一级子模型,包括继承的模型的子模型。Thing.getAllChilds(String thingName) 根据描述者的名称来获取所有符合的子模型,包括继承的子模型。Thing.getAllChildsDescriptors()获取子模型的描述者列表,返回本模型的所有描述者所定义的子模型的描述列表。Thing.getAllDescriptors()返回本模型所有的描述者列表,包括描述者继承的模型。Thing.getAllExtends()返回模型的所有继承模型列表,包括继承的继承...。Thing.getAttributesDescriptors()根获取模型属性描述列表,只返回第一个描述者的属性描述列表。Thing.getChildren()返回本模型的直接子模型,不包含继承的子模型。Thing.getChildren(String thingName) 根据描述者的名称来获取所有符合的子模型,不包括继承的子模型。Thing.getChilds()返回本模型的直接子模型,不包含继承的子模型。根据描述者的名称来获取所有符合的子模型,不包括继承的子模型。Thing.getChildsDescriptors()获取子模型的描述者列表,只返回第一个描述者所定义的子模型的描述列表。Thing.getChildsIterator()返回遍历所有的子节点遍历器。Thing.getClasses()Bindings.getContexts()Thing.getDescriptors()返回本模型定义的的所有描述者的列表。Thing.getExtends()返回本模型的继承模型列表。ActionContext.getThings()返回调用动作的模型列表,最开始的是堆栈的底部,最后的堆栈的顶部的模型。Category.getThings()获得当前目录下的模型列表。返回指定模型的列表。取得指定目录下的模型列表。根据模型描述者取得指定目录下的模型列表。Category.iterator(boolean includeChildCategory) 遍历当前目录下的所有模型。通过指定的描述者名称遍历当前目录下的所有模型。指定目录遍历该目录下的模型。指定模型的描述者遍历指定目录下的模型。修饰符和类型方法说明void添加一个子模型。voidvoidvoid在指定的索引位置添加一个子模型。voidThing.addDescriptor(int index, Thing descriptor) 在指定位置添加一个描述者。void在指定位置添加一个继承模型。voidThing.changeChildIndex(Thing child, int index, int moveStep) 改变一个子模型的位置索引。void模型改变后触发的事件。void认知另一模型并把认知结果作为自己的一部分。voidThingCoder.decode(Thing thing, InputStream in, long lastModifyed) 解码一个输入流到模型中。protected voidActionListenerExecutor.doOnDoAction(Thing thing, String actionName, Action action, ActionContext actionContext, Map<String, Object> params) protected voidActionListenerExecutor.doOnDoActionFinished(Thing thing, String actionName, Action action, ActionContext actionContext, Map<String, Object> params, Object result) voidThingCoder.encode(Thing thing, OutputStream out) 编码一个模型到输出流中。static Index查找指定模型的索引。通过模型获得一个动作。World.getActionClass(Thing actionThing, ActionContext actionContext) 返回动作类,通常是动作模型对应的类,有些动作可能没有对应类。Thing.getChildBy(Thing refChild, int index) 获取参考子节点的相对位置的子节点,首先找到参考子节点的位置索引,然后和目标index相加获得最终的索引位置。protected voidThing.initChildMetadata(Thing child) 初始化子模型的元数据。boolean根据指定的描述者来判断该模型是否这个指定描述者所描述的模型。voidThingManagerListener.loaded(ThingManager thingManager, Thing thing) 当一个模型被载入时触发此事件。voidActionListener.onDoAction(Thing thing, String actionName, Action action, ActionContext actionContext, Map<String, Object> params, ActionListenerExecutor executor) 模型执行自己的动作前触发。voidActionListener.onDoActionFinished(Thing thing, String actionName, Action action, ActionContext actionContext, Map<String, Object> params, ActionListenerExecutor executor, Object result) 模型执行自己的动作结束。voidboolean从模型管理者中移除一个模型。voidThing.removeChild(Thing child) 删除指定的子模型。void模型已删除后的触发的事件,此方法是调用模型自身的remove()方法后才触发的事件。voidThingManagerListener.removed(ThingManager thingManager, Thing thing) 当一个模型被删除是触发此事件。voidThing.removeDescriptor(Thing descriptor) 从本模型的描述者列表中移除指定的描述者。voidThing.removeExtend(Thing extend) 从本模型的继承列表中移除指定的继承模型。void使用新的模型来覆盖当前模型。boolean保存一个模型。voidThingManagerListener.saved(ThingManager thingManager, Thing thing) 当一个模型被保存时触发此事件。voidBindings.setActionListener(Thing actionListener) 设置动作监听器模型。voidvoid设置父节点。限定符构造器说明构造函数,传入定义动作的模型。DelayInitTask(Thing thing, byte type, boolean forece) 使用指定的描述者来创建一个瞬态模型。ThingActionListenerProvider(Thing thing) ThingMetadata(Thing thing) 构造函数 -
org.xmeta.annotation中Thing的使用
返回Thing的org.xmeta.annotation中的方法 -
org.xmeta.cache中Thing的使用
类型参数类型为Thing的org.xmeta.cache中的字段返回Thing的org.xmeta.cache中的方法参数类型为Thing的org.xmeta.cache中的方法修饰符和类型方法说明voidprotected abstract TThingObjectEntry.createObject(Thing thing) static ObjectGeneratedObjectEntry.getObject(Thing thing, String method, ActionContext actionContext) static void放入缓存。参数类型为Thing的org.xmeta.cache中的构造器限定符构造器说明GeneratedObjectEntry(Thing thing, String method) 构造函数。ThingEntry(String path, Thing thing) ThingEntry(Thing thing) ThingObjectEntry(Thing thing) -
org.xmeta.codes中Thing的使用
返回Thing的org.xmeta.codes中的方法修饰符和类型方法说明static ThingPropertyCoder.decode(Thing thing, InputStream input, boolean full, long lastModified) 解码。static ThingTxtCoder.decode(Thing thing, InputStream input, boolean full, long lastModified) 解码。static ThingXerCoder.decode(Thing thing, InputStream input) static ThingXerCoder.decodeAttributeOnly(byte[] bytes, int offset) 仅仅读取一个数据对象的属性。参数类型为Thing的org.xmeta.codes中的方法修饰符和类型方法说明voidDmlThingCoder.decode(Thing thing, InputStream in, long lastModifyed) voidJsonThingCoder.decode(Thing thing, InputStream in, long lastModifyed) static ThingPropertyCoder.decode(Thing thing, InputStream input, boolean full, long lastModified) 解码。voidPropertyThingCoder.decode(Thing thing, InputStream in, long lastModifyed) static ThingTxtCoder.decode(Thing thing, InputStream input, boolean full, long lastModified) 解码。voidTxtThingCoder.decode(Thing thing, InputStream in, long lastModifyed) static int从字节流里构建数据对象。static ThingXerCoder.decode(Thing thing, InputStream input) voidXerThingCoder.decode(Thing thing, InputStream in, long loastModifyed) voidXmlThingCoder.decode(Thing thing, InputStream in, long lastModified) voidDmlThingCoder.encode(Thing thing, OutputStream out) voidJsonThingCoder.encode(Thing thing, OutputStream out) static void编码模型。voidPropertyThingCoder.encode(Thing thing, OutputStream out) static void编码模型。voidTxtThingCoder.encode(Thing thing, OutputStream out) static voidstatic void编码模型到字节缓存中。voidXerThingCoder.encode(Thing thing, OutputStream out) static voidXmlCoder.encode(Thing thing, OutputStream out) 把指定的模型以XML编码到输出流中。static voidXmlCoder.encode(Thing thing, OutputStream out, boolean includeDefaultValue) 把指定的模型以XML编码到输出流中。voidXmlThingCoder.encode(Thing thing, OutputStream out) static void编码模型到输出流中。static voidXerCoder.encodeAllx(Thing thing, OutputStream out, Map<Thing, String> context) 编码所有。static StringXmlCoder.encodeToString(Thing thing) 把模型编码成XML字符串。static StringXmlCoder.encodeToString(Thing thing, boolean includeDefaultValue) 把模型编码成XML字符串。static voidXmlCoder.initDefaultValues(Thing thing) static boolean判断给定的值是否是默认值。static voidXmlCoder.parse(Thing thing, InputStream input) 从输入流中读取模型。static void分析XML字符串。static voidXmlCoder.parse(Thing thing, Thing descriptor, InputStream input) 从输入流中读取模型。static void分析XML字符串并返回模型。static void分析XML元素数据到模型中。static voidXmlCoder.setLastModified(Thing thing, long lastModified) 类型变量类型为Thing的org.xmeta.codes中的方法参数修饰符和类型方法说明static void编码模型。static void编码模型。static voidstatic void编码模型到字节缓存中。static void编码模型到输出流中。static voidXerCoder.encodeAllx(Thing thing, OutputStream out, Map<Thing, String> context) 编码所有。 -
org.xmeta.index中Thing的使用
返回Thing的org.xmeta.index中的方法参数类型为Thing的org.xmeta.index中的构造器 -
org.xmeta.thingManagers中Thing的使用
返回Thing的org.xmeta.thingManagers中的方法修饰符和类型方法说明abstract ThingAbstractThingManager.doLoadThing(String thingName) 装载模型。FileThingManager.doLoadThing(String thingName) JarThingManager.doLoadThing(String thingName) JdbcThingManager.doLoadThing(String thingName) RedisThingManager.doLoadThing(String thingName) 返回变量类型为Thing的类型的org.xmeta.thingManagers中的方法修饰符和类型方法说明CachedCategory.getThings()ClassCategory.getThings()TransientCategory.getThings()AbstractThingManager.iterator(String categoryName, String descriptorPath, boolean includeChildCategory) CachedCategory.iterator(boolean includeChildCategory) ClassCategory.iterator(boolean includeChildCategory) ClassThingManager.iterator(String categoryName, String descriptorPath, boolean includeChildCategory) TransientCategory.iterator(boolean includeChildCategory) 参数类型为Thing的org.xmeta.thingManagers中的方法修饰符和类型方法说明void添加一个模型文件监控。abstract booleanAbstractThingManager.doRemoveThing(Thing thing) 执行删除模型。booleanFileThingManager.doRemoveThing(Thing thing) booleanJarThingManager.doRemoveThing(Thing thing) booleanJdbcThingManager.doRemoveThing(Thing thing) booleanRedisThingManager.doRemoveThing(Thing thing) abstract booleanAbstractThingManager.doSaveThing(Thing thing) 执行保存模型。booleanFileThingManager.doSaveThing(Thing thing) booleanJarThingManager.doSaveThing(Thing thing) booleanJdbcThingManager.doSaveThing(Thing thing) booleanRedisThingManager.doSaveThing(Thing thing) booleanbooleanbooleanbooleanbooleanboolean -
org.xmeta.util中Thing的使用
返回Thing的org.xmeta.util中的方法修饰符和类型方法说明ActionContainer.getActionThing(String name) static ThingUtilThing.getQuoteThing(Thing thing, String attribute) 返回引用的模型,如果属性就不存在,那么就找根模型下的子模型。static ThingUtilThing.getSelfQuoteThing(Thing thing, String attribute) 返回只会连接到同一个根模型下的子模型,用在只会在模型内部连接的情况。ActionContainer.getThing()static Thing如果文件是模型,那么返回模型。static ThingUtilData.getThing(Thing thing, String attributeName, String childThingPath, ActionContext actionContext) 先从模型指定的属性上获取模型,如果不存在从子节点的路径上获取。static ThingUtilData.getThing(Thing thing, String attributeName, ActionContext actionContext) 根据模型的属性返回指定的模型。static ThingUtilThing.getThingFromAttributeOrChild(Thing thing, String attributeName, String childThingPath) 通过模型属性获取模型定义的模型,或者通过指定的子模型的第一个子节点获取定义的模型。static ThingUtilThing.getThingFromAttributeOrChilds(Thing thing, String attributeName, String childThingPath) 通过模型属性获取模型定义的模型,或者通过指定的子模型的第一个子节点获取定义的模型。static ThingUtilThing.getThingIfNotExistsCreate(String path, String thingManager, String descriptorForCreate) 获取模型,如果不存在就创建一个。static ThingUtilThing.getThingIfNotExistsCreate(String path, String thingManager, Thing forReplace) 获取模型,如果不存在就用已有的模型创建一个。返回变量类型为Thing的类型的org.xmeta.util中的方法修饰符和类型方法说明UtilData.addToSource(List<Thing> source, List<Thing> forAdd, boolean strict) 添加指定的模型列表到已有的模型列表中,添加时如果存在第一个的描述者相同且名字相同的则不添加。UtilData.addToSource(List<Thing> source, Thing forAdd, boolean strict) 添加指定的模型到源模型列表中。ActionContainer.getActionThings()ThingUtil.getAllDescriptorsAndExtends(Thing thing) ActionContainer.getAppendActions()参数类型为Thing的org.xmeta.util中的方法修饰符和类型方法说明UtilData.addToSource(List<Thing> source, Thing forAdd, boolean strict) 添加指定的模型到源模型列表中。voidstatic voidUtilThing.changeCoder(Thing thing, String coder) 改变一个模型的编码格式。static boolean返回字符串是否相等,如果属性值为null也返回false。static <T> TUtilData.get(Thing thing, String attributeName, ActionContext actionContext) static StringUtilAction.getActionCodeFilePath(Thing actionThing, String ext) 获取一个动作的代码文件名。ThingUtil.getAllDescriptorsAndExtends(Thing thing) static ObjectOgnlUtil.getCachedExpression(Thing thing, String attributeName) static ObjectUtilData.getData(Thing thing, String attributeName, ActionContext actionContext) 通过模型的属性获取数据。static booleanUtilAction.getDebugLog(Thing actionThing, ActionContext actionContext) 返回是否是打印调试日志。static ObjectUtilData.getObject(Thing thing, String attributeName, ActionContext actionContext) 返回通过属性定义的对象,首先使用UtilData获取,如果没有从actionContext中获取。static <T> TUtilData.getObjectByType(Thing thing, String attributeName, Class<T> t, ActionContext actionContext) static ObjectThingLoader.getObjectForLoad(Thing thing, ActionContext actionContext) 基于继承了xworker.lang.ThingLoader的模型使用,一般用于在模型里加载到对象。static org.xmeta.util.OgnlUtil.PathCacheOgnlUtil.getPathCache(Thing thing, String attributeName) static ThingUtilThing.getQuoteThing(Thing thing, String attribute) 返回引用的模型,如果属性就不存在,那么就找根模型下的子模型。static ThingUtilThing.getSelfQuoteThing(Thing thing, String attribute) 返回只会连接到同一个根模型下的子模型,用在只会在模型内部连接的情况。static StringUtilData.getString(Thing thing, String attributeName, ActionContext actionContext) static StringUtilString.getString(Thing thing, String attribute, ActionContext actionContext) 从模型取指定的属性的字符串值,然后从actionContext中取可能的值。static ThingUtilData.getThing(Thing thing, String attributeName, String childThingPath, ActionContext actionContext) 先从模型指定的属性上获取模型,如果不存在从子节点的路径上获取。static ThingUtilData.getThing(Thing thing, String attributeName, ActionContext actionContext) 根据模型的属性返回指定的模型。static ThingUtilThing.getThingFromAttributeOrChild(Thing thing, String attributeName, String childThingPath) 通过模型属性获取模型定义的模型,或者通过指定的子模型的第一个子节点获取定义的模型。static ThingUtilThing.getThingFromAttributeOrChilds(Thing thing, String attributeName, String childThingPath) 通过模型属性获取模型定义的模型,或者通过指定的子模型的第一个子节点获取定义的模型。static ThingUtilThing.getThingIfNotExistsCreate(String path, String thingManager, Thing forReplace) 获取模型,如果不存在就用已有的模型创建一个。static StringUtilString.getThingManagerFileName(Thing thing) static Object通过Ognl表达式取值, 模型的属性是Ognl的表达式。static Object通过Ognl表达式取值, 模型的属性是Ognl的表达式。static BindingsUtilAction.getVarScope(Thing action, ActionContext actionContext) 获取变量范围。static booleanUtilThing.isDescriptorEquals(Thing descriptorThing, String descriptor) 判断一个模型作为描述者时是否是给定的类型,即判断这个模型的路径以及所有继承模型的路径是否是指定的descritpor。static boolean返回指定的模型的属性是否为空,如果是字符串那么null和""都返回true。static <T> TThingLoader.load(Object object, Thing thing, ActionContext actionContext, Class<? extends Annotation>... annotations) 执行thing的create(actionContext)方法,执行后会遍历对象的注解为ActionField的字段,并从变量上下文中取值对字段赋值。static void把目标模型粘贴到指定模型上。static voidThingUtil.pasteAsChild(Thing thing, Thing forPasteThing) 把目标模型粘贴为子模型。static voidUtilAction.putVarByActioScope(Thing action, String varName, Object var, ActionContext actionContext) 把变量赋值到动作定义的变量范围中。static voidThingUtil.replaceThing(Thing thing, String replaceFor, String replaceWith) static voidUtilData.resetAttributeByType(Thing thing, String name, String type) static voidOgnlUtil.setValue(Thing thing, String pathAttributeName, String pathAttributeValue, Object value, Object root) 类型变量类型为Thing的org.xmeta.util中的方法参数修饰符和类型方法说明UtilData.addToSource(List<Thing> source, List<Thing> forAdd, boolean strict) 添加指定的模型列表到已有的模型列表中,添加时如果存在第一个的描述者相同且名字相同的则不添加。UtilData.addToSource(List<Thing> source, Thing forAdd, boolean strict) 添加指定的模型到源模型列表中。static <T> TThingLoader.load(Object object, List<Thing> things, ActionContext actionContext, Class<? extends Annotation>... annotations) 依次执行things的create(actionContext)方法,执行后会遍历对象的注解为ActionField的字段,并从变量上下文中取值对字段赋值。参数类型为Thing的org.xmeta.util中的构造器限定符构造器说明ActionContainer(Thing actions, ActionContext actionContext) ThingCallable(Thing thing, ActionContext actionContext, Map<String, Object> params) ThingRunnable(Thing thing, ActionContext actionContext, Map<String, Object> params)