@Test public void testCyclicToElement2() throws Exception { ComplexTypeDescriptor a = new ComplexTypeDescriptor(); a.setName("a"); a.setType("typename"); a.setQnameFromString("{namespace}typename"); a.getElements().add(a); Element el = XMLSplitterSerialisationHelper .typeDescriptorToExtensionXML(a); String xml = new XMLOutputter().outputString(el); assertEquals( "unexpected xml", "<s:extensions xmlns:s=\"http: xml); }
public static Element typeDescriptorToExtensionXML(TypeDescriptor descriptor) { Element result = new Element("extensions", XScuflNS); Element type = null; if (descriptor instanceof ComplexTypeDescriptor) { type = constructElementForComplexType( (ComplexTypeDescriptor) descriptor, new ArrayList<String>()); } else if (descriptor instanceof ArrayTypeDescriptor) { type = constructElementForArrayType( (ArrayTypeDescriptor) descriptor, new ArrayList<String>()); } result.addContent(type); return result; }
XMLSplitterSerialisationHelper { public static Element typeDescriptorToExtensionXML(TypeDescriptor descriptor) { Element result = new Element("extensions", XScuflNS); Element type = null; if (descriptor instanceof ComplexTypeDescriptor) { type = constructElementForComplexType( (ComplexTypeDescriptor) descriptor, new ArrayList<String>()); } else if (descriptor instanceof ArrayTypeDescriptor) { type = constructElementForArrayType( (ArrayTypeDescriptor) descriptor, new ArrayList<String>()); } result.addContent(type); return result; } }
XMLSplitterSerialisationHelper { public static Element typeDescriptorToExtensionXML(TypeDescriptor descriptor) { Element result = new Element("extensions", XScuflNS); Element type = null; if (descriptor instanceof ComplexTypeDescriptor) { type = constructElementForComplexType( (ComplexTypeDescriptor) descriptor, new ArrayList<String>()); } else if (descriptor instanceof ArrayTypeDescriptor) { type = constructElementForArrayType( (ArrayTypeDescriptor) descriptor, new ArrayList<String>()); } result.addContent(type); return result; }  }
XMLSplitterSerialisationHelper { public static Element typeDescriptorToExtensionXML(TypeDescriptor descriptor) { Element result = new Element("extensions", XScuflNS); Element type = null; if (descriptor instanceof ComplexTypeDescriptor) { type = constructElementForComplexType( (ComplexTypeDescriptor) descriptor, new ArrayList<String>()); } else if (descriptor instanceof ArrayTypeDescriptor) { type = constructElementForArrayType( (ArrayTypeDescriptor) descriptor, new ArrayList<String>()); } result.addContent(type); return result; }  static Element typeDescriptorToExtensionXML(TypeDescriptor descriptor); static TypeDescriptor extensionXMLToTypeDescriptor(Element element); }
XMLSplitterSerialisationHelper { public static Element typeDescriptorToExtensionXML(TypeDescriptor descriptor) { Element result = new Element("extensions", XScuflNS); Element type = null; if (descriptor instanceof ComplexTypeDescriptor) { type = constructElementForComplexType( (ComplexTypeDescriptor) descriptor, new ArrayList<String>()); } else if (descriptor instanceof ArrayTypeDescriptor) { type = constructElementForArrayType( (ArrayTypeDescriptor) descriptor, new ArrayList<String>()); } result.addContent(type); return result; }  static Element typeDescriptorToExtensionXML(TypeDescriptor descriptor); static TypeDescriptor extensionXMLToTypeDescriptor(Element element); final static Namespace XScuflNS; }