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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetId()getTitle()voidsetDescription(String description) voidvoidsetOrganization(String organization) voidsetSaxEventHandlerConfiguration(List<String> saxEventHandlerConfiguration) Setter to set the configuration of SaxEventHandlers used to parse metacardsvoidsetSaxEventHandlerFactories(List<org.codice.ddf.transformer.xml.streaming.SaxEventHandlerFactory> saxEventHandlerFactories) Setter to set the list of allSaxEventHandlerFactorys.voidvoidsetVersion(String version) ddf.catalog.data.Metacardtransform(InputStream inputStream) Takes in an XMLInputStreamand returns a populatedMetacardThe Metacard is populated with all attributes that have been parsed by theSaxEventHandlers declared insaxEventHandlerConfigurationsddf.catalog.data.Metacardtransform(InputStream inputStream, String id) Takes in an XMLInputStreamand an ID and returns a populatedMetacardThe Metacard is populated with all attributes that have been parsed by theSaxEventHandlers declared insaxEventHandlerConfigurations and with the specific ID
-
Constructor Details
-
XmlInputTransformer
public XmlInputTransformer()
-
-
Method Details
-
transform
public ddf.catalog.data.Metacard transform(InputStream inputStream) throws ddf.catalog.transform.CatalogTransformerException Takes in an XMLInputStreamand returns a populatedMetacardThe Metacard is populated with all attributes that have been parsed by theSaxEventHandlers declared insaxEventHandlerConfigurations- Specified by:
transformin interfaceddf.catalog.transform.InputTransformer- Parameters:
inputStream- an XML input stream to be turned into a Metacard- Returns:
- a populated Metacard
- Throws:
ddf.catalog.transform.CatalogTransformerExceptionIOException
-
transform
public ddf.catalog.data.Metacard transform(InputStream inputStream, String id) throws ddf.catalog.transform.CatalogTransformerException, IOException Takes in an XMLInputStreamand an ID and returns a populatedMetacardThe Metacard is populated with all attributes that have been parsed by theSaxEventHandlers declared insaxEventHandlerConfigurations and with the specific ID- Specified by:
transformin interfaceddf.catalog.transform.InputTransformer- Parameters:
inputStream- an XML input stream to be turned into a Metacard.id- the attribute value for theMetacard.IDattribute that should be set in the generatedMetacard- Returns:
- a populated Metacard
- Throws:
ddf.catalog.transform.CatalogTransformerExceptionIOException
-
setSaxEventHandlerFactories
public void setSaxEventHandlerFactories(List<org.codice.ddf.transformer.xml.streaming.SaxEventHandlerFactory> saxEventHandlerFactories) Setter to set the list of allSaxEventHandlerFactorys. 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
Setter to set the configuration of SaxEventHandlers used to parse metacards- Parameters:
saxEventHandlerConfiguration- a list of SaxEventHandlerFactory ids
-
getVersion
- Specified by:
getVersionin interfaceddf.catalog.util.Describable- Specified by:
getVersionin interfaceorg.codice.ddf.platform.services.common.Describable
-
getId
- Specified by:
getIdin interfaceddf.catalog.util.Describable- Specified by:
getIdin interfaceorg.codice.ddf.platform.services.common.Describable
-
getTitle
- Specified by:
getTitlein interfaceddf.catalog.util.Describable- Specified by:
getTitlein interfaceorg.codice.ddf.platform.services.common.Describable
-
getDescription
- Specified by:
getDescriptionin interfaceddf.catalog.util.Describable- Specified by:
getDescriptionin interfaceorg.codice.ddf.platform.services.common.Describable
-
getOrganization
- Specified by:
getOrganizationin interfaceddf.catalog.util.Describable- Specified by:
getOrganizationin interfaceorg.codice.ddf.platform.services.common.Describable
-
setVersion
-
setId
-
setTitle
-
setDescription
-
setOrganization
-