//Get the primary descriptor (class)
Thing descriptor = thing.getDescriptor();
//Get all descriptors (classes)
List<Thing> descriptors = thing.getDescriptors();
//Get the thing name, equivalent to Java's object.getClass().getSimpleName()
String thingName = thing.getThingName();
//Get the inheritance list
List<Thing> extends = thing.getExtends();
//Get the list of action behaviors
List<Thing> actions = thing.getActionThings();
//Get the specified action model xxx
Thing actionThing = thing.getActionThing("xxx");
/ / Set the descriptor (class), where xxx is the path of the descriptor, if there are multiple, separate them with English commas
thing.set("descriptors", "xxx");
//Set inheritance, where xxx is the path of the model to be inherited, if there are multiple, separate them with English commas
thing.set("extends", "xxx");
When a model's descriptor (class) and inheritance change, its other properties and child nodes will not change, but its behavior may change. If the behavior originally inherited from the descriptor A is now changed to B because the descriptor is changed, then the model does not have the behavior of A but has the behavior of B.
Copyright © 2007-2019 XWorker.org 版权所有 沪ICP备08000575号