public class StandardClassMetadata extends Object implements ClassMetadata
ClassMetadata implementation that uses standard reflection
to introspect a given Class.| 构造器和说明 |
|---|
StandardClassMetadata(Class<?> introspectedClass)
Create a new StandardClassMetadata wrapper for the given Class.
|
| 限定符和类型 | 方法和说明 |
|---|---|
String |
getClassName()
Return the name of the underlying class.
|
String |
getEnclosingClassName()
Return the name of the enclosing class of the underlying class,
or
null if the underlying class is a top-level class. |
String[] |
getInterfaceNames()
Return the names of all interfaces that the underlying class
implements, or an empty array if there are none.
|
Class<?> |
getIntrospectedClass()
Return the underlying Class.
|
String[] |
getMemberClassNames()
Return the names of all classes declared as members of the class represented by
this ClassMetadata object.
|
String |
getSuperClassName()
Return the name of the super class of the underlying class,
or
null if there is no super class defined. |
boolean |
hasEnclosingClass()
Return whether the underlying class is declared within an enclosing
class (i.e. the underlying class is an inner/nested class or a
local class within a method).
|
boolean |
hasSuperClass()
Return whether the underlying class has a super class.
|
boolean |
isAbstract()
Return whether the underlying class is marked as abstract.
|
boolean |
isAnnotation()
Return whether the underlying class represents an annotation.
|
boolean |
isConcrete()
Return whether the underlying class represents a concrete class,
i.e. neither an interface nor an abstract class.
|
boolean |
isFinal()
Return whether the underlying class is marked as 'final'.
|
boolean |
isIndependent()
确定基础类是否独立,即它是顶级类或嵌套类(静态内部类) 可以独立于封闭类构造。
|
boolean |
isInterface()
Return whether the underlying class represents an interface.
|
public StandardClassMetadata(Class<?> introspectedClass)
introspectedClass - the Class to introspectpublic final Class<?> getIntrospectedClass()
public String getClassName()
ClassMetadatagetClassName 在接口中 ClassMetadatapublic boolean isInterface()
ClassMetadataisInterface 在接口中 ClassMetadatapublic boolean isAnnotation()
ClassMetadataisAnnotation 在接口中 ClassMetadatapublic boolean isAbstract()
ClassMetadataisAbstract 在接口中 ClassMetadatapublic boolean isConcrete()
ClassMetadataisConcrete 在接口中 ClassMetadatapublic boolean isFinal()
ClassMetadataisFinal 在接口中 ClassMetadatapublic boolean isIndependent()
ClassMetadataisIndependent 在接口中 ClassMetadatapublic boolean hasEnclosingClass()
ClassMetadataIf this method returns false, then the underlying
class is a top-level class.
hasEnclosingClass 在接口中 ClassMetadata@Nullable public String getEnclosingClassName()
ClassMetadatanull if the underlying class is a top-level class.getEnclosingClassName 在接口中 ClassMetadatapublic boolean hasSuperClass()
ClassMetadatahasSuperClass 在接口中 ClassMetadata@Nullable public String getSuperClassName()
ClassMetadatanull if there is no super class defined.getSuperClassName 在接口中 ClassMetadatapublic String[] getInterfaceNames()
ClassMetadatagetInterfaceNames 在接口中 ClassMetadatapublic String[] getMemberClassNames()
ClassMetadatagetMemberClassNames 在接口中 ClassMetadata