public interface SourceContext extends SourceProperties
Modifier and Type | Method and Description |
---|---|
ClassLoader |
getClassLoader()
Obtains the
ClassLoader . |
InputStream |
getOptionalResource(String location)
Attempts to obtain the resource at the specified location.
|
InputStream |
getResource(String location)
Obtains the resource.
|
boolean |
isLoadingType()
Indicates if just loading as a type.
|
Class<?> |
loadClass(String name)
Loads the
Class . |
Class<?> |
loadOptionalClass(String name)
Attempts to load the specified
Class . |
getProperties, getProperty, getProperty, getPropertyNames
boolean isLoadingType()
Indicates if just loading as a type.
When loading as a type the configuration provided is disregarded. This allows sources to know when to load singleton configuration that will take effect.
Whether this is true
or false
the resulting
type should be the same.
true
if loading as a type.Class<?> loadClass(String name) throws UnknownClassError
Class
.name
- Name of the Class
.Class
.UnknownClassError
- If Class
is not available. Let this propagate as
OfficeFloor will handle it.InputStream getOptionalResource(String location)
location
- Location of the resource.InputStream
to the contents of the resource or
null
if the resource can not be found.InputStream getResource(String location) throws UnknownResourceError
location
- Location of the resource.InputStream
to the contents of the resource.UnknownResourceError
- If resource is not found. Let this propagate as OfficeFloor
will handle it.ClassLoader getClassLoader()
Obtains the ClassLoader
.
This is only provided in specific cases where a ClassLoader
is
required (such as creating a Proxy
). The other methods of this
interface should be used in preference to the returned
ClassLoader
.
ClassLoader
.Copyright © 2005–2016. All rights reserved.