public class ScalaPropertyStyle extends JavaBeanPropertyStyle
Scala-style properties can almost be handled using JavaBeanPropertyStyle
,
but you have to use Scala's BeanProperty
annotation everywhere which is cumbersome.
This PropertyStyle
is designed to access Scala properties natively.
JavaBeanPropertyStyle.FieldProperty, JavaBeanPropertyStyle.JavaBeanProperty
mLog
Constructor and Description |
---|
ScalaPropertyStyle() |
Modifier and Type | Method and Description |
---|---|
protected String |
isGetter(Method method)
Overridden because Scala uses
x() instead of getX() (what they call
a 'getter' versus a 'bean getter'). |
protected String |
isSetter(Method method)
Overridden because Scala uses
foo_$eq( x ) instead of setFoo( x )
(what they call a 'setter' versus a 'bean setter'). |
protected void |
lookupFields(Map<String,Property> properties,
Class<?> clazz)
Overridden because Scala always wraps properties with getter and setter methods.
|
getPrivateField, inspectProperties, lookupGetters, lookupSetters
getProperties, getUncachedTraits, traverse
cacheTraits, clearCache, getCachedTraits, getTraits, isExcluded, isExcludedBaseType, isExcludedName, isExcludedReturnType
protected void lookupFields(Map<String,Property> properties, Class<?> clazz)
lookupFields
in class JavaBeanPropertyStyle
protected String isGetter(Method method)
x()
instead of getX()
(what they call
a 'getter' versus a 'bean getter').isGetter
in class JavaBeanPropertyStyle
method
- a parameterless method that returns a non-voidprotected String isSetter(Method method)
foo_$eq( x )
instead of setFoo( x )
(what they call a 'setter' versus a 'bean setter').isSetter
in class JavaBeanPropertyStyle
method
- a single-parametered method. May return non-void (ie. for Fluent interfaces)Copyright © 2015. All Rights Reserved.