/** * @param writer * @param codeType * @param owsNS * @throws XMLStreamException */ private static void exportCodeType( XMLStreamWriter writer, CodeType codeType, String localName, String owsNS ) throws XMLStreamException { if ( codeType != null ) { writer.writeStartElement( owsNS, localName ); if ( codeType.getCodeSpace() != null && !"".equals( codeType.getCodeSpace() ) ) { writer.writeAttribute( "codeSpace", codeType.getCodeSpace() ); } writer.writeCharacters( codeType.getValue() ); writer.writeEndElement(); // localName } }
@Override public CodeType apply( org.deegree.services.jaxb.metadata.CodeType u ) { return new CodeType( u.getValue(), u.getCodeSpace() ); } };
/** * Code type to export * * @param writer * @param ct * @throws XMLStreamException */ public static void exportCodeType( XMLStreamWriter writer, CodeType ct ) throws XMLStreamException { if ( ct != null ) { writeElement( writer, WCS_100_NS, "type", ct.getValue(), "codeSpace", ct.getCodeSpace() ); // --> @codSpace optional } } }
private Pair<List<LanguageString>, CodeType> fromJaxb( final KeywordsType jaxbEl ) { final CodeType type = jaxbEl.getType() == null ? null : new CodeType( jaxbEl.getType().getValue(), jaxbEl.getType().getCodeSpace() ); final List<LanguageString> languageStrings = fromJaxb( jaxbEl.getKeyword() ); return new Pair<List<LanguageString>, CodeType>( languageStrings, type ); } }