|| serviceContact.getAddress() != null || serviceContact.getElectronicMailAddress() != null || serviceContact.getOnlineResource() != null || serviceContact.getHoursOfService() != null || serviceContact.getContactInstructions() != null ) { AddressType address = serviceContact.getAddress(); if ( address != null ) { writer.writeStartElement( owsNS, "Address" );
|| serviceContact.getAddress() != null || serviceContact.getElectronicMailAddress() != null || serviceContact.getOnlineResource() != null || serviceContact.getHoursOfService() != null || serviceContact.getContactInstructions() != null ) { AddressType address = serviceContact.getAddress(); if ( address != null ) { writer.writeStartElement( owsNS, "Address" );
writeElement( writer, WCS_100_NS, "positionName", serviceContactType.getPositionName() ); if ( serviceContactType.getAddress() != null || !isEmpty( serviceContactType.getPhone() ) || !isEmpty( serviceContactType.getFacsimile() ) || !isEmpty( serviceContactType.getOnlineResource() ) ) { exportAddress( writer, serviceContactType.getAddress(), serviceContactType.getElectronicMailAddress() );
public static ResponsibleParty convertFromJAXB( ServiceContactType sc ) { if ( sc == null ) { return null; } ResponsibleParty res = new ResponsibleParty(); res.setIndividualName( sc.getIndividualName() ); res.setPositionName( sc.getPositionName() ); res.setRole( new CodeType( sc.getRole() ) ); ContactInfo info = new ContactInfo(); info.setContactInstructions( sc.getContactInstructions() ); info.setHoursOfService( sc.getHoursOfService() ); try { info.setOnlineResource( new URL( sc.getOnlineResource() ) ); } catch ( MalformedURLException e ) { // ignore this, schemas should be fixed so it already is an URL } Telephone phone = new Telephone(); phone.setFacsimile( Collections.singletonList( sc.getFacsimile() ) ); phone.setVoice( Collections.singletonList( sc.getPhone() ) ); info.setPhone( phone ); Address ad = convertFromJAXB( sc.getAddress() ); if ( ad != null ) { ad.setElectronicMailAddress( sc.getElectronicMailAddress() ); info.setAddress( ad ); } res.setContactInfo( info ); return res; }