< prev index next >

src/java.base/share/classes/java/lang/reflect/ReflectAccess.java

Print this page




 142     //
 143     public Method      copyMethod(Method arg) {
 144         return arg.copy();
 145     }
 146     public Method      leafCopyMethod(Method arg) {
 147         return arg.leafCopy();
 148     }
 149 
 150     public Field       copyField(Field arg) {
 151         return arg.copy();
 152     }
 153 
 154     public <T> Constructor<T> copyConstructor(Constructor<T> arg) {
 155         return arg.copy();
 156     }
 157 
 158     @SuppressWarnings("unchecked")
 159     public <T extends AccessibleObject> T getRoot(T obj) {
 160         return (T) obj.getRoot();
 161     }
 162 
 163     /*
 164      * With a Field object for C.f of type T, T should have been resolved
 165      * and T must be present in ValueType attribute.
 166      */
 167     public boolean isFlattenable(Field f) {
 168         return (f.getModifiers() & Modifier.FLATTENABLE) == Modifier.FLATTENABLE;
 169     }
 170 
 171     public boolean isFlatValue(Field f) {
 172         return (f.getModifiers() & Modifier.FLATTENED) == Modifier.FLATTENED;
 173     }
 174 
 175     public boolean canBeNull(Field f) {
 176         return !isFlattenable(f);
 177     }
 178 }


 142     //
 143     public Method      copyMethod(Method arg) {
 144         return arg.copy();
 145     }
 146     public Method      leafCopyMethod(Method arg) {
 147         return arg.leafCopy();
 148     }
 149 
 150     public Field       copyField(Field arg) {
 151         return arg.copy();
 152     }
 153 
 154     public <T> Constructor<T> copyConstructor(Constructor<T> arg) {
 155         return arg.copy();
 156     }
 157 
 158     @SuppressWarnings("unchecked")
 159     public <T extends AccessibleObject> T getRoot(T obj) {
 160         return (T) obj.getRoot();
 161     }
















 162 }
< prev index next >