# Class BSHPackageDeclaration

java.lang.Object
bsh.BSHPackageDeclaration

All Implemented Interfaces:
  `Serializable`

public class BSHPackageDeclaration extends Object

See Also:
  - Serialized Form

## Field Summary

Fields
Modifier and Type
Field
Description
`protected bsh.Node[]`
`children`
`protected int`
`id`
`static bsh.SimpleNode`
`JAVACODE`
`protected bsh.Node`
`parent`

## Constructor Summary

Constructors
Constructor
Description
`BSHPackageDeclaration(int id)`

## Method Summary

Modifier and Type
Method
Description
`void`
`dump(String prefix)`
`Object`
`eval(CallStack callstack, Interpreter interpreter)`
This is the general signature for evaluation of a node.
`bsh.SimpleNode`
`getChild(int i)`
`int`
`getLineNumber()`
Get the line number of the starting token
`String`
`getSourceFile()`
Get the name of the source file (or more generally source) of the text from which this node was parsed.
`String`
`getText()`
Get the text of the tokens comprising this node.
`void`
`jjtAddChild(bsh.Node n, int i)`
`void`
`jjtClose()`
`bsh.Node`
`jjtGetChild(int i)`
`int`
`jjtGetNumChildren()`
`bsh.Node`
`jjtGetParent()`
`void`
`jjtOpen()`
`void`
`jjtSetParent(bsh.Node n)`
`void`
`prune()`
Detach this node from its parent.
`void`
`setSourceFile(String sourceFile)`
Set the name of the source file (or more generally source) of the text from which this node was parsed.
`String`
`toString()`
`String`
`toString(String prefix)`

### Methods inherited from class Object

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

## Field Details

### JAVACODE

public static bsh.SimpleNode JAVACODE

### parent

protected bsh.Node parent

### children

protected bsh.Node[] children

### id

protected int id

## Constructor Details

### BSHPackageDeclaration

public BSHPackageDeclaration(int id)

## Method Details

### eval

public Object eval(CallStack callstack, Interpreter interpreter) throws EvalError
This is the general signature for evaluation of a node.

Throws:
  `EvalError`

### jjtOpen

public void jjtOpen()

### jjtClose

public void jjtClose()

### jjtSetParent

public void jjtSetParent(bsh.Node n)

### jjtGetParent

public bsh.Node jjtGetParent()

### jjtAddChild

public void jjtAddChild(bsh.Node n, int i)

### jjtGetChild

public bsh.Node jjtGetChild(int i)

### getChild

public bsh.SimpleNode getChild(int i)

### jjtGetNumChildren

public int jjtGetNumChildren()

### toString

public String toString()

Overrides:
  `toString` in class `Object`

### toString

public String toString(String prefix)

### dump

public void dump(String prefix)

### prune

public void prune()
Detach this node from its parent. This is primarily useful in node serialization. (see BSHMethodDeclaration)

### setSourceFile

public void setSourceFile(String sourceFile)
Set the name of the source file (or more generally source) of the text from which this node was parsed.

### getSourceFile

public String getSourceFile()
Get the name of the source file (or more generally source) of the text from which this node was parsed. This will recursively search up the chain of parent nodes until a source is found or return a string indicating that the source is unknown.

### getLineNumber

public int getLineNumber()
Get the line number of the starting token

### getText

public String getText()
Get the text of the tokens comprising this node.