Package org.pkl.core.runtime
Class VmClass
- java.lang.Object
-
- org.pkl.core.runtime.VmValue
-
- org.pkl.core.runtime.VmClass
-
public final class VmClass extends VmValue
-
-
Constructor Summary
Constructors Constructor Description VmClass(com.oracle.truffle.api.source.SourceSection sourceSection, com.oracle.truffle.api.source.SourceSection headerSection, @Nullable com.oracle.truffle.api.source.SourceSection docComment, java.util.List<VmTyped> annotations, int modifiers, PClassInfo<?> classInfo, java.util.List<TypeParameter> typeParameters, VmTyped prototype)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> Taccept(VmValueConverter<T> converter, java.lang.Iterable<java.lang.Object> path)voidaccept(VmValueVisitor visitor)voidaddMethod(ClassMethod method)voidaddMethods(java.lang.Iterable<ClassMethod> methods)voidaddProperties(java.lang.Iterable<ClassProperty> properties)voidaddProperty(ClassProperty property)booleanequals(@Nullable java.lang.Object obj)Enables calling `vmValue.equals()` when not behind a Truffle boundary.PClassexport()voidforce(boolean allowUndefinedValues)Forces recursive (deep) evaluation of this value.org.graalvm.collections.UnmodifiableEconomicSet<java.lang.Object>getAllHiddenPropertyNames()Returns the names of all hidden properties defined in this class and its superclasses.org.graalvm.collections.UnmodifiableEconomicSet<java.lang.Object>getAllRegularPropertyNames()Returns the names of all non-hidden non-local non-external properties defined in this class and its superclasses.java.util.List<VmTyped>getAnnotations()@Nullable ClassMethodgetDeclaredMethod(Identifier name)Does return local methods.java.lang.Iterable<ClassMethod>getDeclaredMethods()Includes local methods.java.lang.Iterable<ClassProperty>getDeclaredProperties()Returns all properties declared in this class.@Nullable ClassPropertygetDeclaredProperty(Identifier name)Returns the property with the given name declared in this class, ornullif no such property was found.java.lang.StringgetDisplayName()@Nullable com.oracle.truffle.api.source.SourceSectiongetDocComment()org.graalvm.collections.EconomicMap<java.lang.Object,ObjectMember>getDynamicToTypedMembers()com.oracle.truffle.api.source.SourceSectiongetHeaderSection()org.graalvm.collections.EconomicMap<java.lang.Object,ObjectMember>getMapToTypedMembers()@Nullable ClassMethodgetMethod(Identifier name)Does not return local methods.VmMapgetMethodMirrors()java.lang.Iterable<ClassMethod>getMethods()Does not include local methods.VmTypedgetMirror()VmSetgetModifierMirrors()VmTypedgetModule()Returns the module that this class is declared in.VmTypedgetModuleMirror()java.lang.StringgetModuleName()PClassInfo<?>getPClassInfo()@Nullable ClassPropertygetProperty(Identifier name)Returns the property with the given name declared in this class or a superclass, ornullif no such property was found.VmMapgetPropertyMirrors()VmTypedgetPrototype()java.lang.StringgetQualifiedName()Returns the qualified name of this class, `# `. java.lang.StringgetSimpleName()com.oracle.truffle.api.source.SourceSectiongetSourceSection()@Nullable VmClassgetSuperclass()VmValuegetSuperclassMirror()VmValuegetSupertypeMirror()org.graalvm.collections.EconomicMap<java.lang.Object,ObjectMember>getTypedToDynamicMembers()intgetTypeParameterCount()VmListgetTypeParameterMirrors()VmClassgetVmClass()booleanhasDeclaredMethod(Identifier name)Includes local methods.inthashCode()booleanhasProperty(Identifier name)Shorthand forgetProperty(name) != null.voidinitSupertype(TypeNode supertypeNode, VmClass superclass)booleanisAbstract()booleanisClassClass()booleanisClosed()booleanisCollectionClass()booleanisDynamicClass()booleanisExternal()booleanisFunctionClass()booleanisFunctionNClass()booleanisHiddenProperty(java.lang.Object key)booleanisInstantiable()booleanisListClass()booleanisListingClass()booleanisMapClass()booleanisMappingClass()booleanisModuleClass()booleanisNullClass()booleanisOpen()booleanisPairClass()booleanisSetClass()booleanisSubclassOf(VmClass other)booleanisSuperclassOf(VmClass other)booleanisVarArgsClass()voidnotifyInitialized()java.lang.StringtoString()voidvisitMethodDefsTopDown(java.util.function.Consumer<ClassMethod> visitor)-
Methods inherited from class org.pkl.core.runtime.VmValue
export, exportNullable, force, isDynamic, isListing, isMapping, isPrototype, isSequence, isTyped
-
-
-
-
Constructor Detail
-
VmClass
public VmClass(com.oracle.truffle.api.source.SourceSection sourceSection, com.oracle.truffle.api.source.SourceSection headerSection, @Nullable com.oracle.truffle.api.source.SourceSection docComment, java.util.List<VmTyped> annotations, int modifiers, PClassInfo<?> classInfo, java.util.List<TypeParameter> typeParameters, VmTyped prototype)
-
-
Method Detail
-
addProperty
public void addProperty(ClassProperty property)
-
addProperties
public void addProperties(java.lang.Iterable<ClassProperty> properties)
-
addMethod
public void addMethod(ClassMethod method)
-
addMethods
public void addMethods(java.lang.Iterable<ClassMethod> methods)
-
notifyInitialized
public void notifyInitialized()
-
getTypeParameterCount
public int getTypeParameterCount()
-
getDeclaredProperty
public @Nullable ClassProperty getDeclaredProperty(Identifier name)
Returns the property with the given name declared in this class, ornullif no such property was found. Does return local properties.
-
getDeclaredProperties
public java.lang.Iterable<ClassProperty> getDeclaredProperties()
Returns all properties declared in this class. Does include local properties.
-
getVmClass
public VmClass getVmClass()
- Specified by:
getVmClassin classVmValue
-
getSourceSection
public com.oracle.truffle.api.source.SourceSection getSourceSection()
-
getHeaderSection
public com.oracle.truffle.api.source.SourceSection getHeaderSection()
-
getDocComment
public @Nullable com.oracle.truffle.api.source.SourceSection getDocComment()
-
getAnnotations
public java.util.List<VmTyped> getAnnotations()
-
getModuleName
public java.lang.String getModuleName()
-
getModule
public VmTyped getModule()
Returns the module that this class is declared in. For a module class, returns the corresponding module.
-
getModuleMirror
public VmTyped getModuleMirror()
-
getSimpleName
public java.lang.String getSimpleName()
-
getQualifiedName
public java.lang.String getQualifiedName()
Returns the qualified name of this class, `# `. Note that a qualified class name isn't guaranteed to be unique, especially if the module name is not declared but inferred.
-
getDisplayName
public java.lang.String getDisplayName()
-
getPClassInfo
public PClassInfo<?> getPClassInfo()
-
isHiddenProperty
public boolean isHiddenProperty(java.lang.Object key)
-
getProperty
public @Nullable ClassProperty getProperty(Identifier name)
Returns the property with the given name declared in this class or a superclass, ornullif no such property was found. Does not return local properties.
-
hasProperty
public boolean hasProperty(Identifier name)
Shorthand forgetProperty(name) != null.
-
getAllRegularPropertyNames
public org.graalvm.collections.UnmodifiableEconomicSet<java.lang.Object> getAllRegularPropertyNames()
Returns the names of all non-hidden non-local non-external properties defined in this class and its superclasses.
-
getAllHiddenPropertyNames
public org.graalvm.collections.UnmodifiableEconomicSet<java.lang.Object> getAllHiddenPropertyNames()
Returns the names of all hidden properties defined in this class and its superclasses.
-
hasDeclaredMethod
public boolean hasDeclaredMethod(Identifier name)
Includes local methods.
-
getDeclaredMethod
public @Nullable ClassMethod getDeclaredMethod(Identifier name)
Does return local methods.
-
getDeclaredMethods
public java.lang.Iterable<ClassMethod> getDeclaredMethods()
Includes local methods.
-
getMethod
public @Nullable ClassMethod getMethod(Identifier name)
Does not return local methods.
-
getMethods
public java.lang.Iterable<ClassMethod> getMethods()
Does not include local methods.
-
getPrototype
public VmTyped getPrototype()
- Overrides:
getPrototypein classVmValue
-
isAbstract
public boolean isAbstract()
-
isExternal
public boolean isExternal()
-
isOpen
public boolean isOpen()
-
isClosed
public boolean isClosed()
-
isInstantiable
public boolean isInstantiable()
-
isNullClass
public boolean isNullClass()
-
isCollectionClass
public boolean isCollectionClass()
-
isListClass
public boolean isListClass()
-
isSetClass
public boolean isSetClass()
-
isMapClass
public boolean isMapClass()
-
isListingClass
public boolean isListingClass()
-
isMappingClass
public boolean isMappingClass()
-
isDynamicClass
public boolean isDynamicClass()
-
isPairClass
public boolean isPairClass()
-
isFunctionClass
public boolean isFunctionClass()
-
isFunctionNClass
public boolean isFunctionNClass()
-
isModuleClass
public boolean isModuleClass()
-
isClassClass
public boolean isClassClass()
-
isVarArgsClass
public boolean isVarArgsClass()
-
isSuperclassOf
public boolean isSuperclassOf(VmClass other)
-
isSubclassOf
public boolean isSubclassOf(VmClass other)
-
visitMethodDefsTopDown
public void visitMethodDefsTopDown(java.util.function.Consumer<ClassMethod> visitor)
-
force
public void force(boolean allowUndefinedValues)
Description copied from class:VmValueForces recursive (deep) evaluation of this value.
-
getMirror
public VmTyped getMirror()
-
getTypedToDynamicMembers
public org.graalvm.collections.EconomicMap<java.lang.Object,ObjectMember> getTypedToDynamicMembers()
-
getDynamicToTypedMembers
public org.graalvm.collections.EconomicMap<java.lang.Object,ObjectMember> getDynamicToTypedMembers()
-
getMapToTypedMembers
public org.graalvm.collections.EconomicMap<java.lang.Object,ObjectMember> getMapToTypedMembers()
-
getModifierMirrors
public VmSet getModifierMirrors()
-
getTypeParameterMirrors
public VmList getTypeParameterMirrors()
-
getSuperclassMirror
public VmValue getSuperclassMirror()
-
getSupertypeMirror
public VmValue getSupertypeMirror()
-
getPropertyMirrors
public VmMap getPropertyMirrors()
-
getMethodMirrors
public VmMap getMethodMirrors()
-
accept
public void accept(VmValueVisitor visitor)
-
accept
public <T> T accept(VmValueConverter<T> converter, java.lang.Iterable<java.lang.Object> path)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
equals
public boolean equals(@Nullable java.lang.Object obj)
Description copied from class:VmValueEnables calling `vmValue.equals()` when not behind a Truffle boundary.
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-