Module org.snmp4j

Interface VariableTextFormat

All Known Implementing Classes:
SimpleVariableTextFormat

public interface VariableTextFormat
The VariableTextFormat provides a textual representation of SNMP Variables, in dependence of their associated (instance) OID.
Since:
1.10
Version:
1.10
Author:
Frank Fock
  • Method Summary

    Modifier and Type
    Method
    Description
    format(OID instanceOID, Variable variable, boolean withOID)
    Returns a textual representation of the supplied variable against the optionally supplied instance OID.
    parse(int smiSyntax, String text)
    Parses a textual representation of a variable against a SMI type.
    parse(OID classOrInstanceOID, String text)
    Parses a textual representation of a variable against its associated OBJECT-TYPE OID.
    Parses a textual representation of a variable binding.
  • Method Details

    • format

      String format(OID instanceOID, Variable variable, boolean withOID)
      Returns a textual representation of the supplied variable against the optionally supplied instance OID.
      Parameters:
      instanceOID - the instance OID variable is associated with. If null the formatting cannot take any MIB specification of the variable into account and has to format it based on its type only.
      variable - the variable to format.
      withOID - if true the instanceOID should be included in the textual representation to form a VariableBinding representation.
      Returns:
      the textual representation.
    • parseVariableBinding

      VariableBinding parseVariableBinding(String text) throws ParseException
      Parses a textual representation of a variable binding.
      Parameters:
      text - a textual representation of the variable binding.
      Returns:
      the new VariableBinding instance.
      Throws:
      ParseException - if the variable binding cannot be parsed successfully.
    • parse

      Variable parse(OID classOrInstanceOID, String text) throws ParseException
      Parses a textual representation of a variable against its associated OBJECT-TYPE OID.
      Parameters:
      classOrInstanceOID - the instance OID variable is associated with. Must not be null.
      text - a textual representation of the variable.
      Returns:
      the new Variable instance.
      Throws:
      ParseException - if the variable cannot be parsed successfully.
    • parse

      Variable parse(int smiSyntax, String text) throws ParseException
      Parses a textual representation of a variable against a SMI type.
      Parameters:
      smiSyntax - the SMI syntax identifier identifying the target Variable.
      text - a textual representation of the variable.
      Returns:
      the new Variable instance.
      Throws:
      ParseException - if the variable cannot be parsed successfully.