org.apache.felix.gogo.runtime

## Class Closure

- java.lang.Object
- - org.apache.felix.gogo.runtime.Closure

All Implemented Interfaces:
  Evaluate, Function

    public class Closure
    extends Object
    implements Function, Evaluate

### Field Summary

Fields
`static String` `LOCATION`
`static String` `PIPE_EXCEPTION`

### Constructor Summary

Constructors
Constructor and Description
`Closure(CommandSessionImpl session, Closure parent, CharSequence source)`
`Closure(CommandSessionImpl session, Closure parent, Parser.Program program)`

### Method Summary

All Methods Instance Methods Concrete Methods
`ClassLoader` `classLoader()`
`Path` `currentDir()`
`Object` `eval(Token t)`
`Object` `eval(Token t, boolean convertNumeric)`
`Object` `execute(CommandSession x, List<Object> values)` Execute this function and return the result.
`Object` `execute(CommandSession x, List<Object> values, Channel capturingOutput)`
`Object` `execute(Parser.Executable executable)`
`Object` `executeStatement(Parser.Statement statement)`
`Object` `expr(Token expr)`
`Object` `get(String name)`
`protected boolean` `isSet(String name, boolean def)`
`Object` `put(String key, Object value)`
`CommandSessionImpl` `session()`
`String` `toString()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Field Detail

#### LOCATION

    public static final String LOCATION

See Also:
  Constant Field Values

#### PIPE_EXCEPTION

    public static final String PIPE_EXCEPTION

See Also:
  Constant Field Values

### Constructor Detail

#### Closure

    public Closure(CommandSessionImpl session,
                   Closure parent,
                   CharSequence source)
            throws Exception

Throws:
  `Exception`

#### Closure

    public Closure(CommandSessionImpl session,
                   Closure parent,
                   Parser.Program program)

### Method Detail

#### session

    public CommandSessionImpl session()

#### execute

    public Object execute(CommandSession x,
                          List<Object> values)
                   throws Exception

Description copied from interface: `Function`
Execute this function and return the result.

Specified by:
  `execute` in interface `Function`
Parameters:
  `x` - the session
  `values` - the arguments
Returns:
  the result from the execution.
Throws:
  `Exception` - if anything goes terribly wrong

#### execute

    public Object execute(CommandSession x,
                          List<Object> values,
                          Channel capturingOutput)
                   throws Exception

Throws:
  `Exception`

#### eval

    public Object eval(Token t)
                throws Exception

Specified by:
  `eval` in interface `Evaluate`
Throws:
  `Exception`

#### eval

    public Object eval(Token t,
                       boolean convertNumeric)
                throws Exception

Throws:
  `Exception`

#### execute

    public Object execute(Parser.Executable executable)
                   throws Exception

Throws:
  `Exception`

#### executeStatement

    public Object executeStatement(Parser.Statement statement)
                            throws Exception

Throws:
  `Exception`

#### expr

    public Object expr(Token expr)

Specified by:
  `expr` in interface `Evaluate`

#### get

    public Object get(String name)

Specified by:
  `get` in interface `Evaluate`

#### put

    public Object put(String key,
                      Object value)

Specified by:
  `put` in interface `Evaluate`

#### currentDir

    public Path currentDir()

Specified by:
  `currentDir` in interface `Evaluate`

#### classLoader

    public ClassLoader classLoader()

Specified by:
  `classLoader` in interface `Evaluate`

#### isSet

    protected boolean isSet(String name,
                            boolean def)

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`