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 voidappendProperty(StringBuilder b, String name, Component c) protected StringReturns aStringrepresentation of the given, showing only the properties specified in this formatter'sComponent.constructorprivate booleanprivate voidpopulate()private ObjectpropertyValue(Component c, String property) private voidReturns the type ofthis formatter supports.ComponenttoString()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 ofComponentthat this formatter supports.propertyNames- the property names to show as theStringrepresentation of a givenComponent.- Throws:
NullPointerException- iftargetTypeisnull.
-
-
Method Details
-
populate
private void populate() -
register
-
doFormat
Returns aStringrepresentation of the given, showing only the properties specified in this formatter'sComponent.constructor- Specified by:
doFormatin classComponentFormatterTemplate- Parameters:
c- the givenComponent.- Returns:
- a
Stringrepresentation of the givenComponent. - Throws:
NullPointerException- if the givenComponentisnull.IllegalArgumentException- if the type of the givenComponentis not supported by this formatter.- See Also:
-
appendProperty
-
propertyValue
- Throws:
Exception
-
isOneDimensionalArray
-
targetType
Returns the type ofthis formatter supports.Component- Returns:
- the type of
Componentthis formatter supports.
-
toString
-