Package org.pkl.core

Class PClass

  • All Implemented Interfaces:
    java.io.Serializable, Value

    public final class PClass
    extends Member
    implements Value
    Java representation of a pkl.base#Class value.
    See Also:
    Serialized Form
    • Method Detail

      • initSupertype

        public void initSupertype​(PType supertype,
                                  PClass superclass)
      • getModuleName

        public java.lang.String getModuleName()
        Returns the name of the module that this class is declared in. Note that a module name is not guaranteed to be unique, especially if it not declared but inferred from the module URI.
        Specified by:
        getModuleName in class Member
      • getQualifiedName

        public java.lang.String getQualifiedName()
        Returns the qualified name of this class, `moduleName#className`. Note that a qualified class name is not guaranteed to be unique, especially if the module name is not declared but inferred from the module URI.
      • getDisplayName

        public java.lang.String getDisplayName()
      • isModuleClass

        public boolean isModuleClass()
        Tells if this class is the class of a module.
      • getTypeParameters

        public java.util.List<TypeParameter> getTypeParameters()
      • getProperties

        public java.util.Map<java.lang.String,​PClass.Property> getProperties()
      • getMethods

        public java.util.Map<java.lang.String,​PClass.Method> getMethods()
      • getAllProperties

        public java.util.Map<java.lang.String,​PClass.Property> getAllProperties()
      • getAllMethods

        public java.util.Map<java.lang.String,​PClass.Method> getAllMethods()
      • accept

        public void accept​(ValueVisitor visitor)
        Description copied from interface: Value
        Invokes the given visitor's visit method for this Value.
        Specified by:
        accept in interface Value
      • accept

        public <T> T accept​(ValueConverter<T> converter)
        Description copied from interface: Value
        Invokes the given converters's convert method for this Value.
        Specified by:
        accept in interface Value
      • getClassInfo

        public PClassInfo<?> getClassInfo()
        Description copied from interface: Value
        Returns information about the Pkl class associated with this Value.
        Specified by:
        getClassInfo in interface Value
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object