All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class Snmp.MibMacro

java.lang.Object
   |
   +----Snmp.MibMacro

public class MibMacro
extends Object
The MibMacro class is used to parse the use of OBJECT-TYPE and TRAP-TYPE macros in a MIB module.

Each instance of this class corresponds to a macro definition in a module. The MACRO definition parser (constructor) is really unimplemented, and may never be. Only supports specific MACROs, i.e. OBJECT-TYPE and TRAP-TYPE, which are both hardcoded, so MACRO definitions are ignored except for the name. The instance name corresponds to the specific macro, e.g. OBJECT-TYPE.

API users will not use this class directly.


Variable Index

 o name
The name of this MACRO instance, e.g.

Constructor Index

 o MibMacro(String, Vector)
Constructor, which only uses the name of the MACRO.

Method Index

 o parseACCESS(MibModule, String)
parse the Access clause.
 o parseINDEX(MibModule, StreamTokenizer)
parse the index clause.
 o parseMacro(String, String, MibModule, StreamTokenizer)
Parse the use of this macro.
 o parseObjectType(String, MibModule, StreamTokenizer)
Parser for OBJECT-TYPE.
 o parseTrapType(String, MibModule, StreamTokenizer)
Parser for TRAP-TYPE.

Variables

 o name
 public String name
The name of this MACRO instance, e.g. TRAP-TYPE

Constructors

 o MibMacro
 public MibMacro(String nam,
                 Vector toks)
Constructor, which only uses the name of the MACRO. The tokens are ignored since we cannot parse a macro definition

Methods

 o parseMacro
 public Object parseMacro(String label,
                          String nam,
                          MibModule module,
                          StreamTokenizer tok) throws MibException, IOException
Parse the use of this macro. Calls hardcoded parsers for each type.

Throws: MibException
is thrown on parse errors.
Throws: IOException
is thrown on file IO errors.
 o parseObjectType
 public MibNode parseObjectType(String label,
                                MibModule module,
                                StreamTokenizer tok) throws MibException, IOException
Parser for OBJECT-TYPE.

Throws: MibException
is thrown on parse errors.
Throws: IOException
is thrown on file IO errors.
 o parseTrapType
 public MibTrap parseTrapType(String label,
                              MibModule module,
                              StreamTokenizer tok) throws MibException, IOException
Parser for TRAP-TYPE.

Throws: MibException
is thrown on parse errors.
Throws: IOException
is thrown on file IO errors.
 o parseACCESS
 protected int parseACCESS(MibModule module,
                           String access)
parse the Access clause. API users need not use this method

 o parseINDEX
 protected Vector parseINDEX(MibModule module,
                             StreamTokenizer tok) throws IOException, MibException
parse the index clause. API users nedd not use this method.

Throws: MibException
is thrown upon parse errors.
Throws: IOException
is thrown upon IO errors.

All Packages  Class Hierarchy  This Package  Previous  Next  Index