public TableConfig getConfig(FeatureType wantFeatureType, NetcdfDataset ds, Formatter errlog) throws IOException { PointConfigXML reader = new PointConfigXML(); return reader.readConfigXMLfromResource("resources/nj22/pointConfig/SimpleTrajectory.xml", wantFeatureType, ds, errlog); } }
addCoord(tableElem, config, coord, varNames); for (Join j : config.extraJoin) { if (j instanceof JoinArray) tableElem.addContent(writeJoinArray((JoinArray) j)); else if (j instanceof JoinMuiltdimStructure) tableElem.addContent(writeJoinMuiltdimStructure((JoinMuiltdimStructure) j)); else if (j instanceof JoinParentIndex) tableElem.addContent(writeJoinParentIndex((JoinParentIndex) j)); tableElem.addContent(writeTable(child));
tc.structureType = TableConfig.StructureType.valueOf(tableElem.getAttributeValue("subtype")); assert parent != null; makeMultidimInner(ds, parent, tc); break; tc.addJoin( readJoinArray(ds, joinElem)); tc.addChild( parseTableConfig(ds, nestedTable, tc));
private void writeConfigXML(java.util.Formatter sf) throws IOException { if (configResult != null) { PointConfigXML tcx = new PointConfigXML(); tcx.writeConfigXML(configResult, tc.getClass().getName(), sf); return; } XMLOutputter fmt = new XMLOutputter( Format.getPrettyFormat()); sf.format("%s", fmt.outputString ( makeDocument())); }
public TableConfig readConfigXMLfromResource(String resourceLocation, FeatureType wantFeatureType, NetcdfDataset ds, Formatter errlog) throws IOException { ClassLoader cl = this.getClass().getClassLoader(); InputStream is = cl.getResourceAsStream(resourceLocation); if (is == null) throw new FileNotFoundException(resourceLocation); if (debugXML) { System.out.println(" PointConfig URL = <" + resourceLocation + ">"); InputStream is2 = cl.getResourceAsStream(resourceLocation); System.out.println(" contents=\n" + IO.readContents(is2)); } org.jdom2.Document doc; try { SAXBuilder builder = new SAXBuilder(false); if (debugURL) System.out.println(" PointConfig URL = <" + resourceLocation + ">"); doc = builder.build(is); } catch (JDOMException e) { throw new IOException(e.getMessage()); } if (debugXML) System.out.println(" SAXBuilder done"); if (showParsedXML) { XMLOutputter xmlOut = new XMLOutputter(); System.out.println("*** PointConfig/showParsedXML = \n" + xmlOut.outputString(doc) + "\n*******"); } Element configElem = doc.getRootElement(); String featureType = configElem.getAttributeValue("featureType"); Element tableElem = configElem.getChild("table"); TableConfig tc = parseTableConfig(ds, tableElem, null); tc.featureType = FeatureType.valueOf(featureType); return tc; }
public void writeConfigXML(TableConfig tc, String tableConfigurerClass, java.util.Formatter sf) throws IOException { this.tc = tc; this.tableConfigurerClass = tableConfigurerClass; XMLOutputter fmt = new XMLOutputter(Format.getPrettyFormat()); sf.format("%s", fmt.outputString(makeDocument())); }
addCoord(tableElem, config, coord, varNames); for (Join j : config.extraJoin) { if (j instanceof JoinArray) tableElem.addContent(writeJoinArray((JoinArray) j)); else if (j instanceof JoinMuiltdimStructure) tableElem.addContent(writeJoinMuiltdimStructure((JoinMuiltdimStructure) j)); else if (j instanceof JoinParentIndex) tableElem.addContent(writeJoinParentIndex((JoinParentIndex) j)); tableElem.addContent(writeTable(child));
tc.innerName = tableElem.getAttributeValue("dim1"); tc.structureType = TableConfig.StructureType.valueOf(tableElem.getAttributeValue("subtype")); makeMultidimInner(ds, parent, tc); break; tc.addJoin( readJoinArray(ds, joinElem)); tc.addChild( parseTableConfig(ds, nestedTable, tc));
private void writeConfigXML(java.util.Formatter sf) throws IOException { if (configResult != null) { PointConfigXML tcx = new PointConfigXML(); tcx.writeConfigXML(configResult, getName(), sf); return; } XMLOutputter fmt = new XMLOutputter( Format.getPrettyFormat()); sf.format("%s", fmt.outputString ( makeDocument())); }
Element tableElem = configElem.getChild("table"); assert tableElem != null; TableConfig tc = parseTableConfig(ds, tableElem, null); tc.featureType = FeatureType.valueOf(featureType); return tc;
public void writeConfigXML(TableConfig tc, String tableConfigurerClass, java.util.Formatter sf) throws IOException { this.tc = tc; this.tableConfigurerClass = tableConfigurerClass; XMLOutputter fmt = new XMLOutputter(Format.getPrettyFormat()); sf.format("%s", fmt.outputString(makeDocument())); }
public TableConfig getConfig(FeatureType wantFeatureType, NetcdfDataset ds, Formatter errlog) throws IOException { PointConfigXML reader = new PointConfigXML(); return reader.readConfigXMLfromResource("resources/nj22/pointConfig/Suomi.xml", wantFeatureType, ds, errlog); } }
addCoord(tableElem, config, coord, varNames); for (Join j : config.extraJoin) { if (j instanceof JoinArray) tableElem.addContent(writeJoinArray((JoinArray) j)); else if (j instanceof JoinMuiltdimStructure) tableElem.addContent(writeJoinMuiltdimStructure((JoinMuiltdimStructure) j)); else if (j instanceof JoinParentIndex) tableElem.addContent(writeJoinParentIndex((JoinParentIndex) j)); tableElem.addContent(writeTable(child));
tc.structureType = TableConfig.StructureType.valueOf(tableElem.getAttributeValue("subtype")); assert parent != null; makeMultidimInner(ds, parent, tc); break; tc.addJoin( readJoinArray(ds, joinElem)); tc.addChild( parseTableConfig(ds, nestedTable, tc));
private void writeConfigXML(java.util.Formatter sf) throws IOException { if (configResult != null) { PointConfigXML tcx = new PointConfigXML(); tcx.writeConfigXML(configResult, getName(), sf); return; } XMLOutputter fmt = new XMLOutputter( Format.getPrettyFormat()); sf.format("%s", fmt.outputString ( makeDocument())); }
Element tableElem = configElem.getChild("table"); assert tableElem != null; TableConfig tc = parseTableConfig(ds, tableElem, null); tc.featureType = FeatureType.valueOf(featureType); return tc;
public void writeConfigXML(TableConfig tc, String tableConfigurerClass, java.util.Formatter sf) throws IOException { this.tc = tc; this.tableConfigurerClass = tableConfigurerClass; XMLOutputter fmt = new XMLOutputter(Format.getPrettyFormat()); sf.format("%s", fmt.outputString(makeDocument())); }
public TableConfig getConfig(FeatureType wantFeatureType, NetcdfDataset ds, Formatter errlog) throws IOException { PointConfigXML reader = new PointConfigXML(); return reader.readConfigXMLfromResource("resources/nj22/pointConfig/BuoyShipSynop.xml", wantFeatureType, ds, errlog); } }
public static void writeConfigXML(FeatureDatasetPoint pfd, java.util.Formatter f) { if (!(pfd instanceof PointDatasetStandardFactory.PointDatasetStandard)) { f.format("%s not instance of PointDatasetStandard%n", pfd.getLocation()); return; } PointDatasetStandardFactory.PointDatasetStandard spfd = (PointDatasetStandardFactory.PointDatasetStandard) pfd; TableAnalyzer analyser = spfd.getTableAnalyzer(); TableConfig config = analyser.getTableConfig(); TableConfigurer tc = analyser.getTableConfigurer(); if (tc == null) { f.format("%s has no TableConfig%n", pfd.getLocation()); return; } PointConfigXML writer = new PointConfigXML(); try { writer.writeConfigXML(config, tc.getClass().getName(), f); } catch (IOException e) { f.format("%s error writing=%s%n", pfd.getLocation(), e.getMessage()); } }
public TableConfig readConfigXML(String fileLocation, FeatureType wantFeatureType, NetcdfDataset ds, Formatter errlog) throws IOException { org.jdom2.Document doc; try { SAXBuilder builder = new SAXBuilder(false); if (debugURL) System.out.println(" PointConfig URL = <" + fileLocation + ">"); doc = builder.build(fileLocation); } catch (JDOMException e) { throw new IOException(e.getMessage()); } if (debugXML) System.out.println(" SAXBuilder done"); if (showParsedXML) { XMLOutputter xmlOut = new XMLOutputter(); System.out.println("*** PointConfig/showParsedXML = \n" + xmlOut.outputString(doc) + "\n*******"); } Element configElem = doc.getRootElement(); String featureType = configElem.getAttributeValue("featureType"); Element tableElem = configElem.getChild("table"); TableConfig tc = parseTableConfig(ds, tableElem, null); tc.featureType = FeatureType.valueOf(featureType); return tc; }