public class ConverterRegistry extends Object
| Constructor and Description |
|---|
ConverterRegistry() |
| Modifier and Type | Method and Description |
|---|---|
static <V,T extends Tag> |
convertToTag(String name,
V value)
Converts the given value to a tag.
|
static <T extends Tag,V> |
convertToValue(T tag)
Converts the given tag to a value.
|
static <T extends Tag,V> |
register(Class<T> tag,
Class<V> type,
TagConverter<T,V> converter)
Registers a converter.
|
static <T extends Tag,V> |
unregister(Class<T> tag,
Class<V> type)
Unregisters a converter.
|
public static <T extends Tag,V> void register(Class<T> tag, Class<V> type, TagConverter<T,V> converter) throws ConverterRegisterException
T - Tag type to convert from.V - Value type to convert to.tag - Tag type class to register the converter to.type - Value type class to register the converter to.converter - Converter to register.ConverterRegisterException - If an error occurs while registering the converter.public static <T extends Tag,V> void unregister(Class<T> tag, Class<V> type)
T - Tag type to unregister.V - Value type to unregister.tag - Tag type class to unregister.type - Value type class to unregister.public static <T extends Tag,V> V convertToValue(T tag) throws ConversionException
T - Tag type to convert from.V - Value type to convert to.tag - Tag to convert.ConversionException - If a suitable converter could not be found.public static <V,T extends Tag> T convertToTag(String name, V value) throws ConversionException
V - Value type to convert from.T - Tag type to convert to.name - Name of the resulting tag.value - Value to convert.ConversionException - If a suitable converter could not be found.Copyright © 2021. All rights reserved.