- All Superinterfaces:
ONLauncherData
SPI (Service Provider Interface) for
ObjectNamerLauncher
.
The naming convention used by the BZDev class library and some
related libraries is to use the last component of a module name
as the value returned by ONLauncherData.getName()
unless there is a
conflict. Service providers in the BZDev library will create
object-namer launchers with the following names:
- anim2d to create an instance of
Animation2DLauncher
. - devqsim - to create an instance of
SimulationLauncher
. - drama - to create an instance of
DramaSimulationLauncher
.
ONLauncherData
,
which this class extends, provides methods for getting the name
of a launcher and an input stream for YAML-formatted data describing
the expressions the launcher can handle. The input stream must
use a UTF-8 character set. If the input stream contains tabs, the
method ONLauncherData.getTabSpacing()
must be defined if
the spacing is not 8.
The stream must be a YAML 1.2 document whose top-level object contains
the following properties, the values of which are lists:
- argumentTypes - a
JSArray
providing a list of strings giving the fully qualified class names for arguments used by constructors, functions, and methods. The types String, int, double, Integer, or Double should not be used, as these are allowed by default. - fieldClasses - a
JSArray
providing a list of strings giving the fully qualified class names for classes containing fields that can be used. The types of the fields that will be included are boolean, int, long, double,String
, or an enumeration. - functionClasses - a
JSArray
providing a list of strings giving the fully qualified class names for classes whose public, static methods returning an allowable type have a fixed number of arguments whose types are boolean, int, long, double, or a type provided by the argumentTypes property. - methodClasses - a
JSArray
providing a list of strings giving the fully qualified class names classes whose instance methods returning an allowable type have a fixed number of arguments with types int, double, long, boolean,String
, or a type provided by the argumentTypes property. - returnTypes - a
JSArray
providing a list of strings giving the fully qualified class names for objects that the parser can return or can construct. The constructors that will be provided are those with a fixed number of arguments whose types are int, long, double, boolean,String
, or a type provided by the argumentTypes property.
Typically, a provider will implement the following methods:
- getName(). This will return the name of the provider. Names are expected to be unique.
- onlClass(). This method returns a class: a
subclass on
ObjectNamerLauncher
. - getInputStream(). The implementation of this method will return an input stream containing the YAML data described above. Typically it simply calls the launcher's getResourceStream() method.
- description(). This returns a short description of the launcher. It is a good practice to use resource bundles so that the description can be easily localized.
-
Method Summary
Modifier and TypeMethodDescriptionClass<? extends ObjectNamerLauncher>
onlClass()
Get the class for theObjectNamerLauncher
that this this provider will help create.Methods inherited from interface org.bzdev.lang.spi.ONLauncherData
description, getInputStream, getModuleName, getName, getTabSpacing
-
Method Details
-
onlClass
Class<? extends ObjectNamerLauncher> onlClass()Get the class for theObjectNamerLauncher
that this this provider will help create.- Returns:
- the class
-