private void readAtt(Object parent, Element attElem) { String name = attElem.getAttributeValue("name"); if (name == null) { errlog.format("NcML Attribute name is required (%s)%n", attElem); return; } try { ucar.ma2.Array values = NcMLReader.readAttributeValues(attElem); Attribute att = new ucar.nc2.Attribute(name, values); if (parent instanceof Group) ((Group) parent).addAttribute(att); else if (parent instanceof Variable) ((Variable) parent).addAttribute(att); } catch (RuntimeException e) { errlog.format("NcML new Attribute Exception: %s att=%s in=%s%n", e.getMessage(), name, parent); } }
private void readAtt(Object parent, Element attElem) { String name = attElem.getAttributeValue("name"); if (name == null) { errlog.format("NcML Attribute name is required (%s)%n", attElem); return; } try { ucar.ma2.Array values = NcMLReader.readAttributeValues(attElem); Attribute att = new ucar.nc2.Attribute(name, values); if (parent instanceof Group) ((Group) parent).addAttribute(att); else if (parent instanceof Variable) ((Variable) parent).addAttribute(att); } catch (RuntimeException e) { errlog.format("NcML new Attribute Exception: %s att=%s in=%s%n", e.getMessage(), name, parent); } }
private void readAtt(Object parent, Element attElem) { String name = attElem.getAttributeValue("name"); if (name == null) { errlog.format("NcML Attribute name is required (%s)%n", attElem); return; } try { ucar.ma2.Array values = NcMLReader.readAttributeValues(attElem); Attribute att = new ucar.nc2.Attribute(name, values); if (parent instanceof Group) ((Group) parent).addAttribute(att); else if (parent instanceof Variable) ((Variable) parent).addAttribute(att); } catch (RuntimeException e) { errlog.format("NcML new Attribute Exception: %s att=%s in=%s%n", e.getMessage(), name, parent); } }
if (debugConstruct) System.out.println(" add new att = " + name); try { ucar.ma2.Array values = readAttributeValues(attElem); addAttribute(parent, new ucar.nc2.Attribute(name, values)); } catch (RuntimeException e) { if (hasValue) { try { ucar.ma2.Array values = readAttributeValues(attElem); addAttribute(parent, new ucar.nc2.Attribute(name, values)); } catch (RuntimeException e) {
VariableSimple(Element velem) { name = velem.getAttributeValue("name"); String type = velem.getAttributeValue("type"); dt = DataType.getType(type); atts = new ArrayList<>(); List<Element> attElems = velem.getChildren("attribute"); for (Element attElem : attElems) { String attName = attElem.getAttributeValue("name"); ucar.ma2.Array values = NcMLReader.readAttributeValues(attElem); atts.add(new Attribute(attName, values)); } for (Attribute att : atts) { if (att.getShortName().equals(CDM.UNITS)) units = att.getStringValue(); if (att.getShortName().equals(CDM.LONG_NAME)) desc = att.getStringValue(); if ((desc == null) && att.getShortName().equals("description")) desc = att.getStringValue(); if ((desc == null) && att.getShortName().equals("standard_name")) desc = att.getStringValue(); } }
VariableSimple(Element velem) { name = velem.getAttributeValue("name"); String type = velem.getAttributeValue("type"); dt = DataType.getType(type); atts = new ArrayList<Attribute>(); List<Element> attElems = velem.getChildren("attribute"); for (Element attElem : attElems) { String attName = attElem.getAttributeValue("name"); ucar.ma2.Array values = NcMLReader.readAttributeValues(attElem); atts.add(new Attribute(attName, values)); } for (Attribute att : atts) { if (att.getShortName().equals(CDM.UNITS)) units = att.getStringValue(); if (att.getShortName().equals(CDM.LONG_NAME)) desc = att.getStringValue(); if ((desc == null) && att.getShortName().equals("description")) desc = att.getStringValue(); if ((desc == null) && att.getShortName().equals("standard_name")) desc = att.getStringValue(); } }
VariableSimpleAdapter(Element velem) { name = velem.getAttributeValue("name"); String type = velem.getAttributeValue("type"); dt = DataType.getType(type); atts = new ArrayList<>(); List<Element> attElems = velem.getChildren("attribute"); for (Element attElem : attElems) { String attName = attElem.getAttributeValue("name"); ucar.ma2.Array values = NcMLReader.readAttributeValues(attElem); atts.add(new Attribute(attName, values)); } for (Attribute att : atts) { if (att.getShortName().equals(CDM.UNITS)) units = att.getStringValue(); if (att.getShortName().equals(CDM.LONG_NAME)) desc = att.getStringValue(); if ((desc == null) && att.getShortName().equals("description")) desc = att.getStringValue(); if ((desc == null) && att.getShortName().equals("standard_name")) desc = att.getStringValue(); } }
if (debugConstruct) System.out.println(" add new att = " + name); try { ucar.ma2.Array values = readAttributeValues(attElem); addAttribute(parent, new ucar.nc2.Attribute(name, values)); } catch (RuntimeException e) { if (hasValue) { // has a new value try { ucar.ma2.Array values = readAttributeValues(attElem); addAttribute(parent, new ucar.nc2.Attribute(name, values)); } catch (RuntimeException e) {
if (debugConstruct) System.out.println(" add new att = " + name); try { ucar.ma2.Array values = readAttributeValues(attElem); addAttribute(parent, new ucar.nc2.Attribute(name, values)); } catch (RuntimeException e) { if (hasValue) { // has a new value try { ucar.ma2.Array values = readAttributeValues(attElem); // Handles "isUnsigned". addAttribute(parent, new ucar.nc2.Attribute(name, values)); } catch (RuntimeException e) {