private void addSource(boolean isCreator, String sourceName, String urlName, String emailName) { Attribute att = ncfile.get(sourceName); if (att != null) { String sourceValue = att.getStringValue(); Attribute urlAtt = ncfile.get(urlName); String url = (urlAtt == null) ? null : urlAtt.getStringValue(); Attribute emailAtt = ncfile.get(emailName); String email = (emailAtt == null) ? null : emailAtt.getStringValue(); ThreddsMetadata.Vocab name = new ThreddsMetadata.Vocab(sourceValue, null); ThreddsMetadata.Source src = new ThreddsMetadata.Source(name, url, email); if (isCreator) tmi.addCreator(src); else tmi.addPublisher(src); } }
private void addSource(boolean isCreator, String sourceName, String urlName, String emailName) { Attribute att = ncfile.get(sourceName); if (att != null) { String sourceValue = att.getStringValue(); Attribute urlAtt = ncfile.get(urlName); String url = (urlAtt == null) ? null : urlAtt.getStringValue(); Attribute emailAtt = ncfile.get(emailName); String email = (emailAtt == null) ? null : emailAtt.getStringValue(); ThreddsMetadata.Vocab name = new ThreddsMetadata.Vocab(sourceValue, null); ThreddsMetadata.Source src = new ThreddsMetadata.Source(name, url, email); if (isCreator) tmi.addCreator(src); else tmi.addPublisher(src); } }
protected ThreddsMetadata.Source readSource(Element elem) { if (elem == null) return null; ThreddsMetadata.Vocab name = readControlledVocabulary(elem.getChild("name", defNS)); Element contact = elem.getChild("contact", defNS); if (contact == null) { factory.appendErr(" ** Parse error: Missing contact element in = " + elem.getName() + "\n"); return null; } return new ThreddsMetadata.Source(name, contact.getAttributeValue("url"), contact.getAttributeValue("email")); }
protected ThreddsMetadata.Source readSource(Element elem) { if (elem == null) return null; ThreddsMetadata.Vocab name = readControlledVocabulary(elem.getChild("name", defNS)); Element contact = elem.getChild("contact", defNS); if (contact == null) { factory.appendErr(" ** Parse error: Missing contact element in = " + elem.getName() + "\n"); return null; } return new ThreddsMetadata.Source(name, contact.getAttributeValue("url"), contact.getAttributeValue("email")); }
protected ThreddsMetadata.Source readSource(Element elem) { if (elem == null) return null; ThreddsMetadata.Vocab name = readControlledVocabulary( elem.getChild("name", defNS)); Element contact = elem.getChild("contact", defNS); if (contact == null) { factory.appendErr(" ** Parse error: Missing contact element in = "+elem.getName()+"\n"); return null; } return new ThreddsMetadata.Source( name, contact.getAttributeValue("url"), contact.getAttributeValue("email")); }