|
Attributes
Attributes types
AttributesThe attributes are a kind of hight level reflection. They know how to get/set itself, how to add/remove listeners to changes and a few more tricks. They are the Model component, or a Model wrapper, if you prefer. More details here. The implemented types of attributes are: ReflectionUses java reflection to handle and Object or a Class. The main player is the ReflectionGroup, that can extract ReflectionAttribute objects for all the fields. To create one, just pass the needed Object or Class to a ReflectionGroup constructor: new ReflectionGroup(obj) it create attribute to all instance variables of obj and all superclasses (and will ignore all static attributes). If you want a list of all static atttributes of a Class, you can use: new ReflectionGroup(MyClass.class) It also allows some configuration, that is made through an instance of ReflectionData passed as second parameter in the constructor. There are also some annotations that can be added to the model and that ReflectionAttribute can use. They are:
MapUses a map containing attributes names as keys and attribute values as values. It will guess the type based on the attribute already in the map. To use it just pass a Map to the constructor of MapGroup: new MapGroup(map) It does not have any other parameter right now. CustomYou also can create custom attributes, based in one of the base classes created for that:
|
Sign in to add a comment