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 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

      Optional<ClassLocation> resolve(IBoxContext context, String name)
      Each resolver has a way to resolve the class it represents. This method will be called by the ClassLocator class to resolve the class if the prefix matches.
      Parameters:
      context - The current context of execution
      name - 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 the ClassLocator class to resolve the class if the prefix matches with imports.
      Parameters:
      context - The current context of execution
      name - The name of the class to resolve
      imports - The list of imports to use
      Returns:
      An optional class object representing the class if found