/** * Returns whether any information on the physical address is available. * * @returns <code>true</code>, if any physical information is available, <code>false</code> otherwise */ public boolean isPhysicalInfoAvailable() { return !getDeliveryPoint().isEmpty() || getCity() != null || getAdministrativeArea() != null || getPostalCode() != null || getCountry() != null; } }
if ( address != null ) { writer.writeStartElement( owsNS, "Address" ); exportSimpleStrings( writer, address.getDeliveryPoint(), owsNS, "DeliveryPoint" ); writeOptionalElement( writer, owsNS, "City", address.getCity() ); writeOptionalElement( writer, owsNS, "AdministrativeArea", address.getAdministrativeArea() );
writer.writeStartElement( WMSNS, "ContactAddress" ); writeElement( writer, WMSNS, "AddressType", "postal" ); for ( String s : addr.getDeliveryPoint() ) { maybeWriteElementNS( writer, WMSNS, "Address", s );
writer.writeStartElement( "ContactAddress" ); writeElement( writer, "AddressType", "postal" ); for ( String s : addr.getDeliveryPoint() ) { maybeWriteElement( writer, "Address", s );
/** * @param addressEl * context {@link OMElement} * @return an {@link Address} instance, never <code>null</code> */ protected Address parseAddress( OMElement addressEl ) { Address address = new Address(); XPath xpath = new XPath( "ows:DeliveryPoint", nsContext ); String[] deliveryPoints = getNodesAsStrings( addressEl, xpath ); for ( String deliveryPoint : deliveryPoints ) { address.getDeliveryPoint().add( deliveryPoint ); } xpath = new XPath( "ows:City", nsContext ); address.setCity( getNodeAsString( addressEl, xpath, null ) ); xpath = new XPath( "ows:AdministrativeArea", nsContext ); address.setAdministrativeArea( getNodeAsString( addressEl, xpath, null ) ); xpath = new XPath( "ows:PostalCode", nsContext ); address.setPostalCode( getNodeAsString( addressEl, xpath, null ) ); xpath = new XPath( "ows:Country", nsContext ); address.setCountry( getNodeAsString( addressEl, xpath, null ) ); xpath = new XPath( "ows:ElectronicMailAddress", nsContext ); String[] eMails = getNodesAsStrings( addressEl, xpath ); for ( int i = 0; i < eMails.length; i++ ) { address.getElectronicMailAddress().add( eMails[i] ); } return address; }