java.lang.Object
com.github.javaparser.symbolsolver.model.resolution.SymbolReference<S>

public class SymbolReference<S extends ResolvedDeclaration> extends Object
A reference to a symbol. It can solved or not solved. If solved the corresponding declaration will be provided.
Author:
Federico Tomassetti
  • Method Details

    • 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 ResolvedDeclaration,​ S2 extends S> SymbolReference<S> unsolved(Class<S2> clazz)
      Create an unsolved reference specifying the type of the value expected.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getCorrespondingDeclaration

      public S getCorrespondingDeclaration()
      The corresponding declaration. If not solve this throws UnsupportedOperationException. // TODO: Convert this to returning Optional.
    • isSolved

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

      public static <O extends ResolvedDeclaration> SymbolReference<O> adapt(SymbolReference<? extends O> ref, Class<O> clazz)