| 1 | // Show a value given class name and constant name.
|
|---|
| 2 |
|
|---|
| 3 | /* Copyright (C) 2000 Free Software Foundation
|
|---|
| 4 |
|
|---|
| 5 | This file is part of libgcj.
|
|---|
| 6 |
|
|---|
| 7 | This software is copyrighted work licensed under the terms of the
|
|---|
| 8 | Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
|
|---|
| 9 | details. */
|
|---|
| 10 |
|
|---|
| 11 | /* Written by Tom Tromey <[email protected]>. */
|
|---|
| 12 |
|
|---|
| 13 | // Use like this to print a `static final' value (integers only, not
|
|---|
| 14 | // strings yet):
|
|---|
| 15 | // java showval java.awt.geom.AffineTransform.TYPE_IDENTITY
|
|---|
| 16 | // Prints result like:
|
|---|
| 17 | // TYPE_IDENTITY = 0
|
|---|
| 18 | // In conjunction with a keyboard macro you can do a number of
|
|---|
| 19 | // constants very easily.
|
|---|
| 20 |
|
|---|
| 21 | import java.lang.reflect.*;
|
|---|
| 22 |
|
|---|
| 23 | public class showval
|
|---|
|
|---|