public NodeType withNodeOrCVOrRepeater(Collection<Object> values) { if (values!= null) { getNodeOrCVOrRepeater().addAll(values); } return this; }
public NodeType withNodetext(NodetextType... values) { if (values!= null) { for (NodetextType value: values) { getNodetext().add(value); } } return this; }
/** * Create an instance of {@link NodeType } * */ public NodeType createNodeType() { return new NodeType(); }
@Test public void loadCvDefinitionsNodeWithRepeater() { InputStream is = VendorCvFactory.class.getResourceAsStream("/vendorcv/vendorcv_repeater2.xml"); Assert.assertNotNull(is); VendorCvFactory factory = new VendorCvFactory(); final Context context = new DefaultContext(); VendorCV vendorCV = factory.loadVendorCvFile(is, context); Assert.assertNotNull(vendorCV); LOGGER.info("Returned vendorCV: {}", vendorCV); Assert.assertNotNull(vendorCV.getCVDefinition()); CVDefinitionType cvDefinition = vendorCV.getCVDefinition(); List<NodeType> nodes = cvDefinition.getNode(); Assert.assertNotNull(nodes); Assert.assertEquals(nodes.size(), 1); NodeType node = nodes.get(0); List<NodetextType> nodeTextItems = node.getNodetext(); Assert.assertNotNull(nodeTextItems); Assert.assertEquals(nodeTextItems.get(0).getText(), "Allgemeine Daten"); Assert.assertEquals(nodeTextItems.get(1).getText(), "Basis"); List<Object> items = node.getNodeOrCVOrRepeater(); Assert.assertTrue(items.get(0) instanceof CVType); Assert.assertTrue(items.get(1) instanceof RepeaterType); Assert.assertTrue(items.get(2) instanceof CVType); }
LOGGER.info("Process current node: {}", node); String templateId = node.getTemplate(); LOGGER.debug("Current templateId: {}", templateId);
public NodeType withCount(Integer value) { setCount(value); return this; }
public NodeType withComment(String value) { setComment(value); return this; }
public NodeType withNext(Integer value) { setNext(value); return this; }
public NodeType withOffset(Integer value) { setOffset(value); return this; }
public NodeType withTemplate(String value) { setTemplate(value); return this; }
LOGGER.info("Process current node: {}", node); String templateId = node.getTemplate(); LOGGER.debug("Current templateId: {}", templateId);
public static List<NodeType> getSubNodes(NodeType nodeType) { List<NodeType> subNodes = new LinkedList<NodeType>(); if (nodeType.getNodeOrCVOrRepeater() != null) { for (Object obj : nodeType.getNodeOrCVOrRepeater()) { if (obj instanceof NodeType) { NodeType node = (NodeType) obj; subNodes.add(node); } } } return subNodes; }
public NodeType withNodetext(Collection<NodetextType> values) { if (values!= null) { getNodetext().addAll(values); } return this; }
LOGGER.info("Process current node: {}", node); String templateId = node.getTemplate(); LOGGER.debug("Current templateId: {}", templateId);
public NodeType withNodeOrCVOrRepeater(Object... values) { if (values!= null) { for (Object value: values) { getNodeOrCVOrRepeater().add(value); } } return this; }
public static NodetextType getNodetextOfLanguage(NodeType nodeType, String language) { if (!CollectionUtils.isEmpty(nodeType.getNodetext())) { for (Object obj : nodeType.getNodetext()) { if (obj instanceof NodetextType) { NodetextType nodetext = (NodetextType) obj; if (language.equalsIgnoreCase(nodetext.getLang())) { return nodetext; } } } } return null; }
LOGGER.info("Process current node: {}", node); String templateId = node.getTemplate(); LOGGER.debug("Current templateId: {}", templateId);
public static List<CVType> getCVs(NodeType nodeType) { List<CVType> cvTypes = new LinkedList<CVType>(); if (!CollectionUtils.isEmpty(nodeType.getNodeOrCVOrRepeater())) { for (Object obj : nodeType.getNodeOrCVOrRepeater()) { if (obj instanceof CVType) { CVType cv = (CVType) obj;
LOGGER.info("Process current node: {}", node); String templateId = node.getTemplate(); LOGGER.debug("Current templateId: {}", templateId);
LOGGER.info("Process current node: {}", node); String templateId = node.getTemplate(); LOGGER.debug("Current templateId: {}", templateId);