Class SymbolReference<S extends ResolvedDeclaration>
- java.lang.Object
-
- com.github.javaparser.resolution.model.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 Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static <I extends ResolvedDeclaration,O extends ResolvedDeclaration>
SymbolReference<O>adapt(SymbolReference<I> ref, Class<O> clazz)
Adapt aSymbolReference
into anotherSymbolReference
.S
getCorrespondingDeclaration()
The corresponding declaration.Optional<S>
getDeclaration()
Get the declaration associated with the Symbol.boolean
isSolved()
Is the reference solved?static <S extends ResolvedDeclaration,S2 extends S>
SymbolReference<S>solved(S2 symbolDeclaration)
Create a solve reference to the given symbol.String
toString()
static <S extends ResolvedDeclaration>
SymbolReference<S>unsolved()
Create a reference for an unsolved symbol.static <S extends ResolvedDeclaration,S2 extends S>
SymbolReference<S>unsolved(Class<S2> clazz)
Deprecated.Consider usingunsolved()
instead.
-
-
-
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 ResolvedDeclaration> SymbolReference<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(Class<S2> clazz)
Deprecated.Consider usingunsolved()
instead.Create an unsolved reference specifying the type of the value expected.
-
adapt
public static <I extends ResolvedDeclaration,O extends ResolvedDeclaration> SymbolReference<O> adapt(SymbolReference<I> ref, Class<O> clazz)
Adapt aSymbolReference
into anotherSymbolReference
.- Type Parameters:
I
- The Symbol Reference before adapting.O
- The Symbol Reference after adapting.- Parameters:
ref
- The reference to be adapted.clazz
- The final type to be used.- Returns:
- The adapted symbol reference.
-
getCorrespondingDeclaration
public S getCorrespondingDeclaration()
The corresponding declaration. If not solve this throws UnsupportedOperationException.
-
isSolved
public boolean isSolved()
Is the reference solved?
-
-