Class CsvTransformer

java.lang.Object
ddf.catalog.transformer.csv.common.CsvTransformer

public class CsvTransformer extends Object
Common Library used to transform Metacards into CSV text.
See Also:
  • MetacardTransformer
  • Metacard
  • QueryResponseTransformer
  • QueryResponse
  • Attribute
  • Method Details

    • createResponse

      public static ddf.catalog.data.BinaryContent createResponse(Appendable csv)
    • writeMetacardsToCsv

      public static Appendable writeMetacardsToCsv(List<ddf.catalog.data.Metacard> metacards, List<ddf.catalog.data.AttributeDescriptor> orderedAttributeDescriptors, Map<String,String> aliasMap) throws ddf.catalog.transform.CatalogTransformerException
      Throws:
      ddf.catalog.transform.CatalogTransformerException
    • sortAttributes

      public static List<ddf.catalog.data.AttributeDescriptor> sortAttributes(Set<ddf.catalog.data.AttributeDescriptor> attributeSet, List<String> attributeOrder)
    • getAllCsvAttributeDescriptors

      public static Set<ddf.catalog.data.AttributeDescriptor> getAllCsvAttributeDescriptors(List<ddf.catalog.data.Metacard> metacards)
      Given a list of Metacards, returns a set of AttributeDescriptors that contains all attributes that exist on the given metacard types. Object and Binary types are excluded
      Parameters:
      metacards - List of metacards from which to extract attribute descriptors
      Returns:
      a Set of s that are on each metacard
    • getOnlyRequestedAttributes

      public static Set<ddf.catalog.data.AttributeDescriptor> getOnlyRequestedAttributes(List<ddf.catalog.data.Metacard> metacards, Set<String> requestedAttributes)
      Given a list of Metacards and a string set of requested attributes, returns a set of AttributeDescriptors containing the requested attributes.
    • getNonEmptyValueAttributes

      public static Set<ddf.catalog.data.AttributeDescriptor> getNonEmptyValueAttributes(List<ddf.catalog.data.Metacard> metacards)
      Given a list of Metacards, return only the attribute descriptors that have a non-empty value. Returns a set of AttributeDescriptors containing the attributes with non-empty values.