Object attributebody(Dapparse state, Object attrlist) throws ParseException { try { for (Object o : (List<Object>) attrlist) { if (o instanceof Attribute) { Attribute a = (Attribute) o; Iterator it = a.getValuesIterator(); while (it.hasNext()) dasobject.appendAttribute(a.getName(), a.getType(), (String) it.next()); /*UGH*/ } else if (o instanceof AttributeTable) { AttributeTable aset = (AttributeTable) o; dasobject.addAttributeTable(aset.getName(), aset); } else throw new Exception("attribute body: unknown object: " + o); } } catch (Exception e) { throw new ParseException(e); } return null; }
Object attributebody(Dap2Parse state, Object attrlist) throws ParseException { try { if(dasobject == null) throw new ParseException("No DAS for attributes"); for(Object o : (List<Object>) attrlist) { if(o instanceof Attribute) { Attribute a = (Attribute) o; Iterator it = a.getValuesIterator(); while(it.hasNext()) { dasobject.appendAttribute(a.getEncodedName(), a.getType(), (String) it.next()); /*UGH*/ } } else if(o instanceof AttributeTable) { AttributeTable aset = (AttributeTable) o; dasobject.addAttributeTable(aset.getEncodedName(), aset); } else throw new Exception("attribute body: unknown object: " + o); } } catch (ParseException pe) { throw pe; } catch (Exception e) { throw new ParseException(e); } return null; }