@XmlInclude(schema="fork-stacks.xsd",type=XmlInclude.Type.IMPORT,namespace="fork",alias="fork") @XmlElement(name="fork-stacks",type="fork:ForkStacksType") @MBean(description="Implementation of FORK protocol")
private static void classToXML(Document xmldoc, Element parent, Class<?> clazz, String preAppendToSimpleClassName) throws Exception { XmlInclude incl=Util.getAnnotation(clazz, XmlInclude.class); if(incl != null) { String[] schemas=incl.schema(); for (String schema : schemas) { Element incl_el = xmldoc.createElement(incl.type() == XmlInclude.Type.IMPORT ? "xs:import" : "xs:include"); if (!incl.namespace().isEmpty()) incl_el.setAttribute("namespace", incl.namespace()); incl_el.setAttribute("schemaLocation", schema); Node first_child = xmldoc.getDocumentElement().getFirstChild(); if (first_child == null) xmldoc.getDocumentElement().appendChild(incl_el); else xmldoc.getDocumentElement().insertBefore(incl_el, first_child); } if(!incl.alias().isEmpty()) xmldoc.getDocumentElement().setAttribute("xmlns:" + incl.alias(), incl.namespace()); } parent.appendChild(createXMLTree(xmldoc, clazz, preAppendToSimpleClassName)); }
private static void classToXML(Document xmldoc, Element parent, Class<?> clazz, String preAppendToSimpleClassName) throws Exception { XmlInclude incl=Util.getAnnotation(clazz, XmlInclude.class); if(incl != null) { String[] schemas=incl.schema(); for (String schema : schemas) { Element incl_el = xmldoc.createElement(incl.type() == XmlInclude.Type.IMPORT ? "xs:import" : "xs:include"); if (!incl.namespace().isEmpty()) incl_el.setAttribute("namespace", incl.namespace()); incl_el.setAttribute("schemaLocation", schema); Node first_child = xmldoc.getDocumentElement().getFirstChild(); if (first_child == null) xmldoc.getDocumentElement().appendChild(incl_el); else xmldoc.getDocumentElement().insertBefore(incl_el, first_child); } if(!incl.alias().isEmpty()) xmldoc.getDocumentElement().setAttribute("xmlns:" + incl.alias(), incl.namespace()); } parent.appendChild(createXMLTree(xmldoc, clazz, preAppendToSimpleClassName)); }
@XmlInclude(schema="relay.xsd",type=XmlInclude.Type.IMPORT,namespace="urn:jgroups:relay:1.0",alias="relay") @XmlElement(name="RelayConfiguration",type="relay:RelayConfigurationType") @MBean(description="RELAY2 protocol")
@XmlInclude(schema="fork-stacks.xsd",type=XmlInclude.Type.IMPORT,namespace="fork",alias="fork") @XmlElement(name="fork-stacks",type="fork:ForkStacksType") @MBean(description="Implementation of FORK protocol")
@XmlInclude(schema="relay.xsd",type=XmlInclude.Type.IMPORT,namespace="urn:jgroups:relay:1.0",alias="relay") @XmlElement(name="RelayConfiguration",type="relay:RelayConfigurationType") @MBean(description="RELAY2 protocol")