Package org.fest.swing.format
Class IntrospectionComponentFormatter
java.lang.Object
org.fest.swing.format.ComponentFormatterTemplate
org.fest.swing.format.IntrospectionComponentFormatter
- All Implemented Interfaces:
ComponentFormatter
Understands a formatter that uses
introspection
to display property values of a
Component
. This formatter does not support nested properties.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionIntrospectionComponentFormatter
(Class<? extends Component> targetType, String... propertyNames) Creates a newIntrospectionComponentFormatter
. -
Method Summary
Modifier and TypeMethodDescriptionprivate void
appendProperty
(StringBuilder b, String name, Component c) protected String
Returns aString
representation of the given
, showing only the properties specified in this formatter'sComponent
.constructor
private boolean
private void
populate()
private Object
propertyValue
(Component c, String property) private void
Returns the type of
this formatter supports.Component
toString()
Methods inherited from class org.fest.swing.format.ComponentFormatterTemplate
format
-
Field Details
-
targetType
-
propertyNames
-
descriptors
-
-
Constructor Details
-
IntrospectionComponentFormatter
public IntrospectionComponentFormatter(Class<? extends Component> targetType, String... propertyNames) Creates a newIntrospectionComponentFormatter
.- Parameters:
targetType
- the type ofComponent
that this formatter supports.propertyNames
- the property names to show as theString
representation of a givenComponent
.- Throws:
NullPointerException
- iftargetType
isnull
.
-
-
Method Details
-
populate
private void populate() -
register
-
doFormat
Returns aString
representation of the given
, showing only the properties specified in this formatter'sComponent
.constructor
- Specified by:
doFormat
in classComponentFormatterTemplate
- Parameters:
c
- the givenComponent
.- Returns:
- a
String
representation of the givenComponent
. - Throws:
NullPointerException
- if the givenComponent
isnull
.IllegalArgumentException
- if the type of the givenComponent
is not supported by this formatter.- See Also:
-
appendProperty
-
propertyValue
- Throws:
Exception
-
isOneDimensionalArray
-
targetType
Returns the type of
this formatter supports.Component
- Returns:
- the type of
Component
this formatter supports.
-
toString
-