# Class SmiSyntaxImpl

java.lang.Object
com.snmp4j.smi.SmiSyntaxImpl

All Implemented Interfaces:
  `SmiSyntax, Serializable`

public class SmiSyntaxImpl extends Object implements 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

  Constructors
  Constructor
  Description
  `SmiSyntaxImpl(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 Type
  Method
  Description
  `List<SmiSyntaxElement>`
  `getElements()`
  Gets the syntax elements, i.e. range or enumeration elements.
  `String`
  `getResolvedDisplayHint()`
  Returns the DISPLAY-HINT clause of the TEXTUAL-CONVENTION referenced by this syntax of type `SmiSyntaxType.CONVENTION`.
  `SmiSyntax`
  `getResolvedSyntax()`
  Returns the resolved syntax.
  `int`
  `getSyntax()`
  Returns the BER syntax identifier for the simple of application type this syntax is based on.
  `String`
  `getSyntaxClause()`
  Returns the value of the syntax clause.
  `SmiSyntaxType`
  `getType()`
  Returns the type of syntax clause.
  `boolean`
  `isEnumeration()`
  Indicates whether this SYNTAX clause is an enumeration.
  `String`
  `toString()`

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## 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 clause
      `smiSyntaxType` - the type.
      `smiSyntax` - the syntax code (ID).
      `smiSyntaxElements` - a list of `SmiSyntaxElement`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 clause
      `syntaxType` - the type.
      `smiSyntax` - the syntax code (ID).
      `elementList` - a list of `SmiSyntaxElement`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

    public String 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. See `SmiSyntax.getType()` for details.
    Specified by:
      `getSyntaxClause` in interface `SmiSyntax`
    Returns:
      the value of the SYNTAX clause.

  - ### getElements

    public List<SmiSyntaxElement> 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 interface `SmiSyntax`
    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 interface `SmiSyntax`
    Returns:
      Return `true` only if all elements returned by `SmiSyntax.getElements()` are of type `SmiSyntaxElement.Type.Enumeration`.

  - ### getType

    public SmiSyntaxType getType()
    Description copied from interface: `SmiSyntax`
    Returns the type of syntax clause.
    Specified by:
      `getType` in interface `SmiSyntax`
    Returns:
      the type identifier of the SYNTAX clause.

  - ### getResolvedSyntax

    public SmiSyntax getResolvedSyntax()
    Description copied from interface: `SmiSyntax`
    Returns the resolved syntax. The resolved syntax is of type `SmiSyntaxType.APPLICATION` or `SmiSyntaxType.SIMPLE`. Thus, a syntax of type `SmiSyntaxType.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 interface `SmiSyntax`
    Returns:
      the resolved syntax for a convention syntax or `this` otherwise. If `null` is returned, the referenced convention could not be resolved with the currently loaded MIB modules.

  - ### getResolvedDisplayHint

    public String getResolvedDisplayHint()
    Description copied from interface: `SmiSyntax`
    Returns the DISPLAY-HINT clause of the TEXTUAL-CONVENTION referenced by this syntax of type `SmiSyntaxType.CONVENTION`.
    Specified by:
      `getResolvedDisplayHint` in interface `SmiSyntax`
    Returns:
      the display hint string or `null` if `SmiSyntax.getType()` is not `SmiSyntaxType.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.
    Specified by:
      `getSyntax` in interface `SmiSyntax`
    Returns:
      a syntax identifier defined by `BER`.

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`