void processOrgNode(LegalEntityNode orgNode, List<DictionaryEntity> results) { Enumeration<Node> enumeration = orgNode.children(); while (enumeration.hasMoreElements()) { LegalEntityNode childNode = (LegalEntityNode) enumeration.nextElement(); DictionaryEntity dictionaryEntity = new DictionaryEntity(); dictionaryEntity.setCode(childNode.getId()); dictionaryEntity.setName(childNode.getName()); results.add(dictionaryEntity); } }
@Override public List<DictionaryEntity> getDictionaryEntities() { List<DictionaryEntity> results = new ArrayList<DictionaryEntity>(); LegalEntityNode orgNode = LegalEntityCacheUtils.getTopNode(); Enumeration<Node> enumeration = orgNode.children(); while (enumeration.hasMoreElements()) { LegalEntityNode childNode = (LegalEntityNode) enumeration.nextElement(); DictionaryEntity dictionaryEntity = new DictionaryEntity(); dictionaryEntity.setCode(childNode.getId()); dictionaryEntity.setName(childNode.getName()); results.add(dictionaryEntity); processOrgNode(childNode, results); } return results; }