net.percederberg.mibble
Class MibImport

java.lang.Object
  extended by net.percederberg.mibble.MibImport
All Implemented Interfaces:
MibContext

public class MibImport
extends java.lang.Object
implements MibContext

A MIB import list. This class contains a referenc to another MIB and a number of symbols in it.

Since:
2.6

Method Summary
 MibSymbol findSymbol(java.lang.String name, boolean expanded)
          Searches for a named MIB symbol.
 java.util.Collection getAllSymbolNames()
          Returns all symbol names in this MIB import declaration.
 Mib getMib()
          Returns the imported MIB.
 java.lang.String getName()
          Returns the imported MIB name.
 void initialize(MibLoaderLog log)
          Initializes the MIB import.
 java.lang.String toString()
          Returns a string representation of this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

initialize

public void initialize(MibLoaderLog log)
                throws MibException
Initializes the MIB import. This will resolve all referenced symbols. This method will be called by the MIB loader.

Parameters:
log - the MIB loader log
Throws:
MibException - if an error was encountered during the initialization

getName

public java.lang.String getName()
Returns the imported MIB name.

Returns:
the imported MIB name

getMib

public Mib getMib()
Returns the imported MIB.

Returns:
the imported MIB

getAllSymbolNames

public java.util.Collection getAllSymbolNames()
Returns all symbol names in this MIB import declaration.

Returns:
a collection of the imported MIB symbol names

findSymbol

public MibSymbol findSymbol(java.lang.String name,
                            boolean expanded)
Searches for a named MIB symbol. This method may search outside the normal (or strict) scope, thereby allowing a form of relaxed search. Note that the results from the normal and expanded search may not be identical, due to the context chaining and the same symbol name appearing in various contexts.

NOTE: This is an internal method that should only be called by the MIB loader.

Specified by:
findSymbol in interface MibContext
Parameters:
name - the symbol name
expanded - the expanded scope flag
Returns:
the MIB symbol, or null if not found

toString

public java.lang.String toString()
Returns a string representation of this object.

Overrides:
toString in class java.lang.Object
Returns:
a string representation of this object