Class XmlInputTransformer

java.lang.Object
org.codice.ddf.transformer.xml.streaming.lib.XmlInputTransformer
All Implemented Interfaces:
ddf.catalog.transform.InputTransformer, ddf.catalog.util.Describable, org.codice.ddf.platform.services.common.Describable

public class XmlInputTransformer extends Object implements ddf.catalog.transform.InputTransformer, ddf.catalog.util.Describable
A InputTransformer that can be configured to parse any XML into a Metacard It is configured through setSaxEventHandlerConfiguration(List) and
invalid reference
XmlInputTransformer#getMetacardType()
  • Constructor Details

    • XmlInputTransformer

      public XmlInputTransformer()
  • Method Details

    • transform

      public ddf.catalog.data.Metacard transform(InputStream inputStream) throws ddf.catalog.transform.CatalogTransformerException
      Takes in an XML InputStream and returns a populated Metacard The Metacard is populated with all attributes that have been parsed by the SaxEventHandlers declared in saxEventHandlerConfigurations
      Specified by:
      transform in interface ddf.catalog.transform.InputTransformer
      Parameters:
      inputStream - an XML input stream to be turned into a Metacard
      Returns:
      a populated Metacard
      Throws:
      ddf.catalog.transform.CatalogTransformerException
      IOException
    • transform

      public ddf.catalog.data.Metacard transform(InputStream inputStream, String id) throws ddf.catalog.transform.CatalogTransformerException, IOException
      Takes in an XML InputStream and an ID and returns a populated Metacard The Metacard is populated with all attributes that have been parsed by the SaxEventHandlers declared in saxEventHandlerConfigurations and with the specific ID
      Specified by:
      transform in interface ddf.catalog.transform.InputTransformer
      Parameters:
      inputStream - an XML input stream to be turned into a Metacard.
      id - the attribute value for the Metacard.ID attribute that should be set in the generated Metacard
      Returns:
      a populated Metacard
      Throws:
      ddf.catalog.transform.CatalogTransformerException
      IOException
    • setSaxEventHandlerFactories

      public void setSaxEventHandlerFactories(List<org.codice.ddf.transformer.xml.streaming.SaxEventHandlerFactory> saxEventHandlerFactories)
      Setter to set the list of all SaxEventHandlerFactorys. Usually called from a blueprint, and the blueprint will keep the factories updated
      Parameters:
      saxEventHandlerFactories - a list of all SaxEventHandlerFactories (usually a list of all factories that are available as services)
    • setSaxEventHandlerConfiguration

      public void setSaxEventHandlerConfiguration(List<String> saxEventHandlerConfiguration)
      Setter to set the configuration of SaxEventHandlers used to parse metacards
      Parameters:
      saxEventHandlerConfiguration - a list of SaxEventHandlerFactory ids
    • getVersion

      public String getVersion()
      Specified by:
      getVersion in interface ddf.catalog.util.Describable
      Specified by:
      getVersion in interface org.codice.ddf.platform.services.common.Describable
    • getId

      public String getId()
      Specified by:
      getId in interface ddf.catalog.util.Describable
      Specified by:
      getId in interface org.codice.ddf.platform.services.common.Describable
    • getTitle

      public String getTitle()
      Specified by:
      getTitle in interface ddf.catalog.util.Describable
      Specified by:
      getTitle in interface org.codice.ddf.platform.services.common.Describable
    • getDescription

      public String getDescription()
      Specified by:
      getDescription in interface ddf.catalog.util.Describable
      Specified by:
      getDescription in interface org.codice.ddf.platform.services.common.Describable
    • getOrganization

      public String getOrganization()
      Specified by:
      getOrganization in interface ddf.catalog.util.Describable
      Specified by:
      getOrganization in interface org.codice.ddf.platform.services.common.Describable
    • setVersion

      public void setVersion(String version)
    • setId

      public void setId(String id)
    • setTitle

      public void setTitle(String title)
    • setDescription

      public void setDescription(String description)
    • setOrganization

      public void setOrganization(String organization)