-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add support for records to the language model
- Loading branch information
Showing
3 changed files
with
95 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
api/src/main/java/jakarta/enterprise/lang/model/declarations/RecordComponentInfo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
package jakarta.enterprise.lang.model.declarations; | ||
|
||
import jakarta.enterprise.lang.model.types.Type; | ||
|
||
/** | ||
* A record component, {@linkplain #declaringRecord() declared} in some record. | ||
* | ||
* @since 4.0 | ||
*/ | ||
public interface RecordComponentInfo extends DeclarationInfo { | ||
/** | ||
* Returns the name of this record component. | ||
* | ||
* @return the name of this record component, never {@code null} | ||
*/ | ||
String name(); | ||
|
||
/** | ||
* Returns the {@linkplain Type type} of this record component. | ||
* | ||
* @return the {@linkplain Type type} of this record component, never {@code null} | ||
*/ | ||
Type type(); | ||
|
||
/** | ||
* Returns the field corresponding to this record component. | ||
* | ||
* @return the field, never {@code null} | ||
*/ | ||
FieldInfo field(); | ||
|
||
/** | ||
* Returns the accessor method corresponding to this record component. | ||
* | ||
* @return the accessor method, never {@code null} | ||
*/ | ||
MethodInfo accessor(); | ||
|
||
/** | ||
* Returns the {@linkplain ClassInfo record} that declares this component. | ||
* | ||
* @return the {@linkplain ClassInfo record} that declares this component, never {@code null} | ||
*/ | ||
ClassInfo declaringRecord(); | ||
|
||
// --- | ||
|
||
@Override | ||
default Kind kind() { | ||
return Kind.RECORD_COMPONENT; | ||
} | ||
|
||
@Override | ||
default RecordComponentInfo asRecordComponent() { | ||
return this; | ||
} | ||
} |