static public void main(String args[]) throws IOException { ODLparser p = new ODLparser(); p.parseFile("c:/temp/odl.struct.txt"); } }
static public void main(String args[]) throws IOException { ODLparser p = new ODLparser(); p.parseFile("c:/temp/odl.struct.txt"); } }
static public void main(String args[]) throws IOException { ODLparser p = new ODLparser(); p.parseFile("c:/temp/odl.struct.txt"); } }
public static Element getEosElement(String name, Group eosGroup) throws IOException { String smeta = getEosMetadata(name, eosGroup); if (smeta == null) { return null; } smeta = smeta.replaceAll("\\s+=\\s+", "="); smeta = smeta.replaceAll("\\?", "_"); // XML names cannot contain the character "?". StringBuilder sb = new StringBuilder(smeta.length()); StringTokenizer lineFinder = new StringTokenizer(smeta, "\t\n\r\f"); while (lineFinder.hasMoreTokens()) { String line = lineFinder.nextToken().trim(); sb.append(line); sb.append("\n"); } ODLparser parser = new ODLparser(); return parser.parseFromString(sb.toString());// now we have the ODL in JDOM elements }
static public boolean getEosInfo(NetcdfFile ncfile, Group eosGroup, Formatter f) throws IOException { String smeta = getStructMetadata(eosGroup); if (smeta == null) { f.format("No StructMetadata variables in group %s %n", eosGroup.getFullName()); return false; } f.format("raw = %n%s%n", smeta); ODLparser parser = new ODLparser(); parser.parseFromString(smeta); // now we have the ODL in JDOM elements StringWriter sw = new StringWriter(5000); parser.showDoc(new PrintWriter(sw)); f.format("parsed = %n%s%n", sw.toString()); return true; }
static public boolean getEosInfo(NetcdfFile ncfile, Group eosGroup, Formatter f) throws IOException { String smeta = getStructMetadata(eosGroup); if (smeta == null) { f.format("No StructMetadata variables in group %s %n", eosGroup.getFullName()); return false; } f.format("raw = %n%s%n", smeta); ODLparser parser = new ODLparser(); parser.parseFromString(smeta); // now we have the ODL in JDOM elements ByteArrayOutputStream bos = new ByteArrayOutputStream(1000 * 1000); parser.showDoc(bos); f.format("parsed = %n%s%n", bos.toString()); return true; }
/** * */ static public boolean getEosInfo(NetcdfFile ncfile, Group eosGroup, Formatter f) throws IOException { String smeta = getStructMetadata(eosGroup); if (smeta == null) { f.format("No StructMetadata variables in group %s %n", eosGroup.getFullName()); return false; } f.format("raw = %n%s%n", smeta); ODLparser parser = new ODLparser(); parser.parseFromString(smeta); // now we have the ODL in JDOM elements StringWriter sw = new StringWriter(5000); parser.showDoc(new PrintWriter(sw)); f.format("parsed = %n%s%n", sw.toString()); return true; }
Group rootg = ncfile.getRootGroup(); ODLparser parser = new ODLparser();
Group rootg = ncfile.getRootGroup(); ODLparser parser = new ODLparser();
Group rootg = ncfile.getRootGroup(); ODLparser parser = new ODLparser();