Module org.spongepowered.plugin.spi
Package org.spongepowered.plugin.builtin
Class StandardPluginLanguageService
java.lang.Object
org.spongepowered.plugin.builtin.StandardPluginLanguageService
- All Implemented Interfaces:
PluginLanguageService
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncreatePluginCandidates
(Environment environment, PluginResource resource) Asks the service if the providedresource
can becomecandidates
.void
initialize
(Environment environment) Callback so that implementors can perform any necessary initialization of the service.protected boolean
isValidContainer
(Environment environment, Container container) protected boolean
isValidMetadata
(Environment environment, PluginMetadata metadata) protected Container
loadMetadataContainer
(Environment environment, InputStream stream) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.spongepowered.plugin.PluginLanguageService
name, pluginLoader
-
Field Details
-
logger
-
-
Constructor Details
-
StandardPluginLanguageService
public StandardPluginLanguageService()
-
-
Method Details
-
initialize
Description copied from interface:PluginLanguageService
Callback so that implementors can perform any necessary initialization of the service.- Specified by:
initialize
in interfacePluginLanguageService
- Parameters:
environment
- The environment the service is running under
-
createPluginCandidates
public List<PluginCandidate> createPluginCandidates(Environment environment, PluginResource resource) throws Exception Description copied from interface:PluginLanguageService
Asks the service if the providedresource
can becomecandidates
.It is left up to implementors on when to throw exceptions (typically from parsing the resource) or to simply return
lists
that are empty. Therefore it should be known that an empty list returned is not an error and should be discarded by callers of this method.- Specified by:
createPluginCandidates
in interfacePluginLanguageService
- Parameters:
environment
- The environmentresource
- The resource- Returns:
- The
candidates
- Throws:
Exception
-
loadMetadataContainer
protected Container loadMetadataContainer(Environment environment, InputStream stream) throws Exception - Throws:
Exception
-
isValidContainer
-
isValidMetadata
-