Package com.snmp4j.smi
Interface SmiErrorInfo
- All Known Implementing Classes:
SmiError
public interface SmiErrorInfo
The
SmiErrorInfo
interface represents a syntax or semantic error in a SMI specification file.
The error is located at the provided row and column and the defective text is available as well.
In addition, error number and message are provided.
Applications may use this interface instead SmiError
to abstract from the concrete implementation
in their own application code.- Since:
- 1.7.1
-
Method Summary
Modifier and TypeMethodDescriptionint
Gets the column where the defective text was found in the text file.The text in the MIB specification that failed to parse.int
Gets the ending column where the defective text ends in the text file.int
Gets the bottom row of the defective text in the text file.int
Gets the error code of the error.String[]
Returns the expected text alternatives identified by the SMI compiler.Gets the error message for the error.Gets the MIB module name (if available) of the MIB module that contains the error.int
Gets the byte position in the input stream where the defective text starts.int
getRow()
Gets the row where the defective text was found in the text file.Gets the error message for the error in a short form, without error number and location information.
-
Method Details
-
getColumn
int getColumn()Gets the column where the defective text was found in the text file.- Returns:
- the one-based starting column of the error.
-
getEndColumn
int getEndColumn()Gets the ending column where the defective text ends in the text file.- Returns:
- the one-based ending column of the error.
- Since:
- 1.4
-
getErrorNumber
int getErrorNumber()Gets the error code of the error. See http://www.agentpp.com/mibdesigner3.x/MIBDesigner.pdf for a explanation of the error codes. If you doubt that an error is correctly reported, please first read section 6 "MIB Design" of that PDF document before contacting support.- Returns:
- an error code, numerically identifying the type of error.
-
getMessage
String getMessage()Gets the error message for the error.- Returns:
- a human readable error message describing the error in English.
-
getShortMessage
String getShortMessage()Gets the error message for the error in a short form, without error number and location information.- Returns:
- a human readable error message describing the error in English.
-
getDefectiveText
String getDefectiveText()The text in the MIB specification that failed to parse.- Returns:
- a text fragment which is located in the MIB specification at column
getColumn()
and rowgetRow()
.
-
getRow
int getRow()Gets the row where the defective text was found in the text file.- Returns:
- the one-based starting row of the error.
-
getEndRow
int getEndRow()Gets the bottom row of the defective text in the text file.- Returns:
- the one-based ending row of the error.
- Since:
- 1.4
-
getPosition
int getPosition()Gets the byte position in the input stream where the defective text starts.- Returns:
- the zero-based byte position of the defective text in the SMI specification.
- Since:
- 1.4
-
getModuleName
String getModuleName()Gets the MIB module name (if available) of the MIB module that contains the error.- Returns:
- a MIB module name or
null
if the MIB module name was not determinable.
-
getExpectedText
String[] getExpectedText()Returns the expected text alternatives identified by the SMI compiler.- Returns:
null
if no text was expected/could be identified as expected. Otherwise, a list of expected text is returned where each element provides one alternative.- Since:
- 1.4
-