Interface JRecordComponentSymbol
-
- All Superinterfaces:
AnnotableSymbol,JAccessibleElementSymbol,JElementSymbol
public interface JRecordComponentSymbol extends JAccessibleElementSymbol
Represents a record component. Record components are associated with a private finalJFieldSymboland a public accessor method.- Since:
- 7.3.0
-
-
Field Summary
Fields Modifier and Type Field Description static intRECORD_COMPONENT_MODIFIERSRecord components use these modifiers by convention, although they cannot have explicit modifiers in source, and the associated field and method symbol have different modifiers.-
Fields inherited from interface net.sourceforge.pmd.lang.java.symbols.JAccessibleElementSymbol
PRIMITIVE_PACKAGE
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default <R,P>
RacceptVisitor(SymbolVisitor<R,P> visitor, P param)Dispatch to the appropriate visit method of the visitor and returns its result.@NonNull JClassSymbolgetEnclosingClass()Returns the class that directly encloses this declaration.default intgetModifiers()Returns the modifiers of the element represented by this symbol, as decodable by the standardModifierAPI.default @NonNull StringgetPackageName()Returns the name of the package this element is declared in.JTypeMirrorgetTypeMirror(Substitution substitution)Returns the type of this value, under the given substitution.default @Nullable NtryGetNode()Returns the node that declares this symbol.-
Methods inherited from interface net.sourceforge.pmd.lang.java.symbols.AnnotableSymbol
getDeclaredAnnotation, getDeclaredAnnotations, isAnnotationPresent
-
Methods inherited from interface net.sourceforge.pmd.lang.java.symbols.JAccessibleElementSymbol
isStatic
-
Methods inherited from interface net.sourceforge.pmd.lang.java.symbols.JElementSymbol
equals, getSimpleName, getTypeSystem, isUnresolved, nameEquals
-
-
-
-
Field Detail
-
RECORD_COMPONENT_MODIFIERS
static final int RECORD_COMPONENT_MODIFIERS
Record components use these modifiers by convention, although they cannot have explicit modifiers in source, and the associated field and method symbol have different modifiers.- See Also:
- Constant Field Values
-
-
Method Detail
-
getTypeMirror
JTypeMirror getTypeMirror(Substitution substitution)
Returns the type of this value, under the given substitution.
-
getModifiers
default int getModifiers()
Description copied from interface:JAccessibleElementSymbolReturns the modifiers of the element represented by this symbol, as decodable by the standardModifierAPI.- Specified by:
getModifiersin interfaceJAccessibleElementSymbol
-
getEnclosingClass
@NonNull JClassSymbol getEnclosingClass()
Description copied from interface:JAccessibleElementSymbolReturns the class that directly encloses this declaration. This is equivalent toClass.getEnclosingClass(). Returns null if this is a top-level type declaration.This is necessarily an already resolved symbol, because 1. if it's obtained from reflection, then the enclosing class is available 2. if it's obtained from an AST, then the enclosing class is in the same source file so we can know about it
- Specified by:
getEnclosingClassin interfaceJAccessibleElementSymbol
-
getPackageName
default @NonNull String getPackageName()
Description copied from interface:JAccessibleElementSymbolReturns the name of the package this element is declared in. This recurses into the enclosing elements if needed. If this is an array symbol, returns the package name of the element symbol. If this is a primitive type, returns "java.lang".This is consistent with Java 9's
getPackageName().- Specified by:
getPackageNamein interfaceJAccessibleElementSymbol
-
acceptVisitor
default <R,P> R acceptVisitor(SymbolVisitor<R,P> visitor, P param)
Description copied from interface:JElementSymbolDispatch to the appropriate visit method of the visitor and returns its result.- Specified by:
acceptVisitorin interfaceJElementSymbol
-
tryGetNode
default @Nullable N tryGetNode()
Description copied from interface:JElementSymbolReturns the node that declares this symbol. Eg forJMethodSymbol, it's anASTMethodDeclaration. Will only return non-null if the symbol is declared in the file currently being analysed.- Specified by:
tryGetNodein interfaceJElementSymbol
-
-