java.lang.Object
java.lang.Enum<ImportKind>
com.darkcollective.relix.lang.ast.ImportKind
All Implemented Interfaces:
Serializable, Comparable<ImportKind>, Constable

public enum ImportKind extends Enum<ImportKind>
Classifies the kind of symbol being imported in an ImportStatement.

The kind is declared explicitly in the import syntax:

   import source  current_weather from './weather.relix';   // SOURCE
   import relation USCities       from './cities.relix';    // RELATION
   import function tax            from './calc.relix';      // FUNCTION
   import { Users, Orders }       from './db.relix';        // UNQUALIFIED
   import './common.relix';                                  // BULK
 

UNQUALIFIED is used when names are imported with braces but without an explicit type keyword. BULK is used when the entire file is imported with no name list.

  • Enum Constant Details

    • SOURCE

      public static final ImportKind SOURCE
      The imported name is expected to resolve to a source declaration.
    • RELATION

      public static final ImportKind RELATION
      The imported name is expected to resolve to a relation (view or inline table).
    • FUNCTION

      public static final ImportKind FUNCTION
      The imported name is expected to resolve to a function definition.
    • UNQUALIFIED

      public static final ImportKind UNQUALIFIED
      Names are imported without a type qualifier (import { X, Y } from '...'). The semantic layer resolves what kind each name refers to.
    • BULK

      public static final ImportKind BULK
      All exported names from the target file are imported into the current namespace (import './file.relix').
  • Method Details

    • values

      public static ImportKind[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static ImportKind valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null