public class JavassistPropertyStyle extends JavaBeanPropertyStyle
This PropertyStyle extends JavaBeanPropertyStyle
to use the debug line numbering
information embedded in JVM bytecode to sort getters and setters according to their original
declaration order in the source code.
This saves domain objects having to use the UiComesAfter
annotation (or an XML
file, or some other method) to impose an ordering.
However, a danger of this approach is that if the domain objects are ever recompiled
without debug line numbering information (eg. when moving from development to
production) the UI fields will lose their ordering. Such a subtle bug may not be picked up, so as
a safeguard JavassistPropertyStyle
'fails hard' with an
InspectorException
if line numbers are not available.
JavassistPropertyStyle
uses the following sorting algorithm:
UiComesAfter
annotation, which can
interleave superclass and subclass properties. However, it is possible to use both
UiComesAfter
and JavassistPropertyStyle
together to get the best of
both worlds.JavaBeanPropertyStyle.FieldProperty, JavaBeanPropertyStyle.JavaBeanProperty
mLog
Constructor and Description |
---|
JavassistPropertyStyle() |
JavassistPropertyStyle(JavaBeanPropertyStyleConfig config) |
Modifier and Type | Method and Description |
---|---|
protected Map<String,Property> |
inspectProperties(String type)
Returns properties sorted by name.
|
getPrivateField, isGetter, isSetter, lookupFields, lookupGetters, lookupSetters
getProperties, getUncachedTraits, traverse
cacheTraits, clearCache, getCachedTraits, getTraits, isExcluded, isExcludedBaseType, isExcludedName, isExcludedReturnType
public JavassistPropertyStyle()
public JavassistPropertyStyle(JavaBeanPropertyStyleConfig config)
protected Map<String,Property> inspectProperties(String type)
JavaBeanPropertyStyle
inspectProperties
in class JavaBeanPropertyStyle
Copyright © 2015. All Rights Reserved.