Class JrpcgenXdrDefinition

java.lang.Object
org.acplt.oncrpc.apps.jrpcgen.JrpcgenDocumentable
org.acplt.oncrpc.apps.jrpcgen.JrpcgenXdrDefinition
All Implemented Interfaces:
JrpcgenItem
Direct Known Subclasses:
JrpcgenComplexType, JrpcgenConst

public class JrpcgenXdrDefinition extends JrpcgenDocumentable implements JrpcgenItem
An XDR definition represents a constant definition or one of the complex type definitions. A complex type is one of enum, struct, union or typedef. An XDR definition consists of the definition type and an identifier. The definition types are defined in the enumeration JrpcgenXdrDefinition.Type of this class.

XDR definitions are documentable and therefore extend the class JrpcgenDocumentable. As they provide an identifier, they implement the interface JrpcgenItem and therefore can be used in item tables based on JrpcgenItemTable.

Although this class is not abstract, it is not intended to be used directly. It will be used as a base class for concrete realisations of constant definitions and complex type definitions, enabling the identification of their nature at this generalized level.

Author:
Harald Wirths <hwirths@nde.ag>
  • Constructor Details

    • JrpcgenXdrDefinition

      public JrpcgenXdrDefinition(String identifier, JrpcgenXdrDefinition.Type type)
      Creates a new XDR definition instance.
      Parameters:
      identifier - The identifier of the new XDR definition.
      type - The definition type of the new XDR definition.
  • Method Details

    • getIdentifier

      public final String getIdentifier()
      Returns the identifier of this XDR definition.
      Specified by:
      getIdentifier in interface JrpcgenItem
      Returns:
      The identifier of this XDR definition.
    • getXdrType

      public final JrpcgenXdrDefinition.Type getXdrType()
      Returns the XDR aka definition type of this XDR definition.
      Returns:
      The XDR (definition) type of this XDR definition.
      See Also:
    • isConst

      public final boolean isConst()
      Returns whether this XDR definition belongs to a constant definition.
      Returns:
      true in case this XDR definition belongs to a constant definition, false otherwise.
    • isEnum

      public final boolean isEnum()
      Returns whether this XDR definition belongs to an enumeration definition.
      Returns:
      true in case this XDR definition belongs to an enumeration definition, false otherwise.
    • isStruct

      public final boolean isStruct()
      Returns whether this XDR definition belongs to a stucture definition.
      Returns:
      true in case this XDR definition belongs to a structure definition, false otherwise.
    • isUnion

      public final boolean isUnion()
      Returns whether this XDR definition belongs to a union definition.
      Returns:
      true in case this XDR definition belongs to a union definition, false otherwise.
    • isTypedef

      public final boolean isTypedef()
      Returns whether this XDR definition belongs to a type definition.
      Returns:
      true in case this XDR definition belongs to a type definition, false otherwise.