/** * Parse the @TreeView annotation. * * @param nodeClass Object to be parsed. * @throws Exception */ @SuppressWarnings("rawtypes") protected void parseTreeView(Tree path, Class nodeClass, Class parentClass, String collectionName) throws Exception { this.treeAnnotation = path; this.nodeClass = nodeClass; this.parentClass = parentClass; this.collectionName = collectionName; if (treeAnnotation == null) { treeAnnotation = this.getClass().getDeclaredField("defaultPathAnnotation").getAnnotation(Tree.class); } if (Is.empty(treeAnnotation.pathProperty())) { throw new XavaException("error.collectionDoesNotRepresentATreeView"); } this.pathProperty = treeAnnotation.pathProperty(); this.idSeparator = treeAnnotation.idSeparator(); parseNodeProperty(); this.orderProperty = null; this.initialExpandedState = treeAnnotation.initialExpandedState(); this.keyIncrement = treeAnnotation.orderIncrement(); if (this.keyIncrement < 2) { this.keyIncrement = 2; } setPathSeparator(treeAnnotation.pathSeparator()); if (nodeClass.getClass().isAnnotationPresent(Id.class)) { entityObject = true; } else { entityObject = false; } parseOrderDefined(); parseEntityObject(); }