Package org.esa.snap.core.metadata
Class XmlMetadataParserFactory
- java.lang.Object
-
- org.esa.snap.core.metadata.XmlMetadataParserFactory
-
public class XmlMetadataParserFactory extends Object
This factory class returns instances ofXmlMetadataParser
s that have been previously registered with it.
-
-
Constructor Summary
Constructors Constructor Description XmlMetadataParserFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T extends GenericXmlMetadata>
XmlMetadataParser<T>getParser(Class clazz)
Returns a parser instance for the given metadata class.static <T extends GenericXmlMetadata>
voidregisterParser(Class clazz, XmlMetadataParser<T> parser)
Registers a parser instance, attached to the given metadata class, to this factory.
-
-
-
Method Detail
-
registerParser
public static <T extends GenericXmlMetadata> void registerParser(Class clazz, XmlMetadataParser<T> parser)
Registers a parser instance, attached to the given metadata class, to this factory. The metadata class should be an extension ofGenericXmlMetadata
- Type Parameters:
T
- Generic type for metadata class.- Parameters:
clazz
- The metadata class.parser
- The parser instance.
-
getParser
public static <T extends GenericXmlMetadata> XmlMetadataParser<T> getParser(Class clazz) throws InstantiationException
Returns a parser instance for the given metadata class. If no parser was previously registered for the class, it will throw an exception.- Type Parameters:
T
- Generic type for the metadata class.- Parameters:
clazz
- The metadata class.- Returns:
- The parser instance.
- Throws:
InstantiationException
- Exception is thrown if no parser was registered for the input class.
-
-