com.adventnet.snmp.mibs
Class MibTC

com.adventnet.snmp.mibs.LeafSyntax
  |
  +--com.adventnet.snmp.mibs.MibTC
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

public class MibTC
extends LeafSyntax
implements java.io.Serializable, java.lang.Cloneable

This class represents a MIB TEXTUAL-CONVENTION macro in a module. As it is a subclass of LeafSyntax, we can create new SNMP variables with the given syntax. We can also check syntax rules on variables, and get more information on the syntax. The TEXTUAL-CONVENTION macro is defined in SMIv2. The MibTC object can be obtained as follows: MibOperations mibOps = new MibOperations(); mibOps.loadMibModule("mibFile"); MibTC tc = mibOps.getSyntaxByName("tcName"); or MibModulel module = mibOps.getMibModule("moduleName"); Enumeration en = module.getDefinedTCs(); or MibNode node = mibOps.getMibNode("nodeLabel"); MibTC tc = node.getSyntax(); The TEXTUAL-CONVENTION macro contains following fields: DISPLAY-HINT getDisplayHint STATUS getStatus DESCRIPTION getDescription REFERENCE getReference The TEXTUAL-CONVENTION defined in SMIv1 construct as the Type Assignment. For example, In case of SMIv2, the PhysAddress TC is defined as PhysAddress ::= TEXTUAL-CONVENTION DISPLAY-HINT "1x:" STATUS current DESCRIPTION "Represents media- or physical-level addresses." SYNTAX OCTET STRING The same TC is defined in SMIv1 as Type Assignment like, PhysAddress ::= OCTET STRING In case of, SMIv1 TC construct, the DISPLAY-HINT, STATUS, DESCRIPTION and the REFERENCE clause value are empty string.

See Also:
Serialized Form

Method Summary
 java.lang.Object clone()
          Creates and returns a copy of this object.
 java.lang.String getDisplayHint()
          Gets the DISPLAY-HINT field in this TC.
 java.lang.String getName()
          Returns the name of this TEXTUAL-CONVENTION.
 java.lang.String getReference()
          Gets the REFERENCE string for this TC.
 java.lang.String getStatus()
          Gets the STATUS field value for this TC.
 LeafSyntax getSyntax()
          Gets the syntax associated with this TC.
 java.lang.String getTCDescription()
          Gets the DESCRIPTION string for this TC.
 java.lang.String toString()
          Returns the name of this TEXTUAL-CONVENTION.
 
Methods inherited from class com.adventnet.snmp.mibs.LeafSyntax
checkValue, checkValue, createVariable, createVariable, decodeInstanceString, encodeInstanceString, getDescription, getEnumint, getEnumlabels, getEquivname, getInt, getLabel, getMax, getMin, getRangeItems, getSize, getType, isConstrained, isEnumerated, isRanged, toTagString
 

Method Detail

getSyntax

public LeafSyntax getSyntax()
Gets the syntax associated with this TC.
Overrides:
getSyntax in class LeafSyntax
Returns:
LeafSyntax object, if the syntax is basic.
MibTC object, if the syntax is TC.

getDisplayHint

public java.lang.String getDisplayHint()
Gets the DISPLAY-HINT field in this TC. The DISPLAY-HINT is the optional field of the TEXTUAL-CONVENTION. This DISPLAY-HINT gives a hint as to how the value of an instance of an object with the syntax defined using this textual convention might be displayed.
Returns:
the value in the DISPLAY-HINT field, if present.
else return empty string.
See Also:
MibOperations.enableDisplayHint(boolean)

toString

public java.lang.String toString()
Returns the name of this TEXTUAL-CONVENTION.
Overrides:
toString in class LeafSyntax
Returns:
String name of this TEXTUAL-CONVENTION
See Also:
getName()

getName

public java.lang.String getName()
Returns the name of this TEXTUAL-CONVENTION.
Overrides:
getName in class LeafSyntax
Returns:
String name of this TEXTUAL-CONVENTION
See Also:
toString()

getStatus

public java.lang.String getStatus()
Gets the STATUS field value for this TC. In case of SMIv1 Type Assignment, the STATUS field is not present, then this method will return empty string.
Returns:
the value of the STATUS field otherwise empty string in case SMIv1 Type Assignment construct.

getTCDescription

public java.lang.String getTCDescription()
Gets the DESCRIPTION string for this TC.
Returns:
the DESCRIPTION value.
empty string, if not present.

getReference

public java.lang.String getReference()
Gets the REFERENCE string for this TC.
Returns:
the REFERENCE value, if present.
empty string, if not found.

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Creates and returns a copy of this object.
Overrides:
clone in class LeafSyntax
Throws:
java.lang.CloneNotSupportedException - is thrown if the object's class does not support the interface which could be cloned.


Copyright (c)AdventNet Inc., 1996-2004