public static List<String> getPropertyNames(Object obj) {
		List<String> properties = new ArrayList<String>();

		Class<?> objClass = obj.getClass();

		// Get all properties
		for (Field field : objClass.getFields()) {
			if (matchField(field, field.getName()))
				properties.add(field.getName());
		}

		// Get all properties
		for (Method method : objClass.getMethods()) {
			if (method.getName().startsWith("get") && matchPropertyGetter(method, method.getName())) {
				String name = method.getName().substring(3);
				name = name.substring(0, 1).toLowerCase() + name.substring(1);
				properties.add(name);
			}
		}

		return properties;
	}
public static List < String > getPropertyNames ( Object obj ) { List < String > properties = new ArrayList < String > ( ) ; Class < ? > objClass = obj . getClass ( ) ; for ( Field field : objClass . getFields ( ) ) { if ( matchField ( field , field . getName ( ) ) ) properties . add ( field . getName ( ) ) ; } for ( Method method : objClass . getMethods ( ) ) { if ( method . getName ( ) . startsWith ( "get" ) && matchPropertyGetter ( method , method . getName ( ) ) ) { String name = method . getName ( ) . substring ( 3 ) ; name = name . substring ( 0 , 1 ) . toLowerCase ( ) + name . substring ( 1 ) ; properties . add ( name ) ; } } return properties ; }
Gets names of all properties implemented in specified object.

@param obj an objec to introspect.
@return a list with property names.