public class RegexPropertyResolver extends IntrospectorPropertyResolver
The patterns provided should produce a match where group(1) returns the
name of the property. If you need to specify a regex that contains more than one capture group, use the constructor
that allows you to specify the capture group index that will return the name of the property.
Note that the name will automatically be un-capitalized, so you need not worry
about defining your regular expression to handle this.
Only no-argument getter methods returning a type are considered for a read method match,
and only single-argument methods are considered for a write method match; the write method
need not have a void return type.
The type of the setter method must be a sub-type (or matching type) of the getter method's type;
if the getter method is a strict sub-type, then the type of the setter method will define the
type of the property.
ELEMENT_PROPERT_PREFIX, ELEMENT_PROPERT_SUFFIX| Constructor and Description |
|---|
RegexPropertyResolver(String readMethodRegex,
String writeMethodRegex,
boolean includeJavaBeans,
boolean includePublicFields) |
RegexPropertyResolver(String readMethodRegex,
String writeMethodRegex,
boolean includeJavaBeans,
boolean includePublicFields,
int readMethodRegexCaptureGroupIndex,
int writeMethodRegexCaptureGroupIndex) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
collectProperties(Class<?> type,
Type<?> referenceType,
Map<String,Property> properties)
Collects all properties for the specified type.
|
protected String |
uncapitalize(String string)
Converts the first character of a String to lowercase
|
capitalize, collectPublicFieldProperties, existsProperty, getElementProperty, getElementProperty, getIndividualElementProperty, getNestedProperty, getNestedProperty, getProperties, getProperty, getProperty, getProperty, hasTypeParameters, isElementPropertyExpression, isIndividualElementExpression, isInlinePropertyExpression, isNestedPropertyExpression, processProperty, resolveInlineProperty, resolvePropertyType, splitElementProperty, splitNestedPropertypublic RegexPropertyResolver(String readMethodRegex, String writeMethodRegex, boolean includeJavaBeans, boolean includePublicFields)
readMethodRegex - writeMethodRegex - includeJavaBeans - includePublicFields - protected String uncapitalize(String string)
string - protected void collectProperties(Class<?> type, Type<?> referenceType, Map<String,Property> properties)
collectProperties in class IntrospectorPropertyResolvertype - the type for which to collect propertiesreferenceType - the reference type for use in resolving generic parameters as neededproperties - the properties collected for the current typeCopyright © 2019 Glasnost. All rights reserved.