|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjoperties.interpreters.Interpreters
public class Interpreters
Class which holds the registered Interpreters and provides methods for accessing them.
Field Summary | |
---|---|
private static java.util.Map<java.lang.Class<?>,AbstractInterpreter<?>> |
interpreters
The map which holds the interpreters based on the class they interpret. |
Constructor Summary | |
---|---|
Interpreters()
|
Method Summary | ||
---|---|---|
static
|
getInterpreter(java.lang.Class<T> classToInterpret)
This method will return a registered interpreter which interprets the provided class (if found). |
|
static java.util.Collection<AbstractInterpreter<?>> |
getInterpreters()
This method returns a collection (LinkedList internally) which contains all the registered interpreters. |
|
static java.util.List<java.lang.Class<?>> |
getSupportedClasses()
This method returns a list of classes that the registered interpreters interpret. |
|
static java.util.List<java.lang.String> |
getSupportedClassesNames()
This method returns a list of the names of the classes that the registered interpreters interpret. |
|
static boolean |
isClassSupported(java.lang.Class<?> classToInterpret)
This method returns true if the provided class is supported by one of the registered interpreters. |
|
static boolean |
registerInterpreter(AbstractInterpreter<?> interpreter)
This method registers an interpreter replacing any old one that interprets the same class. |
|
static boolean |
registerInterpreter(AbstractInterpreter<?> interpreter,
boolean replace)
This method registers an interpreter based on the class that it interprets. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static java.util.Map<java.lang.Class<?>,AbstractInterpreter<?>> interpreters
Constructor Detail |
---|
public Interpreters()
Method Detail |
---|
public static boolean registerInterpreter(AbstractInterpreter<?> interpreter, boolean replace)
interpreter
- The interpreter to register.replace
- If this is true then any old interpreter which interprets the
same class will be replaced.
public static boolean registerInterpreter(AbstractInterpreter<?> interpreter)
interpreter
- The interpreter to register.
public static java.util.Collection<AbstractInterpreter<?>> getInterpreters()
public static <T> AbstractInterpreter<T> getInterpreter(java.lang.Class<T> classToInterpret) throws NoApropriateInterpeterFoundException
T
- The Type of the class that the returned interpreter will
interpret.classToInterpret
- The class that the returned interpreter will interpret.
NoApropriateInterpeterFoundException
- If no interpreter is registered for the provided class.public static java.util.List<java.lang.Class<?>> getSupportedClasses()
public static java.util.List<java.lang.String> getSupportedClassesNames()
public static boolean isClassSupported(java.lang.Class<?> classToInterpret)
classToInterpret
- The class to determine if it is supported.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |