Package com.snmp4j.smi
Class SmiSyntaxImpl
java.lang.Object
com.snmp4j.smi.SmiSyntaxImpl
- All Implemented Interfaces:
SmiSyntax,Serializable
The
SmiSyntaxImpl class represents the attributes of a SMI SYNTAX clause.- Since:
- 1.3.2 (Pro Version only)
- Author:
- Frank Fock
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionSmiSyntaxImpl(String syntaxClause, SmiSyntaxType smiSyntaxType, int smiSyntax, List<SmiSyntaxElement> smiSyntaxElements) Creates a SYNTAX implementation from clause and sub-elements.SmiSyntaxImpl(String syntaxClause, SmiSyntaxType syntaxType, int smiSyntax, List<SmiSyntaxElement> elementList, SmiSyntax resolvedSyntax, String resolvedDisplayHint) Creates a SYNTAX implementation from clause and sub-elements. -
Method Summary
Modifier and TypeMethodDescriptionGets the syntax elements, i.e.Returns the DISPLAY-HINT clause of the TEXTUAL-CONVENTION referenced by this syntax of typeSmiSyntaxType.CONVENTION.Returns the resolved syntax.intReturns the BER syntax identifier for the simple of application type this syntax is based on.Returns the value of the syntax clause.getType()Returns the type of syntax clause.booleanIndicates whether this SYNTAX clause is an enumeration.toString()
-
Constructor Details
-
SmiSyntaxImpl
public SmiSyntaxImpl(String syntaxClause, SmiSyntaxType smiSyntaxType, int smiSyntax, List<SmiSyntaxElement> smiSyntaxElements) Creates a SYNTAX implementation from clause and sub-elements.- Parameters:
syntaxClause- the syntax clausesmiSyntaxType- the type.smiSyntax- the syntax code (ID).smiSyntaxElements- a list ofSmiSyntaxElements (the ranges or enumerations).
-
SmiSyntaxImpl
public SmiSyntaxImpl(String syntaxClause, SmiSyntaxType syntaxType, int smiSyntax, List<SmiSyntaxElement> elementList, SmiSyntax resolvedSyntax, String resolvedDisplayHint) Creates a SYNTAX implementation from clause and sub-elements.- Parameters:
syntaxClause- the syntax clausesyntaxType- the type.smiSyntax- the syntax code (ID).elementList- a list ofSmiSyntaxElements (the ranges or enumerations).resolvedSyntax- the resolved syntax by using resolved definitions if syntaxClause contains a reference to another syntax.resolvedDisplayHint- the resolved display-hint by using resolved definitions if syntaxClause contains a reference to another syntax.
-
-
Method Details
-
getSyntaxClause
Description copied from interface:SmiSyntaxReturns the value of the syntax clause. This can be a simple (INTEGER, OCTET STRING, etc.) or application type (Integer32, ..) as well as a reference to a textual convention or SMIv1 syntax definition. For tables, a sequence definition is returned. SeeSmiSyntax.getType()for details.- Specified by:
getSyntaxClausein interfaceSmiSyntax- Returns:
- the value of the SYNTAX clause.
-
getElements
Description copied from interface:SmiSyntaxGets the syntax elements, i.e. range or enumeration elements. The returned list will never contain a mixture of both elements.- Specified by:
getElementsin interfaceSmiSyntax- Returns:
- the list of syntax elements or
nullif the syntax has no elements.
-
isEnumeration
public boolean isEnumeration()Description copied from interface:SmiSyntaxIndicates whether this SYNTAX clause is an enumeration.- Specified by:
isEnumerationin interfaceSmiSyntax- Returns:
- Return
trueonly if all elements returned bySmiSyntax.getElements()are of typeSmiSyntaxElement.Type.Enumeration.
-
getType
Description copied from interface:SmiSyntaxReturns the type of syntax clause. -
getResolvedSyntax
Description copied from interface:SmiSyntaxReturns the resolved syntax. The resolved syntax is of typeSmiSyntaxType.APPLICATIONorSmiSyntaxType.SIMPLE. Thus, a syntax of typeSmiSyntaxType.CONVENTIONwill return the SmiSyntax as defined by the referenced textual convention. Note: TEXTUAL CONVENTION and SMIv1 syntax assignments must not be nested in SMIv2. For SMIv1, the effective (artificial) syntax is returned for nested conventions.- Specified by:
getResolvedSyntaxin interfaceSmiSyntax- Returns:
- the resolved syntax for a convention syntax or
thisotherwise. Ifnullis returned, the referenced convention could not be resolved with the currently loaded MIB modules.
-
getResolvedDisplayHint
Description copied from interface:SmiSyntaxReturns the DISPLAY-HINT clause of the TEXTUAL-CONVENTION referenced by this syntax of typeSmiSyntaxType.CONVENTION.- Specified by:
getResolvedDisplayHintin interfaceSmiSyntax- Returns:
- the display hint string or
nullifSmiSyntax.getType()is notSmiSyntaxType.CONVENTIONor the resolved textual convention has no display hint.
-
getSyntax
public int getSyntax()Description copied from interface:SmiSyntaxReturns the BER syntax identifier for the simple of application type this syntax is based on. -
toString
-