net.percederberg.mib
Class SymbolFactory

java.lang.Object
  |
  +--net.percederberg.mib.SymbolFactory

public class SymbolFactory
extends java.lang.Object

A factory class for creating symbols. This class is used to provide access to the default symbols from both semantical analysis steps.

Version:
1.1
Author:
Per Cederberg, per@percederberg.net

Constructor Summary
SymbolFactory(Mib mib)
          Creates a new symbol factory.
 
Method Summary
 Symbol createSymbol(java.lang.String name)
          Creates a symbol with the specified known name.
 Symbol findSymbol(java.lang.String name)
          Finds or creates a symbol with the specified known name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SymbolFactory

public SymbolFactory(Mib mib)
Creates a new symbol factory. The list of created symbols will initially be empty.

Parameters:
mib - the MIB where error should be reported
Method Detail

findSymbol

public Symbol findSymbol(java.lang.String name)
Finds or creates a symbol with the specified known name. The symbol name must be one of the known SNMPv1 or SNMPv2 definitions, or null will be returned. If a symbol with the specified name has already been created by this factory, that symbol will be returned instead of creating a new symbol.

Parameters:
name - the symbol name (from the import)
Returns:
the symbol found or created, or null if the symbol name was unrecognized

createSymbol

public Symbol createSymbol(java.lang.String name)
Creates a symbol with the specified known name. The symbol name must be one of the known SNMPv1 or SNMPv2 definitions, or null will be returned.

Parameters:
name - the symbol name (from the import)
Returns:
the symbol created, or null if the symbol name was unrecognized