public class PropertyTypeInspector extends BaseObjectInspector
If the actual type of the property's object is a subtype of the declared type, both the actual and the declared type are returned.
The properties are returned in the order defined by their PropertyStyle
. For
JavaBeanPropertyStyle
(the default) this is 'alphabetical by name'. Most clients
will want to refine this by using, say, UiComesAfter
and
MetawidgetAnnotationInspector.
mLog
Constructor and Description |
---|
PropertyTypeInspector() |
PropertyTypeInspector(BaseObjectInspectorConfig config) |
Modifier and Type | Method and Description |
---|---|
protected Map<String,String> |
inspectEntity(String declaredClass,
String actualClass)
Inspect the given entity's class (not its child properties/actions) and return a Map
of attributes.
|
protected Map<String,String> |
inspectProperty(Property property)
Inspect the given property and return a Map of attributes.
|
protected boolean |
shouldInspectPropertyAsEntity(Property property)
Whether to additionally inspect each child property using
inspectEntity from its
object level. |
getActions, getProperties, inspect, inspectAction, inspectAsDom, inspectParent, inspectTrait, inspectTraits
public PropertyTypeInspector()
public PropertyTypeInspector(BaseObjectInspectorConfig config)
protected boolean shouldInspectPropertyAsEntity(Property property)
BaseObjectInspector
inspectEntity
from its
object level.
This can be useful if the property's value defines useful class-level semantics (eg.
false
by default.
Returns false
by default. For example usage, see
PropertyTypeInspector
.
shouldInspectPropertyAsEntity
in class BaseObjectInspector
property
- the property to inspectprotected Map<String,String> inspectEntity(String declaredClass, String actualClass) throws Exception
BaseObjectInspector
Note: for convenience, this method does not expect subclasses to deal with DOMs and Elements. Those subclasses wanting more control over these features should override methods higher in the call stack instead.
Does nothing by default. For example usage, see PropertyTypeInspector
.
inspectEntity
in class BaseObjectInspector
declaredClass
- the class passed to inspect
, or the class declared by the Object's
parent (ie. its getter method)actualClass
- the actual class of the Object. If you are searching for annotations, generally
you should inspect actualClass rather than declaredClassException
protected Map<String,String> inspectProperty(Property property) throws Exception
BaseObjectInspector
Note: for convenience, this method does not expect subclasses to deal with DOMs and Elements. Those subclasses wanting more control over these features should override methods higher in the call stack instead.
Does nothing by default.
inspectProperty
in class BaseObjectInspector
property
- the property to inspectException
Copyright © 2015. All Rights Reserved.