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:
- Serialized Form
-
Constructor Summary
ConstructorDescriptionSmiSyntaxImpl(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.int
Returns 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.boolean
Indicates 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 ofSmiSyntaxElement
s (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 ofSmiSyntaxElement
s (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:SmiSyntax
Returns 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:
getSyntaxClause
in interfaceSmiSyntax
- Returns:
- the value of the SYNTAX clause.
-
getElements
Description copied from interface:SmiSyntax
Gets the syntax elements, i.e. range or enumeration elements. The returned list will never contain a mixture of both elements.- Specified by:
getElements
in interfaceSmiSyntax
- Returns:
- the list of syntax elements or
null
if the syntax has no elements.
-
isEnumeration
public boolean isEnumeration()Description copied from interface:SmiSyntax
Indicates whether this SYNTAX clause is an enumeration.- Specified by:
isEnumeration
in interfaceSmiSyntax
- Returns:
- Return
true
only if all elements returned bySmiSyntax.getElements()
are of typeSmiSyntaxElement.Type.Enumeration
.
-
getType
Description copied from interface:SmiSyntax
Returns the type of syntax clause. -
getResolvedSyntax
Description copied from interface:SmiSyntax
Returns the resolved syntax. The resolved syntax is of typeSmiSyntaxType.APPLICATION
orSmiSyntaxType.SIMPLE
. Thus, a syntax of typeSmiSyntaxType.CONVENTION
will 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:
getResolvedSyntax
in interfaceSmiSyntax
- Returns:
- the resolved syntax for a convention syntax or
this
otherwise. Ifnull
is returned, the referenced convention could not be resolved with the currently loaded MIB modules.
-
getResolvedDisplayHint
Description copied from interface:SmiSyntax
Returns the DISPLAY-HINT clause of the TEXTUAL-CONVENTION referenced by this syntax of typeSmiSyntaxType.CONVENTION
.- Specified by:
getResolvedDisplayHint
in interfaceSmiSyntax
- Returns:
- the display hint string or
null
ifSmiSyntax.getType()
is notSmiSyntaxType.CONVENTION
or the resolved textual convention has no display hint.
-
getSyntax
public int getSyntax()Description copied from interface:SmiSyntax
Returns the BER syntax identifier for the simple of application type this syntax is based on. -
toString
-