Package com.snmp4j.smi
Class CompilationResult
java.lang.Object
com.snmp4j.smi.CompilationResult
- All Implemented Interfaces:
Serializable
The
CompilationResult
class holds the MIB module names successfully parsed for each MIB file
or the parsing errors that were detected during compilation.- Author:
- Frank Fock
- See Also:
- Serialized Form
-
Constructor Summary
ConstructorDescriptionCreates newCompilationResult
from file name, module names, and SMI error list.CompilationResult(String fileName, List<String> moduleNames, List<SmiError> smiErrorList, String zipFileName)
Creates newCompilationResult
from file name, module names, and SMI error list. -
Method Summary
Modifier and TypeMethodDescriptiongetFailedFiles(List<CompilationResult> compilationResults)
Gets the file names from the givenCompilationResult
s which had errors during compilation.Gets the file name (stream name) of the MIB specification.Gets the MIB module names successfully parsed from this MIB specification identified bygetFileName()
.getModuleNames(List<CompilationResult> compilationResults)
Get all MIB module names successfully compiled from the given compilation result list.Gets a List ofSmiError
instances describing the SMI syntax and semantic errors encountered in the MIB specification identified bygetFileName()
.Returns the file name of the enclosing ZIP file (if present).boolean
Returnstrue
if the compilation result contains detected SMI errors.static boolean
hasErrors(List<CompilationResult> compilationResults)
Returnstrue
if the list of compilation results contains at least one detected SMI error.toString()
-
Constructor Details
-
CompilationResult
Creates newCompilationResult
from file name, module names, and SMI error list.- Parameters:
fileName
- the file name of the compiled MIB file.moduleNames
- the MIB module names parsed from the file.smiErrorList
- the SMI errors collected.
-
CompilationResult
public CompilationResult(String fileName, List<String> moduleNames, List<SmiError> smiErrorList, String zipFileName)Creates newCompilationResult
from file name, module names, and SMI error list.- Parameters:
fileName
- the file name of the compiled MIB file.moduleNames
- the MIB moduke names parsed from the file.smiErrorList
- the SMI errors collected.zipFileName
- the file name of the ZIP file containingfileName
.
-
-
Method Details
-
getFileName
Gets the file name (stream name) of the MIB specification.- Returns:
- a file/stream name.
-
getZipFileName
Returns the file name of the enclosing ZIP file (if present).- Returns:
- the file name (path) of the ZIP file that contains this SMI file or
null
if the compiled file was not part of a ZIP file. - Since:
- 1.4
-
getModuleNames
Gets the MIB module names successfully parsed from this MIB specification identified bygetFileName()
.- Returns:
- a List of MIB module names. If no MIB module names are returned (
null
or empty List) then see thegetSmiErrorList()
for the errors encountered during compilation.
-
getSmiErrorList
Gets a List ofSmiError
instances describing the SMI syntax and semantic errors encountered in the MIB specification identified bygetFileName()
.- Returns:
- a List of
SmiError
instances, each describing a SMI syntax or semantic error.
-
hasErrors
public boolean hasErrors()Returnstrue
if the compilation result contains detected SMI errors.- Returns:
false
if the compilation was successful.- Since:
- 1.4
-
hasErrors
Returnstrue
if the list of compilation results contains at least one detected SMI error.- Parameters:
compilationResults
- a list of compilation results to scan for errors.- Returns:
false
if the compilation was successful.- Since:
- 1.4
-
getFailedFiles
Gets the file names from the givenCompilationResult
s which had errors during compilation.- Parameters:
compilationResults
- the compilation results.- Returns:
- the list of failed files (possibly empty).
- Since:
- 1.4
-
getModuleNames
Get all MIB module names successfully compiled from the given compilation result list.- Parameters:
compilationResults
- the compilation results from aSmiManager.compile(NamedInputStream[], CompilationMonitor, SmiCompiler.TargetMode, SmiCompiler.OverwriteMode, SmiCompiler.Strictness)
run.- Returns:
- a possibly empty list of successfully compiled MIB module names. See also
getModuleNames()
. - Since:
- 1.7.1
-
toString
-