Class SymbolReference<S extends ResolvedDeclaration>


  • public class SymbolReference<S extends ResolvedDeclaration>
    extends java.lang.Object
    A reference to a symbol. It can solved or not solved. If solved the corresponding declaration will be provided.
    • Constructor Detail

      • SymbolReference

        private SymbolReference​(@Nullable
                                S correspondingDeclaration)
    • Method Detail

      • solved

        public static <S extends ResolvedDeclaration,​S2 extends S> SymbolReference<S> solved​(S2 symbolDeclaration)
        Create a solve reference to the given symbol.
      • unsolved

        public static <S extends ResolvedDeclarationSymbolReference<S> unsolved()
        Create a reference for an unsolved symbol.
        Type Parameters:
        S - The symbol reference type.
        Returns:
        The created unsolved symbol reference.
      • unsolved

        @Deprecated
        public static <S extends ResolvedDeclaration,​S2 extends S> SymbolReference<S> unsolved​(java.lang.Class<S2> clazz)
        Deprecated.
        Consider using unsolved() instead.
        Create an unsolved reference specifying the type of the value expected.
      • getDeclaration

        public java.util.Optional<S> getDeclaration()
        Get the declaration associated with the Symbol.
        Returns:
        an Optional with a present value if the symbol is solved, otherwise an empty Optional.
      • getCorrespondingDeclaration

        public S getCorrespondingDeclaration()
        The corresponding declaration. If not solve this throws UnsupportedOperationException.
      • isSolved

        public boolean isSolved()
        Is the reference solved?
      • toString

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