com.codereligion.reflect
Class BeanIntrospections

java.lang.Object
  extended by com.codereligion.reflect.BeanIntrospections

public final class BeanIntrospections
extends Object

Provides convenience methods to ease working with Java bean instrospection.

Since:
11.08.2012
Author:
Sebastian Gröbler

Method Summary
static Set<PropertyDescriptor> getReadableProperties(Class<?> type)
          Retrieves a Set of readable properties of the given type.
static Set<PropertyDescriptor> getWriteableAndReadableProperties(Class<?> type)
          Retrieves a Set of writeable and readable properties of the given type.
static Set<PropertyDescriptor> getWriteableProperties(Class<?> type)
          Retrieves a Set of writeable properties of the given type .
static boolean hasDefaultConstructor(Class<?> type)
          Determines whether the given type has a default constructor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

hasDefaultConstructor

public static boolean hasDefaultConstructor(Class<?> type)
Determines whether the given type has a default constructor.

Parameters:
type - the Class to check
Returns:
true if the given type as a zero argument constructor, false otherwise
Throws:
NullPointerException - when the given parameter is null

getWriteableProperties

public static Set<PropertyDescriptor> getWriteableProperties(Class<?> type)
Retrieves a Set of writeable properties of the given type . This includes all properties which have a public setter.

Parameters:
type - the Class to get the writeable properties for
Returns:
a Set of PropertyDescriptors
Throws:
NullPointerException - when the given type is null
IllegalArgumentException - when the given type can not be introspected

getReadableProperties

public static Set<PropertyDescriptor> getReadableProperties(Class<?> type)
Retrieves a Set of readable properties of the given type. This includes all properties which have a public getter.

Parameters:
type - the Class to get the readable properties for
Returns:
a Set of PropertyDescriptors
Throws:
NullPointerException - when the given type is null
IllegalArgumentException - when the given type can not be introspected

getWriteableAndReadableProperties

public static Set<PropertyDescriptor> getWriteableAndReadableProperties(Class<?> type)
Retrieves a Set of writeable and readable properties of the given type. This includes all properties which have a public setter.

Parameters:
type - the Class to get the writeable and readable properties for
Returns:
a Set of PropertyDescriptors
Throws:
NullPointerException - when the given type is null
IllegalArgumentException - when the given type can not be introspected


Copyright © 2013. All rights reserved.