record components as a first class reflection element
    Vicente Romero 
    vicente.romero at oracle.com
       
    Tue Sep 24 19:05:53 UTC 2019
    
    
  
Hi amber experts,
We are considering our next move in the reflection area for records. It 
will be hoisting record components to a first class status in the 
reflection engine. Our current proposal is to define a new class named: 
java.lang.reflect.RecordComponent which will will be roughly defined as:
public final class RecordComponent implements AnnotatedElement {
     private String name;
     private Class<?> type;
     private Method accessor;
     public String getName() { return name; }
     public Class<?> getType() { return type; }
     public Type getGenericType() {...}
     public AnnotatedType getAnnotatedType() {....}
     public Method getAccessor() { return accessor; }
}
Along with this change we are also proposing changes to java.lang.Class. 
Our proposal there is to remove current method: 
java.lang.Class::getRecordAccessors and add a new method named: 
java.lang.Class::getRecordComponents which will return a array of 
java.lang.reflect.RecordComponents. Thanks in advance for sharing any 
feedback on this proposal,
Vicente
    
    
More information about the amber-spec-experts
mailing list