Interface IClassResolver
- All Known Implementing Classes:
BaseResolver,BoxResolver,JavaResolver
public interface IClassResolver
This interface is to implement ways to resolve classes in BoxLang.
Each resolver can have a name and a way to resolve the class it represents.
The
ClassLocator class will then use the resolver and convert it to a
-
Method Summary
Modifier and TypeMethodDescriptiongetName()Each resolver has a unique human-readable nameEach resolver has a unique prefix which is used to call it.resolve(IBoxContext context, String name) Each resolver has a way to resolve the class it represents.resolve(IBoxContext context, String name, List<ImportDefinition> imports, IStruct properties) Each resolver has a way to resolve the class it represents.
-
Method Details
-
getName
String getName()Each resolver has a unique human-readable name- Returns:
- The resolver name
-
getPrefix
String getPrefix()Each resolver has a unique prefix which is used to call it. Do not add the:ex: java:, bx:, wirebox:, custom:- Returns:
- The prefix
-
resolve
Each resolver has a way to resolve the class it represents. This method will be called by theClassLocatorclass to resolve the class if the prefix matches.- Parameters:
context- The current context of executionname- The name of the class to resolve- Returns:
- An optional class object representing the class if found
-
resolve
Optional<ClassLocation> resolve(IBoxContext context, String name, List<ImportDefinition> imports, IStruct properties) Each resolver has a way to resolve the class it represents. This method will be called by theClassLocatorclass to resolve the class if the prefix matches with imports.- Parameters:
context- The current context of executionname- The name of the class to resolveimports- The list of imports to use- Returns:
- An optional class object representing the class if found
-