public class ClassDescriptor
extends java.lang.Object
Descriptors are 'lazy': various internal caches are created on first request.
Throughout this class, public members are defined as members defined with "public" keyword and declared in a public type. Public members declared by a non-public class is considered non-public because access to it from outside is prohibited by the java access control anyway.
Public members defined in public classes are always preferred even when we allow private/protected members and types to be visible. So if a non-public subtype and a public super type both have a field with the same name, the field in the public super type is always used.
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
extendedProperties |
protected boolean |
includeFieldsAsProperties |
protected java.lang.String |
propertyFieldPrefix |
protected boolean |
scanAccessible |
protected java.lang.Class |
type |
protected int |
usageCount |
| Constructor and Description |
|---|
ClassDescriptor(java.lang.Class type,
boolean scanAccessible,
boolean extendedProperties,
boolean includeFieldsAsProperties,
java.lang.String propertyFieldPrefix) |
| Modifier and Type | Method and Description |
|---|---|
CtorDescriptor[] |
getAllCtorDescriptors()
Returns an array of all
constructor descriptors. |
FieldDescriptor[] |
getAllFieldDescriptors()
Returns all field descriptors, including declared ones.
|
MethodDescriptor[] |
getAllMethodDescriptors()
Returns an array of all methods.
|
MethodDescriptor[] |
getAllMethodDescriptors(java.lang.String name)
Returns an array of all methods with the same name.
|
PropertyDescriptor[] |
getAllPropertyDescriptors()
Returns all properties descriptors.
|
CtorDescriptor |
getCtorDescriptor(java.lang.Class[] args,
boolean declared)
Returns the constructor identified by arguments or
null if not found. |
protected Ctors |
getCtors()
Returns constructors collection.
|
CtorDescriptor |
getDefaultCtorDescriptor(boolean declared)
Returns the default ctor or
null if not found. |
FieldDescriptor |
getFieldDescriptor(java.lang.String name,
boolean declared)
Returns field descriptor.
|
protected Fields |
getFields()
Returns
fields collection. |
MethodDescriptor |
getMethodDescriptor(java.lang.String name,
boolean declared)
Returns
method descriptor identified by name and parameters. |
MethodDescriptor |
getMethodDescriptor(java.lang.String name,
java.lang.Class[] params,
boolean declared)
Returns
method descriptor identified by name and parameters. |
protected Methods |
getMethods()
Returns methods collection.
|
protected Properties |
getProperties()
Returns properties collection.
|
PropertyDescriptor |
getPropertyDescriptor(java.lang.String name,
boolean declared)
Returns property descriptor.
|
java.lang.String |
getPropertyFieldPrefix()
Returns property field prefix.
|
java.lang.Class |
getType()
Get the class object that this descriptor describes.
|
int |
getUsageCount()
Returns number of class descriptor usages.
|
protected void |
increaseUsageCount()
Increases usage count.
|
boolean |
isArray()
Returns
true if class is an array. |
boolean |
isCollection()
Returns
true if type is a collection. |
boolean |
isExtendedProperties()
Returns
true if properties in this class descriptor
are extended and include field description. |
boolean |
isIncludeFieldsAsProperties()
Include fields as properties.
|
boolean |
isList()
Returns
true if class is a List. |
boolean |
isMap()
Returns
true if class is a Map. |
boolean |
isScanAccessible()
Returns
true if this class descriptor
works with accessible fields/methods/constructors or with
all supported. |
boolean |
isSet()
Returns
true if type is a Set. |
protected final java.lang.Class type
protected final boolean scanAccessible
protected final boolean extendedProperties
protected final boolean includeFieldsAsProperties
protected final java.lang.String propertyFieldPrefix
protected int usageCount
public ClassDescriptor(java.lang.Class type,
boolean scanAccessible,
boolean extendedProperties,
boolean includeFieldsAsProperties,
java.lang.String propertyFieldPrefix)
public java.lang.Class getType()
public boolean isScanAccessible()
true if this class descriptor
works with accessible fields/methods/constructors or with
all supported.public boolean isExtendedProperties()
true if properties in this class descriptor
are extended and include field description.public boolean isIncludeFieldsAsProperties()
public java.lang.String getPropertyFieldPrefix()
null
if prefix is not set.protected void increaseUsageCount()
public int getUsageCount()
public boolean isArray()
true if class is an array.public boolean isMap()
true if class is a Map.public boolean isList()
true if class is a List.public boolean isSet()
true if type is a Set.public boolean isCollection()
true if type is a collection.protected Fields getFields()
fields collection.
Creates new fields collection on first usage.public FieldDescriptor getFieldDescriptor(java.lang.String name, boolean declared)
public FieldDescriptor[] getAllFieldDescriptors()
protected Methods getMethods()
public MethodDescriptor getMethodDescriptor(java.lang.String name, boolean declared)
method descriptor identified by name and parameters.public MethodDescriptor getMethodDescriptor(java.lang.String name, java.lang.Class[] params, boolean declared)
method descriptor identified by name and parameters.public MethodDescriptor[] getAllMethodDescriptors(java.lang.String name)
public MethodDescriptor[] getAllMethodDescriptors()
protected Properties getProperties()
public PropertyDescriptor getPropertyDescriptor(java.lang.String name, boolean declared)
public PropertyDescriptor[] getAllPropertyDescriptors()
protected Ctors getCtors()
public CtorDescriptor getDefaultCtorDescriptor(boolean declared)
null if not found.public CtorDescriptor getCtorDescriptor(java.lang.Class[] args, boolean declared)
null if not found.public CtorDescriptor[] getAllCtorDescriptors()
constructor descriptors.Copyright © 2003-2013 Jodd Team