@Test public void testType() throws Exception { final NamespaceContext mockNamespaceContext = Mockito.mock(NamespaceContext.class); Mockito.when(mockWriter.getNamespaceContext()).thenReturn(mockNamespaceContext); Mockito.when(mockNamespaceContext.getPrefix(Matchers.anyString())).thenReturn("sli"); final QName qName = new QName(WxsNamespace.URI, "test"); uml2XsdPluginWriterAdapter.type(qName); Mockito.verify(mockWriter).writeAttribute("type", "sli:test"); final QName qName1 = new QName("ns", "test2"); uml2XsdPluginWriterAdapter.type(qName1); Mockito.verify(mockWriter).writeAttribute("type", "sli:test2"); }
@Override public void type(final QName name) { try { if (name.getNamespaceURI().equals(WxsNamespace.URI)) { xsw.writeAttribute("type", prefix.concat(":").concat(name.getLocalPart())); } else { xsw.writeAttribute("type", typeLexicalName(name, xsw)); } } catch (final XMLStreamException e) { throw new XsdGenRuntimeException(e); } }
Uml2XsdPluginWriterAdapter implements Uml2XsdPluginWriter { @Override public void type(final QName name) { try { if (name.getNamespaceURI().equals(WxsNamespace.URI)) { xsw.writeAttribute("type", prefix.concat(":").concat(name.getLocalPart())); } else { xsw.writeAttribute("type", typeLexicalName(name, xsw)); } } catch (final XMLStreamException e) { throw new XsdGenRuntimeException(e); } } }
Uml2XsdPluginWriterAdapter implements Uml2XsdPluginWriter { @Override public void type(final QName name) { try { if (name.getNamespaceURI().equals(WxsNamespace.URI)) { xsw.writeAttribute("type", prefix.concat(":").concat(name.getLocalPart())); } else { xsw.writeAttribute("type", typeLexicalName(name, xsw)); } } catch (final XMLStreamException e) { throw new XsdGenRuntimeException(e); } } Uml2XsdPluginWriterAdapter(final XMLStreamWriter xsw, final String prefix); }
Uml2XsdPluginWriterAdapter implements Uml2XsdPluginWriter { @Override public void type(final QName name) { try { if (name.getNamespaceURI().equals(WxsNamespace.URI)) { xsw.writeAttribute("type", prefix.concat(":").concat(name.getLocalPart())); } else { xsw.writeAttribute("type", typeLexicalName(name, xsw)); } } catch (final XMLStreamException e) { throw new XsdGenRuntimeException(e); } } Uml2XsdPluginWriterAdapter(final XMLStreamWriter xsw, final String prefix); @Override void annotation(); @Override void appinfo(); @Override void begin(final String prefix, final String localName, final String namespace); @Override void characters(final String text); @Override void choice(); @Override void comment(final String data); @Override void complexType(); @Override void documentation(); @Override void element(); @Override void elementName(final QName name); @Override void end(); @Override void maxOccurs(final Occurs value); @Override void minOccurs(final Occurs value); @Override void ref(final QName name); @Override void sequence(); @Override void type(final QName name); }
Uml2XsdPluginWriterAdapter implements Uml2XsdPluginWriter { @Override public void type(final QName name) { try { if (name.getNamespaceURI().equals(WxsNamespace.URI)) { xsw.writeAttribute("type", prefix.concat(":").concat(name.getLocalPart())); } else { xsw.writeAttribute("type", typeLexicalName(name, xsw)); } } catch (final XMLStreamException e) { throw new XsdGenRuntimeException(e); } } Uml2XsdPluginWriterAdapter(final XMLStreamWriter xsw, final String prefix); @Override void annotation(); @Override void appinfo(); @Override void begin(final String prefix, final String localName, final String namespace); @Override void characters(final String text); @Override void choice(); @Override void comment(final String data); @Override void complexType(); @Override void documentation(); @Override void element(); @Override void elementName(final QName name); @Override void end(); @Override void maxOccurs(final Occurs value); @Override void minOccurs(final Occurs value); @Override void ref(final QName name); @Override void sequence(); @Override void type(final QName name);  }