Class DefaultAccessorNamingStrategy.FirstCharBasedValidator
- java.lang.Object
-
- com.fasterxml.jackson.databind.introspect.DefaultAccessorNamingStrategy.FirstCharBasedValidator
-
- All Implemented Interfaces:
DefaultAccessorNamingStrategy.BaseNameValidator
- Enclosing class:
- DefaultAccessorNamingStrategy
public static class DefaultAccessorNamingStrategy.FirstCharBasedValidator extends java.lang.Object implements DefaultAccessorNamingStrategy.BaseNameValidator
Simple implementation ofDefaultAccessorNamingStrategy.BaseNameValidator
that checks the first character and nothing else.Instances are to be constructed using method
forFirstNameRule(boolean, boolean)
.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
accept(char firstChar, java.lang.String basename, int offset)
static DefaultAccessorNamingStrategy.BaseNameValidator
forFirstNameRule(boolean allowLowerCaseFirstChar, boolean allowNonLetterFirstChar)
Factory method to use for getting an instance with specified first-character restrictions, if any; ornull
if no checking is needed.
-
-
-
Method Detail
-
forFirstNameRule
public static DefaultAccessorNamingStrategy.BaseNameValidator forFirstNameRule(boolean allowLowerCaseFirstChar, boolean allowNonLetterFirstChar)
Factory method to use for getting an instance with specified first-character restrictions, if any; ornull
if no checking is needed.- Parameters:
allowLowerCaseFirstChar
- Whether base names that start with lower-case letter (like"a"
or"b"
) are accepted as valid or not: consider difference between "setter-methods"setValue()
andsetvalue()
.allowNonLetterFirstChar
- Whether base names that start with non-letter character (like"_"
or number1
) are accepted as valid or not: consider difference between "setter-methods"setValue()
andset_value()
.- Returns:
- Validator instance to use, if any;
null
to indicate no additional rules applied (case when both arguments arefalse
)
-
accept
public boolean accept(char firstChar, java.lang.String basename, int offset)
- Specified by:
accept
in interfaceDefaultAccessorNamingStrategy.BaseNameValidator
-
-