Package org.pkl.core

Class ModuleSchema

java.lang.Object
org.pkl.core.ModuleSchema

public final class ModuleSchema extends Object
Describes the property, method and class members of a module.
  • Constructor Details

  • Method Details

    • getModuleUri

      public URI getModuleUri()
      Returns the absolute URI from which this module was first loaded.
    • getModuleName

      public String getModuleName()
      Returns the name of this module.

      Note that module names are not guaranteed to be unique, especially if they are not declared but inferred from the module URI.

    • getShortModuleName

      public String getShortModuleName()
      Returns the last name part of a dot-separated getModuleName(), or the entire getModuleName() if it is not dot-separated.
    • getSupermodule

      @Nullable public @Nullable ModuleSchema getSupermodule()
      Returns this module's supermodule, or null if this module does not amend or extend another module.
    • isAmend

      public boolean isAmend()
      Tells if this module amends a module (namely getSupermodule()).
    • isExtend

      public boolean isExtend()
      Tells if this module extends a module (namely getSupermodule()).
    • getDocComment

      @Nullable public @Nullable String getDocComment()
      Returns the doc comment of this module (if any).
    • getAnnotations

      public List<PObject> getAnnotations()
      Returns the annotations of this module.
    • getModuleClass

      public PClass getModuleClass()
      Returns the class of this module, which describes the properties and methods defined in this module.
    • getImports

      public Map<String,URI> getImports()
      Returns the imports declared in this module.

      Map keys are the identifiers by which imports are accessed within this module. Map values are the URIs of the imported modules.

      Does not cover import expressions.

    • getClasses

      public Map<String,PClass> getClasses()
      Returns the classes defined in this module in declaration order.
    • getAllClasses

      public Map<String,PClass> getAllClasses()
      Returns all classes defined in this module and its supermodules in declaration order. Supermodule classes are ordered before submodule classes.
    • getTypeAliases

      public Map<String,TypeAlias> getTypeAliases()
      Returns the type aliases defined in this module in declaration order.
    • getAllTypeAliases

      public Map<String,TypeAlias> getAllTypeAliases()
      Returns all type aliases defined in this module and its supermodules in declaration order. Supermodule type aliases are ordered before submodule type aliases.