public class XmlInputTransformer extends Object implements InputTransformer, Describable
InputTransformer
that can be configured to parse any XML into a Metacard
It is
configured through setSaxEventHandlerConfiguration(List)
and XmlInputTransformer#getMetacardType()
Constructor and Description |
---|
XmlInputTransformer() |
Modifier and Type | Method and Description |
---|---|
String |
getDescription()
Returns a description of the describable item.
|
String |
getId()
Returns the name, aka ID, of the describable item.
|
String |
getOrganization()
Returns the organization associated with the describable item.
|
String |
getTitle()
Returns the title of the describable item.
|
String |
getVersion()
Retrieve the version.
|
void |
setDescription(String description) |
void |
setId(String id) |
void |
setOrganization(String organization) |
void |
setSaxEventHandlerConfiguration(List<String> saxEventHandlerConfiguration)
Setter to set the configuration of SaxEventHandlers used to parse metacards
|
void |
setSaxEventHandlerFactories(List<SaxEventHandlerFactory> saxEventHandlerFactories)
Setter to set the list of all
SaxEventHandlerFactory s. |
void |
setTitle(String title) |
void |
setVersion(String version) |
Metacard |
transform(InputStream inputStream)
Takes in an XML
InputStream and returns a populated Metacard The Metacard is
populated with all attributes that have been parsed by the SaxEventHandler s declared in
saxEventHandlerConfiguration s |
Metacard |
transform(InputStream inputStream,
String id)
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 SaxEventHandler s
declared in saxEventHandlerConfiguration s and with the specific ID |
public Metacard transform(InputStream inputStream) throws CatalogTransformerException
InputStream
and returns a populated Metacard
The Metacard is
populated with all attributes that have been parsed by the SaxEventHandler
s declared in
saxEventHandlerConfiguration
stransform
in interface InputTransformer
inputStream
- an XML input stream to be turned into a MetacardCatalogTransformerException
IOException
public Metacard transform(InputStream inputStream, String id) throws CatalogTransformerException, IOException
InputStream
and an ID and returns a populated Metacard
The
Metacard is populated with all attributes that have been parsed by the SaxEventHandler
s
declared in saxEventHandlerConfiguration
s and with the specific IDtransform
in interface InputTransformer
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
CatalogTransformerException
IOException
public void setSaxEventHandlerFactories(List<SaxEventHandlerFactory> saxEventHandlerFactories)
SaxEventHandlerFactory
s. Usually called from a blueprint,
and the blueprint will keep the factories updatedsaxEventHandlerFactories
- a list of all SaxEventHandlerFactories (usually a list of all
factories that are available as services)public void setSaxEventHandlerConfiguration(List<String> saxEventHandlerConfiguration)
saxEventHandlerConfiguration
- a list of SaxEventHandlerFactory idspublic String getVersion()
Describable
getVersion
in interface Describable
public String getId()
Describable
html for a MetacardTransformer
that transforms Metacard
s to HTML
getId
in interface Describable
public String getTitle()
Describable
getTitle
in interface Describable
public String getDescription()
Describable
getDescription
in interface Describable
public String getOrganization()
Describable
getOrganization
in interface Describable
public void setVersion(String version)
public void setId(String id)
public void setTitle(String title)
public void setDescription(String description)
public void setOrganization(String organization)
This work is licensed under a Creative Commons Attribution 4.0 International License.