in lightning-core/src/main/java/org/apache/directmemory/lightning/internal/beans/introspection/AnnotatedTypeIntrospector.java [54:94]
public List<PropertyDescriptor> introspect( Type type, MarshallerStrategy marshallerStrategy,
MarshallerContext marshallerContext,
PropertyDescriptorFactory propertyDescriptorFactory )
{
if ( !( type instanceof Class ) )
{
return Collections.emptyList();
}
Class<?> clazz = (Class<?>) type;
Set<Field> properties = BeanUtil.findPropertiesByClass( clazz, annotationType );
List<PropertyDescriptor> propertyDescriptors = new ArrayList<PropertyDescriptor>();
for ( Field property : properties )
{
if ( isExcluded( property.getName() ) )
{
continue;
}
Class<?> fieldType = property.getType();
Marshaller marshaller = marshallerStrategy.getMarshaller( fieldType, marshallerContext, false );
if ( marshaller == null && fieldType.isArray() )
{
marshaller = marshallerStrategy.getMarshaller( fieldType.getComponentType(), marshallerContext, false );
}
if ( marshaller instanceof TypeBindableMarshaller )
{
Type[] typeArguments = TypeUtil.getTypeArgument( property.getGenericType() );
marshaller = ( (TypeBindableMarshaller) marshaller ).bindType( typeArguments );
}
propertyDescriptors.add( propertyDescriptorFactory.byField( property, marshaller, clazz ) );
}
return propertyDescriptors;
}