static { JXPathIntrospector.registerDynamicClass( NodeDefinition.class, NodeDefinitionPropertyHandler.class); JXPathIntrospector.registerDynamicClass(Schema.class, SchemaPropertyHandler.class); CONTEXT = JXPathContext.newContext(null); }
/** * Recupera un nodo del arbol a partir del path de dicho nodo dentro de la jerarquia * * @param nodePath * @return El nodo correspondiente al path solicitado o nulo en caso de no ser un paz valido * dentro de la jerarquia */ public TreeNode getNode(String nodePath) { synchronized (this) { try { JXPathIntrospector.registerDynamicClass(TreeNode.class, TreeNodeXPathHandler.class); JXPathIntrospector.registerDynamicClass(TreeView.class, TreeNodeXPathHandler.class); JXPathContext xPathContext = JXPathContext.newContext(this); return (TreeNode) xPathContext.getValue(nodePath); } catch (Exception e) { return null; } } }