Package org.pkl.core
Class ModuleSchema
- java.lang.Object
-
- org.pkl.core.ModuleSchema
-
public final class ModuleSchema extends java.lang.ObjectDescribes the property, method and class members of a module.
-
-
Constructor Summary
Constructors Constructor Description ModuleSchema(java.net.URI moduleUri, java.lang.String moduleName, boolean isAmend, @Nullable ModuleSchema supermodule, PClass moduleClass, @Nullable java.lang.String docComment, java.util.List<PObject> annotations, java.util.Map<java.lang.String,PClass> classes, java.util.Map<java.lang.String,TypeAlias> typeAliases, java.util.Map<java.lang.String,java.net.URI> imports)Constructs aModuleSchemainstance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Map<java.lang.String,PClass>getAllClasses()Returns all classes defined in this module and its supermodules in declaration order.java.util.Map<java.lang.String,TypeAlias>getAllTypeAliases()Returns all type aliases defined in this module and its supermodules in declaration order.java.util.List<PObject>getAnnotations()Returns the annotations of this module.java.util.Map<java.lang.String,PClass>getClasses()Returns the classes defined in this module in declaration order.@Nullable java.lang.StringgetDocComment()Returns the doc comment of this module (if any).java.util.Map<java.lang.String,java.net.URI>getImports()Returns the imports declared in this module.PClassgetModuleClass()Returns the class of this module, which describes the properties and methods defined in this module.java.lang.StringgetModuleName()Returns the name of this module.java.net.URIgetModuleUri()Returns the absolute URI from which this module was first loaded.java.lang.StringgetShortModuleName()Returns the last name part of a dot-separatedgetModuleName(), or the entiregetModuleName()if it is not dot-separated.@Nullable ModuleSchemagetSupermodule()Returns this module's supermodule, ornullif this module does not amend or extend another module.java.util.Map<java.lang.String,TypeAlias>getTypeAliases()Returns the type aliases defined in this module in declaration order.booleanisAmend()Tells if this module amends a module (namelygetSupermodule()).booleanisExtend()Tells if this module extends a module (namelygetSupermodule()).
-
-
-
Constructor Detail
-
ModuleSchema
public ModuleSchema(java.net.URI moduleUri, java.lang.String moduleName, boolean isAmend, @Nullable ModuleSchema supermodule, PClass moduleClass, @Nullable java.lang.String docComment, java.util.List<PObject> annotations, java.util.Map<java.lang.String,PClass> classes, java.util.Map<java.lang.String,TypeAlias> typeAliases, java.util.Map<java.lang.String,java.net.URI> imports)Constructs aModuleSchemainstance.
-
-
Method Detail
-
getModuleUri
public java.net.URI getModuleUri()
Returns the absolute URI from which this module was first loaded.
-
getModuleName
public java.lang.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 java.lang.String getShortModuleName()
Returns the last name part of a dot-separatedgetModuleName(), or the entiregetModuleName()if it is not dot-separated.
-
getSupermodule
public @Nullable ModuleSchema getSupermodule()
Returns this module's supermodule, ornullif this module does not amend or extend another module.
-
isAmend
public boolean isAmend()
Tells if this module amends a module (namelygetSupermodule()).
-
isExtend
public boolean isExtend()
Tells if this module extends a module (namelygetSupermodule()).
-
getDocComment
public @Nullable java.lang.String getDocComment()
Returns the doc comment of this module (if any).
-
getAnnotations
public java.util.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 java.util.Map<java.lang.String,java.net.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 java.util.Map<java.lang.String,PClass> getClasses()
Returns the classes defined in this module in declaration order.
-
getAllClasses
public java.util.Map<java.lang.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 java.util.Map<java.lang.String,TypeAlias> getTypeAliases()
Returns the type aliases defined in this module in declaration order.
-
getAllTypeAliases
public java.util.Map<java.lang.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.
-
-