|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object play.Application
public class Application
A Play application.
Application creation is handled by the framework engine.
Constructor Summary | |
---|---|
Application(play.api.Application application)
Creates an application from a Scala Application value. |
Method Summary | ||
---|---|---|
java.lang.ClassLoader |
classloader()
Retrieves the application classloader. |
|
Configuration |
configuration()
Retrieves the application configuration/ |
|
java.io.File |
getFile(java.lang.String relativePath)
Retrieves a file relative to the application root path. |
|
java.util.Set<java.lang.String> |
getTypesAnnotatedWith(java.lang.String packageName,
java.lang.Class<? extends java.lang.annotation.Annotation> annotation)
Scans the application classloader to retrieve all types annotated with a specific annotation. |
|
boolean |
isDev()
Returns `true` if the application is `DEV` mode. |
|
boolean |
isProd()
Returns `true` if the application is `PROD` mode. |
|
boolean |
isTest()
Returns `true` if the application is `TEST` mode. |
|
java.io.File |
path()
Retrieves the application path. |
|
|
plugin(java.lang.Class<T> pluginClass)
Retrieve the plugin instance for the class. |
|
java.net.URL |
resource(java.lang.String relativePath)
Retrieves a resource from the classpath. |
|
java.io.InputStream |
resourceAsStream(java.lang.String relativePath)
Retrieves a resource stream from the classpath. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Application(play.api.Application application)
Method Detail |
---|
public java.io.File path()
public Configuration configuration()
public java.lang.ClassLoader classloader()
public java.io.File getFile(java.lang.String relativePath)
relativePath
- relative path of the file to fetch
public java.net.URL resource(java.lang.String relativePath)
relativePath
- relative path of the resource to fetch
public java.io.InputStream resourceAsStream(java.lang.String relativePath)
relativePath
- relative path of the resource to fetch
public <T> T plugin(java.lang.Class<T> pluginClass)
public java.util.Set<java.lang.String> getTypesAnnotatedWith(java.lang.String packageName, java.lang.Class<? extends java.lang.annotation.Annotation> annotation)
This method is useful for some plug-ins, for example the EBean plugin will automatically detect all types
annotated with @javax.persistance.Entity
.
Note that it is better to specify a very specific package to avoid expensive searches.
packageName
- the root package to scanannotation
- annotation class
public boolean isDev()
public boolean isProd()
public boolean isTest()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |