public abstract class MethodParam extends Object
This class should be extended to implement custom types of parameters (eg: check
ContentTypeParam
Modifier and Type | Field and Description |
---|---|
protected String |
expression |
protected Class<?> |
paramType |
Modifier | Constructor and Description |
---|---|
protected |
MethodParam(Class<?> paramType,
String expression) |
Modifier and Type | Method and Description |
---|---|
protected String |
buildCode(String indent) |
protected static String |
buildStringLiteral(String value,
String indent) |
protected static Set<String> |
findConstantNames(Class<?> constantsHolderClass,
Class<?> constantClass,
Predicate<Field> filter) |
protected static <T> Map<T,String> |
findConstantNamesMap(Class<?> constantsHolderClass,
Class<T> constantClass,
Predicate<Field> filter) |
String |
getExpression() |
Set<String> |
getImports()
Gets all classes that are required to be statically imported by generated code.
|
Map<String,MethodCall> |
getMethodDefinitions() |
Set<String> |
getStaticImports()
Gets all classes that are required to be imported by generated code.
|
protected Class<?> |
getType() |
boolean |
isDefault()
Allows checking if a parameter is set to the default value.
|
protected boolean |
isIgnored() |
protected final Class<?> paramType
protected final String expression
public String getExpression()
protected Class<?> getType()
public boolean isDefault()
This is usually used in MethodCallBuilder
instances to check if a parameter is set or
not to some custom value, and some method chaingin is required or not.
This method may, and is, overwritten by subclasses depending on the semantics of each type of parameter.
protected boolean isIgnored()
public Set<String> getStaticImports()
Override this method if you implement a custom MethodParam that requires some particular import.
public Set<String> getImports()
Override this method if you implement a custom MethodParam that requires some particular static import.
public Map<String,MethodCall> getMethodDefinitions()
protected static <T> Map<T,String> findConstantNamesMap(Class<?> constantsHolderClass, Class<T> constantClass, Predicate<Field> filter)
Copyright © 2023. All rights reserved.