legacy/src/main/java/thredds/cataloggen/config/CatGenConfigMetadataFactory.java
private org.jdom2.Element createDatasetSourceElement( DatasetSource dsSource)
  {
    Element dssElem = new Element("datasetSource", CATALOG_GEN_CONFIG_NAMESPACE_0_5);
    if ( dsSource != null)
    {
      // Add 'name' attribute.
      if ( dsSource.getName() != null)
      {
        dssElem.setAttribute( "name", dsSource.getName());
      }

      // Add 'type' attribute.
      if ( dsSource.getType() != null)
      {
        dssElem.setAttribute( "type", dsSource.getType().toString());
      }

      // Add 'structure' attribute.
      if ( dsSource.getStructure() != null)
      {
        dssElem.setAttribute( "structure", dsSource.getStructure().toString());
      }

      // Add 'accessPoint' attribute.
      if ( dsSource.getAccessPoint() != null)
      {
        dssElem.setAttribute( "accessPoint", dsSource.getAccessPoint());
      }

      // Add 'createCatalogRefs' attribute.
      dssElem.setAttribute( "createCatalogRefs", Boolean.toString(  dsSource.isCreateCatalogRefs()));

      // Add 'resultService' element
      ResultService rs = dsSource.getResultService();
      dssElem.addContent( createResultServiceElement( rs));

      // Add 'datasetNamer' elements
      java.util.List list = dsSource.getDatasetNamerList();
      for ( int j=0; j < list.size(); j++)
      {
        DatasetNamer dsNamer = (DatasetNamer) list.get(j);
        dssElem.addContent( createDatasetNamerElement( dsNamer));
      }

      // Add 'datasetFilter' elements
      list = dsSource.getDatasetFilterList();
      for ( int j=0; j < list.size(); j++)
      {
        DatasetFilter dsFilter = (DatasetFilter) list.get(j);
        dssElem.addContent( createDatasetFilterElement( dsFilter));
      }
    }

    return( dssElem);
  }
private org.jdom2.Element createDatasetSourceElement( DatasetSource dsSource)
  {
    Element dssElem = new Element("datasetSource", CATALOG_GEN_CONFIG_NAMESPACE_0_5);
    if ( dsSource != null)
    {
      // Add 'name' attribute.
      if ( dsSource.getName() != null)
      {
        dssElem.setAttribute( "name", dsSource.getName());
      }

      // Add 'type' attribute.
      if ( dsSource.getType() != null)
      {
        dssElem.setAttribute( "type", dsSource.getType().toString());
      }

      // Add 'structure' attribute.
      if ( dsSource.getStructure() != null)
      {
        dssElem.setAttribute( "structure", dsSource.getStructure().toString());
      }

      // Add 'accessPoint' attribute.
      if ( dsSource.getAccessPoint() != null)
      {
        dssElem.setAttribute( "accessPoint", dsSource.getAccessPoint());
      }

      // Add 'createCatalogRefs' attribute.
      dssElem.setAttribute( "createCatalogRefs", Boolean.toString(  dsSource.isCreateCatalogRefs()));

      // Add 'resultService' element
      ResultService rs = dsSource.getResultService();
      dssElem.addContent( createResultServiceElement( rs));

      // Add 'datasetNamer' elements
      java.util.List list = dsSource.getDatasetNamerList();
      for ( int j=0; j < list.size(); j++)
      {
        DatasetNamer dsNamer = (DatasetNamer) list.get(j);
        dssElem.addContent( createDatasetNamerElement( dsNamer));
      }

      // Add 'datasetFilter' elements
      list = dsSource.getDatasetFilterList();
      for ( int j=0; j < list.size(); j++)
      {
        DatasetFilter dsFilter = (DatasetFilter) list.get(j);
        dssElem.addContent( createDatasetFilterElement( dsFilter));
      }
    }

    return( dssElem);
  }
Create a 'DatasetSource' JDOM element