src/share/classes/java/lang/Class.java

Print this page




 489     public native boolean isPrimitive();
 490 
 491     /**
 492      * Returns true if this {@code Class} object represents an annotation
 493      * type.  Note that if this method returns true, {@link #isInterface()}
 494      * would also return true, as all annotation types are also interfaces.
 495      *
 496      * @return {@code true} if this class object represents an annotation
 497      *      type; {@code false} otherwise
 498      * @since 1.5
 499      */
 500     public boolean isAnnotation() {
 501         return (getModifiers() & ANNOTATION) != 0;
 502     }
 503 
 504     /**
 505      * Returns {@code true} if this class is a synthetic class;
 506      * returns {@code false} otherwise.
 507      * @return {@code true} if and only if this class is a synthetic class as
 508      *         defined by the Java Language Specification.

 509      * @since 1.5
 510      */
 511     public boolean isSynthetic() {
 512         return (getModifiers() & SYNTHETIC) != 0;
 513     }
 514 
 515     /**
 516      * Returns the  name of the entity (class, interface, array class,
 517      * primitive type, or void) represented by this {@code Class} object,
 518      * as a {@code String}.
 519      *
 520      * <p> If this class object represents a reference type that is not an
 521      * array type then the binary name of the class is returned, as specified
 522      * by
 523      * <cite>The Java&trade; Language Specification</cite>.
 524      *
 525      * <p> If this class object represents a primitive type or void, then the
 526      * name returned is a {@code String} equal to the Java language
 527      * keyword corresponding to the primitive type or void.
 528      *




 489     public native boolean isPrimitive();
 490 
 491     /**
 492      * Returns true if this {@code Class} object represents an annotation
 493      * type.  Note that if this method returns true, {@link #isInterface()}
 494      * would also return true, as all annotation types are also interfaces.
 495      *
 496      * @return {@code true} if this class object represents an annotation
 497      *      type; {@code false} otherwise
 498      * @since 1.5
 499      */
 500     public boolean isAnnotation() {
 501         return (getModifiers() & ANNOTATION) != 0;
 502     }
 503 
 504     /**
 505      * Returns {@code true} if this class is a synthetic class;
 506      * returns {@code false} otherwise.
 507      * @return {@code true} if and only if this class is a synthetic class as
 508      *         defined by the Java Language Specification.
 509      * @jls 13.1 The Form of a Binary
 510      * @since 1.5
 511      */
 512     public boolean isSynthetic() {
 513         return (getModifiers() & SYNTHETIC) != 0;
 514     }
 515 
 516     /**
 517      * Returns the  name of the entity (class, interface, array class,
 518      * primitive type, or void) represented by this {@code Class} object,
 519      * as a {@code String}.
 520      *
 521      * <p> If this class object represents a reference type that is not an
 522      * array type then the binary name of the class is returned, as specified
 523      * by
 524      * <cite>The Java&trade; Language Specification</cite>.
 525      *
 526      * <p> If this class object represents a primitive type or void, then the
 527      * name returned is a {@code String} equal to the Java language
 528      * keyword corresponding to the primitive type or void.
 529      *