Package org.pkl.core
Class PClass
- java.lang.Object
-
- org.pkl.core.Member
-
- org.pkl.core.PClass
-
- All Implemented Interfaces:
java.io.Serializable,Value
public final class PClass extends Member implements Value
Java representation of apkl.base#Classvalue.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPClass.ClassMemberstatic classPClass.Methodstatic classPClass.Property-
Nested classes/interfaces inherited from class org.pkl.core.Member
Member.SourceLocation
-
-
Constructor Summary
Constructors Constructor Description PClass(@Nullable java.lang.String docComment, Member.SourceLocation sourceLocation, java.util.Set<Modifier> modifiers, java.util.List<PObject> annotations, PClassInfo<?> classInfo, java.util.List<TypeParameter> typeParameters, java.util.Map<java.lang.String,PClass.Property> properties, java.util.Map<java.lang.String,PClass.Method> methods)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> Taccept(ValueConverter<T> converter)Invokes the given converters's convert method for thisValue.voidaccept(ValueVisitor visitor)Invokes the given visitor's visit method for thisValue.java.util.Map<java.lang.String,PClass.Method>getAllMethods()java.util.Map<java.lang.String,PClass.Property>getAllProperties()PClassInfo<?>getClassInfo()Returns information about the Pkl class associated with thisValue.java.lang.StringgetDisplayName()PClassInfo<?>getInfo()java.util.Map<java.lang.String,PClass.Method>getMethods()java.lang.StringgetModuleName()Returns the name of the module that this class is declared in.java.util.Map<java.lang.String,PClass.Property>getProperties()java.lang.StringgetQualifiedName()Returns the qualified name of this class, `moduleName#className`.@Nullable PClassgetSuperclass()@Nullable PTypegetSupertype()java.util.List<TypeParameter>getTypeParameters()voidinitSupertype(PType supertype, PClass superclass)booleanisModuleClass()Tells if this class is the class of a module.java.lang.StringtoString()-
Methods inherited from class org.pkl.core.Member
getAnnotations, getDocComment, getModifiers, getSimpleName, getSourceLocation, isAbstract, isExternal, isHidden, isOpen, isStandardLibraryMember
-
-
-
-
Constructor Detail
-
PClass
public PClass(@Nullable java.lang.String docComment, Member.SourceLocation sourceLocation, java.util.Set<Modifier> modifiers, java.util.List<PObject> annotations, PClassInfo<?> classInfo, java.util.List<TypeParameter> typeParameters, java.util.Map<java.lang.String,PClass.Property> properties, java.util.Map<java.lang.String,PClass.Method> methods)
-
-
Method Detail
-
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:
getModuleNamein classMember
-
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()
-
getInfo
public PClassInfo<?> getInfo()
-
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:ValueInvokes the given visitor's visit method for thisValue.
-
accept
public <T> T accept(ValueConverter<T> converter)
Description copied from interface:ValueInvokes the given converters's convert method for thisValue.
-
getClassInfo
public PClassInfo<?> getClassInfo()
Description copied from interface:ValueReturns information about the Pkl class associated with thisValue.- Specified by:
getClassInfoin interfaceValue
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-