@Test public void testVisitValueNode() throws IOException { ValueNode valueNode = mock(ValueNode.class); BxmlNode child = mock(BxmlNode.class); when(valueNode.getChildren()).thenReturn(Arrays.asList(child)); xmlBxmlNodeVisitor.visit(valueNode); verify(child).accept(xmlBxmlNodeVisitor); }
@Override public void visit(OpenStartElementNode openStartElementNode) throws IOException { try { xmlStreamWriter.writeStartElement(openStartElementNode.getTagName()); try { List<BxmlNode> nonAttributeChildren = new ArrayList<>(); for (BxmlNode bxmlNode : openStartElementNode.getChildren()) { if (bxmlNode instanceof AttributeNode) { bxmlNode.accept(this); } else { nonAttributeChildren.add(bxmlNode); } } for (BxmlNode nonAttributeChild : nonAttributeChildren) { nonAttributeChild.accept(this); } } finally { xmlStreamWriter.writeEndElement(); } } catch (XMLStreamException e) { throw new IOException(e); } }
XmlBxmlNodeVisitor implements BxmlNodeVisitor { @Override public void visit(OpenStartElementNode openStartElementNode) throws IOException { try { xmlStreamWriter.writeStartElement(openStartElementNode.getTagName()); try { List<BxmlNode> nonAttributeChildren = new ArrayList<>(); for (BxmlNode bxmlNode : openStartElementNode.getChildren()) { if (bxmlNode instanceof AttributeNode) { bxmlNode.accept(this); } else { nonAttributeChildren.add(bxmlNode); } } for (BxmlNode nonAttributeChild : nonAttributeChildren) { nonAttributeChild.accept(this); } } finally { xmlStreamWriter.writeEndElement(); } } catch (XMLStreamException e) { throw new IOException(e); } } }
XmlBxmlNodeVisitor implements BxmlNodeVisitor { @Override public void visit(OpenStartElementNode openStartElementNode) throws IOException { try { xmlStreamWriter.writeStartElement(openStartElementNode.getTagName()); try { List<BxmlNode> nonAttributeChildren = new ArrayList<>(); for (BxmlNode bxmlNode : openStartElementNode.getChildren()) { if (bxmlNode instanceof AttributeNode) { bxmlNode.accept(this); } else { nonAttributeChildren.add(bxmlNode); } } for (BxmlNode nonAttributeChild : nonAttributeChildren) { nonAttributeChild.accept(this); } } finally { xmlStreamWriter.writeEndElement(); } } catch (XMLStreamException e) { throw new IOException(e); } } XmlBxmlNodeVisitor(XMLStreamWriter xmlStreamWriter, RootNode rootNode); }
XmlBxmlNodeVisitor implements BxmlNodeVisitor { @Override public void visit(OpenStartElementNode openStartElementNode) throws IOException { try { xmlStreamWriter.writeStartElement(openStartElementNode.getTagName()); try { List<BxmlNode> nonAttributeChildren = new ArrayList<>(); for (BxmlNode bxmlNode : openStartElementNode.getChildren()) { if (bxmlNode instanceof AttributeNode) { bxmlNode.accept(this); } else { nonAttributeChildren.add(bxmlNode); } } for (BxmlNode nonAttributeChild : nonAttributeChildren) { nonAttributeChild.accept(this); } } finally { xmlStreamWriter.writeEndElement(); } } catch (XMLStreamException e) { throw new IOException(e); } } XmlBxmlNodeVisitor(XMLStreamWriter xmlStreamWriter, RootNode rootNode); @Override void visit(OpenStartElementNode openStartElementNode); @Override void visit(AttributeNode attributeNode); @Override void visit(TemplateInstanceNode templateInstanceNode); @Override void visit(TemplateNode templateNode); @Override void visit(RootNode rootNode); @Override void visit(CDataSectionNode cDataSectionNode); @Override void visit(EntityReferenceNode entityReferenceNode); @Override void visit(ValueNode valueNode); @Override void visit(ConditionalSubstitutionNode conditionalSubstitutionNode); @Override void visit(NormalSubstitutionNode normalSubstitutionNode); @Override void visit(VariantTypeNode variantTypeNode); }
XmlBxmlNodeVisitor implements BxmlNodeVisitor { @Override public void visit(OpenStartElementNode openStartElementNode) throws IOException { try { xmlStreamWriter.writeStartElement(openStartElementNode.getTagName()); try { List<BxmlNode> nonAttributeChildren = new ArrayList<>(); for (BxmlNode bxmlNode : openStartElementNode.getChildren()) { if (bxmlNode instanceof AttributeNode) { bxmlNode.accept(this); } else { nonAttributeChildren.add(bxmlNode); } } for (BxmlNode nonAttributeChild : nonAttributeChildren) { nonAttributeChild.accept(this); } } finally { xmlStreamWriter.writeEndElement(); } } catch (XMLStreamException e) { throw new IOException(e); } } XmlBxmlNodeVisitor(XMLStreamWriter xmlStreamWriter, RootNode rootNode); @Override void visit(OpenStartElementNode openStartElementNode); @Override void visit(AttributeNode attributeNode); @Override void visit(TemplateInstanceNode templateInstanceNode); @Override void visit(TemplateNode templateNode); @Override void visit(RootNode rootNode); @Override void visit(CDataSectionNode cDataSectionNode); @Override void visit(EntityReferenceNode entityReferenceNode); @Override void visit(ValueNode valueNode); @Override void visit(ConditionalSubstitutionNode conditionalSubstitutionNode); @Override void visit(NormalSubstitutionNode normalSubstitutionNode); @Override void visit(VariantTypeNode variantTypeNode);  }