play.classloading
Class ApplicationClasses

java.lang.Object
  extended by play.classloading.ApplicationClasses

public class ApplicationClasses
extends java.lang.Object

Application classes container.


Nested Class Summary
static class ApplicationClasses.ApplicationClass
          Represent a application class
 
Constructor Summary
ApplicationClasses()
           
 
Method Summary
 void add(ApplicationClasses.ApplicationClass applicationClass)
          Put a new class to the cache.
 java.util.List<ApplicationClasses.ApplicationClass> all()
          All loaded classes.
 void clear()
          Clear the classes cache
 java.util.List<ApplicationClasses.ApplicationClass> getAnnotatedClasses(java.lang.Class<? extends java.lang.annotation.Annotation> clazz)
          Retrieve all application classes with a specific annotation.
 ApplicationClasses.ApplicationClass getApplicationClass(java.lang.String name)
          Get a class by name
 java.util.List<ApplicationClasses.ApplicationClass> getAssignableClasses(java.lang.Class<?> clazz)
          Retrieve all application classes assignable to this class.
static VirtualFile getJava(java.lang.String name)
          Retrieve the corresponding source file for a given class name.
 boolean hasClass(java.lang.String name)
          Does this class is already loaded ?
 void remove(ApplicationClasses.ApplicationClass applicationClass)
          Remove a class from cache
 void remove(java.lang.String applicationClass)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ApplicationClasses

public ApplicationClasses()
Method Detail

clear

public void clear()
Clear the classes cache


getApplicationClass

public ApplicationClasses.ApplicationClass getApplicationClass(java.lang.String name)
Get a class by name

Parameters:
name - The fully qualified class name
Returns:
The ApplicationClass or null

getAssignableClasses

public java.util.List<ApplicationClasses.ApplicationClass> getAssignableClasses(java.lang.Class<?> clazz)
Retrieve all application classes assignable to this class.

Parameters:
clazz - The superclass, or the interface.
Returns:
A list of application classes.

getAnnotatedClasses

public java.util.List<ApplicationClasses.ApplicationClass> getAnnotatedClasses(java.lang.Class<? extends java.lang.annotation.Annotation> clazz)
Retrieve all application classes with a specific annotation.

Parameters:
clazz - The annotation class.
Returns:
A list of application classes.

all

public java.util.List<ApplicationClasses.ApplicationClass> all()
All loaded classes.

Returns:
All loaded classes

add

public void add(ApplicationClasses.ApplicationClass applicationClass)
Put a new class to the cache.


remove

public void remove(ApplicationClasses.ApplicationClass applicationClass)
Remove a class from cache


remove

public void remove(java.lang.String applicationClass)

hasClass

public boolean hasClass(java.lang.String name)
Does this class is already loaded ?

Parameters:
name - The fully qualified class name

getJava

public static VirtualFile getJava(java.lang.String name)
Retrieve the corresponding source file for a given class name. It handles innerClass too !

Parameters:
name - The fully qualified class name
Returns:
The virtualFile if found

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Guillaume Bort & zenexity - Distributed under Apache 2 licence, without any warrantly