Object-oriented related methods

1. Get the descriptor (class) and inheritance, etc.

//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");

2. Set the descriptor (class) and inheritance, etc.

/ / 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");

3. Changes in descriptors (classes) and inheritance

    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号