APIdia Launch Partner
Top Description Constructors Methods
com.sun.beans.finder

public final Class FieldFinder

extends Object
Class Inheritance
Imports
java.lang.reflect.Field, .Modifier

This utility class provides static methods to find a public field with specified name in specified class.
Author
Sergey A. Malenkov
Since
1.7

Constructor Summary

AccessConstructor and Description
private
FieldFinder()

Disable instantiation.

Method Summary

Modifier and TypeMethod and Description
public static Field

Returns:

object that represents found field
findField
(Class<?>
the class that can have field
type
,
String
the name of field to find
name
)

Finds public field (static or non-static) that is declared in public class.

public static Field

Returns:

object that represents found field
findInstanceField
(Class<?>
the class that can have field
type
,
String
the name of field to find
name
)

Finds public non-static field that is declared in public class.

public static Field

Returns:

object that represents found field
findStaticField
(Class<?>
the class that can have field
type
,
String
the name of field to find
name
)

Finds public static field that is declared in public class.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

FieldFinderback to summary
private FieldFinder()

Disable instantiation.

Method Detail

findFieldback to summary
public static Field findField(Class<?> type, String name) throws NoSuchFieldException

Finds public field (static or non-static) that is declared in public class.

Parameters
type:Class<?>

the class that can have field

name:String

the name of field to find

Returns:Field

object that represents found field

Exceptions
NoSuchFieldException:
if field is not found
See Also
Class#getField
findInstanceFieldback to summary
public static Field findInstanceField(Class<?> type, String name) throws NoSuchFieldException

Finds public non-static field that is declared in public class.

Parameters
type:Class<?>

the class that can have field

name:String

the name of field to find

Returns:Field

object that represents found field

Exceptions
NoSuchFieldException:
if field is not found
See Also
Class#getField
findStaticFieldback to summary
public static Field findStaticField(Class<?> type, String name) throws NoSuchFieldException

Finds public static field that is declared in public class.

Parameters
type:Class<?>

the class that can have field

name:String

the name of field to find

Returns:Field

object that represents found field

Exceptions
NoSuchFieldException:
if field is not found
See Also
Class#getField