Class VmClass


  • public final class VmClass
    extends VmValue
    • 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

      • initSupertype

        public void initSupertype​(TypeNode supertypeNode,
                                  VmClass superclass)
      • 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, or null if 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.
      • 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, or null if no such property was found. Does not return local properties.
      • hasProperty

        public boolean hasProperty​(Identifier name)
        Shorthand for getProperty(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.
      • getDeclaredMethods

        public java.lang.Iterable<ClassMethod> getDeclaredMethods()
        Includes local methods.
      • getMethods

        public java.lang.Iterable<ClassMethod> getMethods()
        Does not include local methods.
      • 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: VmValue
        Forces recursive (deep) evaluation of this value.
        Specified by:
        force in class VmValue
      • 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 <T> T accept​(VmValueConverter<T> converter,
                            java.lang.Iterable<java.lang.Object> path)
        Specified by:
        accept in class VmValue
      • toString

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

        public boolean equals​(@Nullable java.lang.Object obj)
        Description copied from class: VmValue
        Enables calling `vmValue.equals()` when not behind a Truffle boundary.
        Specified by:
        equals in class VmValue
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object