org.jboss.msc.translate
Class CastingTranslator<I,O>
java.lang.Object
org.jboss.msc.translate.CastingTranslator<I,O>
- All Implemented Interfaces:
- Translator<I,O>
public final class CastingTranslator<I,O>
- extends Object
- implements Translator<I,O>
A translator which casts (narrows) the type of its input.
- Author:
- David M. Lloyd
Method Summary |
O |
translate(I input)
Translate an input value. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CastingTranslator
public CastingTranslator(Class<O> type)
- Construct a new instance.
- Parameters:
type
- the type to narrow to
translate
public O translate(I input)
throws TranslationException
- Translate an input value.
- Specified by:
translate
in interface Translator<I,O>
- Parameters:
input
- the input value
- Returns:
- the output value
- Throws:
TranslationException
- if the value could not be translated for some reason
Copyright © 2010 JBoss, a division of Red Hat, Inc.