Interface IExternalValueFactory

  • All Known Implementing Classes:
    DefaultExternalValueFactory

    public interface IExternalValueFactory
    This class provides run-time support only. It creates and destroys certain types based on load and unload
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      com.spencerwi.either.Either<java.lang.Exception,​Value> create​(java.lang.String type, java.util.List<Value> args)
      Creates a new interpreter value for the specified type using the supplied arguments
      Value destroy​(Value value)
      Destruction of values created by the factory.
      boolean supports​(java.lang.String type)
      Check if a certain type is supported by the external value factory
    • Method Detail

      • supports

        boolean supports​(java.lang.String type)
        Check if a certain type is supported by the external value factory
        Parameters:
        type -
        Returns:
        true if the type is supported by create(String, List)
      • create

        com.spencerwi.either.Either<java.lang.Exception,​Value> create​(java.lang.String type,
                                                                            java.util.List<Value> args)
        Creates a new interpreter value for the specified type using the supplied arguments
        Parameters:
        type - the type to create
        args - the arguments used to create the value
        Returns:
        the value or an exception if creation fails
      • destroy

        Value destroy​(Value value)
               throws InterpreterException
        Destruction of values created by the factory. Destruction must make sure all resources hold by this value is freed
        Parameters:
        value - the value to destroy
        Returns:
        void return
        Throws:
        InterpreterException - any destruction error description