Class TranslatorRegistry
- java.lang.Object
-
- net.officefloor.plugin.xml.marshall.translate.TranslatorRegistry
-
public class TranslatorRegistry extends java.lang.Object
Registry ofTranslator
instances by type they translate.- Author:
- Daniel Sagenschneider
-
-
Field Summary
Fields Modifier and Type Field Description protected Translator
defaultTranslator
DefaultTranslator
.protected java.util.Map<java.lang.Class<?>,Translator>
translators
Map ofTranslator
instances.
-
Constructor Summary
Constructors Constructor Description TranslatorRegistry()
Default Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Translator
getTranslator(java.lang.Class<?> type)
Obtains theTranslator
for the input type.void
registerTranslator(java.lang.Class<?> type, Translator translator)
Registers aTranslator
.
-
-
-
Field Detail
-
defaultTranslator
protected final Translator defaultTranslator
DefaultTranslator
.
-
translators
protected final java.util.Map<java.lang.Class<?>,Translator> translators
Map ofTranslator
instances.
-
-
Method Detail
-
registerTranslator
public void registerTranslator(java.lang.Class<?> type, Translator translator)
Registers aTranslator
.- Parameters:
type
- Type theTranslator
translates.translator
-Translator
.
-
getTranslator
public Translator getTranslator(java.lang.Class<?> type) throws XmlMarshallException
Obtains theTranslator
for the input type.- Parameters:
type
- Type requiring aTranslator
.- Returns:
Translator
for the type.- Throws:
XmlMarshallException
- If fails to obtain aTranslator
.
-
-