public class GLSLElementDescriptor {
@XmlType
@XmlEnum(String.class)
public enum Category { BUILD_IN_FUNC, BUILD_IN_VAR, USER_FUNC, JUMP,
ITERATION, SELECTION, QUALIFIER, TYPE, KEYWORD }
@XmlElement
public final Category category;
@XmlElement(required = true)
public final String tooltip;
@XmlElement(required = true)
public final String doc;
@XmlElement(required = true)
public final String arguments;
@XmlElement(required = true)
public final String type;
/*bean constructor, fields are directly injected*/
public GLSLElementDescriptor() {
category = Category.KEYWORD;
tooltip = null;
doc = null;
arguments = null;
type = null;
}
}
I think you can't do it much simpler or in fewer loc since its already
100% declarative. JavaFX has no annotations which makes mapping to xml a
bit difficult (but of course still possible). What I thought was
actually to use plain java beans to hold the xml data and jaxb behind
the scenes rather than using another third party lib for the task. I am
really no JFX expert but I see no problem to access those beans from
JavaFX script, or is there a hidden show stopper I am not aware of?
I mean how hard would it be for JAXB to inject data directly into JavaFX
bytecode... (in future)
regards,
michael