org.fest.swing.format
Class IntrospectionComponentFormatter
java.lang.Object
org.fest.swing.format.ComponentFormatterTemplate
org.fest.swing.format.IntrospectionComponentFormatter
- All Implemented Interfaces:
- ComponentFormatter
public final class IntrospectionComponentFormatter
- extends ComponentFormatterTemplate
Understands a formatter that uses
introspection
to display property values of a Component. This formatter does not support nested properties.
- Author:
- Alex Ruiz
IntrospectionComponentFormatter
public IntrospectionComponentFormatter(Class<? extends Component> targetType,
String... propertyNames)
- Creates a new
IntrospectionComponentFormatter.
- Parameters:
targetType - the type of Component that this formatter supports.propertyNames - the property names to show as the String representation of a given
Component.
- Throws:
NullPointerException - if targetType is null.
doFormat
protected String doFormat(Component c)
- Returns a
String representation of the given Component, showing only the
properties specified in this formatter's
constructor.
- Specified by:
doFormat in class ComponentFormatterTemplate
- Parameters:
c - the given Component.
- Returns:
- a
String representation of the given Component.
- Throws:
NullPointerException - if the given Component is null.
IllegalArgumentException - if the type of the given Component is not supported by this
formatter.- See Also:
targetType()
targetType
public Class<? extends Component> targetType()
- Returns the type of
Component this formatter supports.
- Returns:
- the type of
Component this formatter supports.
toString
public String toString()
- Overrides:
toString in class Object
Copyright © 2007-2010 FEST (Fixtures for Easy Software Testing). All Rights Reserved.