< prev index next >

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

Print this page




 307      *    private int java.io.FileDescriptor.fd
 308      * </pre>
 309      *
 310      * <p>The modifiers are placed in canonical order as specified by
 311      * "The Java Language Specification".  This is {@code public},
 312      * {@code protected} or {@code private} first, and then other
 313      * modifiers in the following order: {@code static}, {@code final},
 314      * {@code transient}, {@code volatile}.
 315      *
 316      * @return a string describing this {@code Field}
 317      * @jls 8.3.1 Field Modifiers
 318      */
 319     public String toString() {
 320         int mod = getModifiers();
 321         return (((mod == 0) ? "" : (Modifier.toString(mod) + " "))
 322             + getType().getTypeName() + " "
 323             + getDeclaringClass().getTypeName() + "."
 324             + getName());
 325     }
 326 





 327     /**
 328      * Returns a string describing this {@code Field}, including
 329      * its generic type.  The format is the access modifiers for the
 330      * field, if any, followed by the generic field type, followed by
 331      * a space, followed by the fully-qualified name of the class
 332      * declaring the field, followed by a period, followed by the name
 333      * of the field.
 334      *
 335      * <p>The modifiers are placed in canonical order as specified by
 336      * "The Java Language Specification".  This is {@code public},
 337      * {@code protected} or {@code private} first, and then other
 338      * modifiers in the following order: {@code static}, {@code final},
 339      * {@code transient}, {@code volatile}.
 340      *
 341      * @return a string describing this {@code Field}, including
 342      * its generic type
 343      *
 344      * @since 1.5
 345      * @jls 8.3.1 Field Modifiers
 346      */




 307      *    private int java.io.FileDescriptor.fd
 308      * </pre>
 309      *
 310      * <p>The modifiers are placed in canonical order as specified by
 311      * "The Java Language Specification".  This is {@code public},
 312      * {@code protected} or {@code private} first, and then other
 313      * modifiers in the following order: {@code static}, {@code final},
 314      * {@code transient}, {@code volatile}.
 315      *
 316      * @return a string describing this {@code Field}
 317      * @jls 8.3.1 Field Modifiers
 318      */
 319     public String toString() {
 320         int mod = getModifiers();
 321         return (((mod == 0) ? "" : (Modifier.toString(mod) + " "))
 322             + getType().getTypeName() + " "
 323             + getDeclaringClass().getTypeName() + "."
 324             + getName());
 325     }
 326 
 327     @Override
 328     String toShortString() {
 329         return "field " + getDeclaringClass().getTypeName() + "." + getName();
 330     }
 331 
 332     /**
 333      * Returns a string describing this {@code Field}, including
 334      * its generic type.  The format is the access modifiers for the
 335      * field, if any, followed by the generic field type, followed by
 336      * a space, followed by the fully-qualified name of the class
 337      * declaring the field, followed by a period, followed by the name
 338      * of the field.
 339      *
 340      * <p>The modifiers are placed in canonical order as specified by
 341      * "The Java Language Specification".  This is {@code public},
 342      * {@code protected} or {@code private} first, and then other
 343      * modifiers in the following order: {@code static}, {@code final},
 344      * {@code transient}, {@code volatile}.
 345      *
 346      * @return a string describing this {@code Field}, including
 347      * its generic type
 348      *
 349      * @since 1.5
 350      * @jls 8.3.1 Field Modifiers
 351      */


< prev index next >