public final class TypeUtils extends Object
MetadataType model| Modifier and Type | Method and Description |
|---|---|
static String |
getAlias(Field field)
Deprecated.
since 1.5.0 use
JavaParserUtils.getAlias(Field) instead |
static Collection<Field> |
getAllFields(Class<?> declaringType)
Returns all the
Fields in the given declaringType. |
static Collection<Class<?>> |
getAllSuperClasses(Class<?> type)
Returns all the superclasses of the given
type, without including Object |
static Optional<org.mule.runtime.api.meta.model.display.ClassValueModel> |
getClassValueModel(Field field)
Returns the
ClassValueModel of the given Field if either annotation ClassValue or
org.mule.sdk.api.annotation.param.display.ClassValue are present |
static Optional<String> |
getDisplayName(Field field)
Returns the display name of the given
Field if either annotation DisplayName or
org.mule.sdk.api.annotation.param.display.DisplayName are present |
static Optional<String> |
getExampleValue(Field field)
|
static Collection<Field> |
getParameterFields(Class<?> declaringType)
|
static Optional<org.mule.runtime.api.meta.model.display.PathModel> |
getPathModel(Field field)
|
static Optional<org.mule.runtime.api.util.Pair<Integer,String>> |
getPlacementValue(Field field)
|
static Optional<String> |
getSummaryValue(Field field)
|
static <R extends Annotation> |
isAnnotationPresentOnField(Field field,
Class<R> annotationClass) |
static <R extends Annotation,S extends Annotation> |
isAnnotationPresentOnField(Field field,
Class<R> legacyAnnotationClass,
Class<S> sdkAnnotationClass) |
static boolean |
isOptional(Field field)
Checks if a field is optional or not
|
static boolean |
isParameter(Field field)
Checks if a field is a parameter
|
static boolean |
isParameterGroup(Field field)
Checks if a field is a parameter group
|
static boolean |
isPasswordField(Field field)
|
static boolean |
isQueryField(Field field)
|
static boolean |
isTextField(Field field)
|
public static Collection<Field> getParameterFields(Class<?> declaringType)
Fields in the given declaringType which are annotated with Parameter but also do not
have the Ignore one.
The introspection also includes parent classes.
declaringType - the class to introspect.Collection of fields. May be empty but will never be nullpublic static Collection<Field> getAllFields(Class<?> declaringType)
declaringType - the class to introspect.Collection of fields. May be empty but will never be nullpublic static Collection<Class<?>> getAllSuperClasses(Class<?> type)
type, without including Objecttype - a type@Deprecated public static String getAlias(Field field)
JavaParserUtils.getAlias(Field) insteadfield for the Alias annotation. If present, Alias.value() is returned. Otherwise,
Field.getName() is returned.field - a Fieldpublic static boolean isParameter(Field field)
public static boolean isParameterGroup(Field field)
field - a FieldField contains either the annotation ParameterGroup or
ParameterGrouppublic static boolean isOptional(Field field)
field - the field to checkpublic static Optional<String> getDisplayName(Field field)
Field if either annotation DisplayName or
org.mule.sdk.api.annotation.param.display.DisplayName are presentfield - the Field to be introspectedOptional containing the display name string if either DisplayName or
org.mule.sdk.api.annotation.param.display.DisplayName are present.public static Optional<org.mule.runtime.api.meta.model.display.PathModel> getPathModel(Field field)
public static Optional<org.mule.runtime.api.meta.model.display.ClassValueModel> getClassValueModel(Field field)
ClassValueModel of the given Field if either annotation ClassValue or
org.mule.sdk.api.annotation.param.display.ClassValue are presentfield - the Field to be introspectedOptional containing the ClassValueModel if either ClassValue or
org.mule.sdk.api.annotation.param.display.ClassValue are present.public static Optional<org.mule.runtime.api.util.Pair<Integer,String>> getPlacementValue(Field field)
public static boolean isTextField(Field field)
public static boolean isPasswordField(Field field)
public static boolean isQueryField(Field field)
public static <R extends Annotation> boolean isAnnotationPresentOnField(Field field, Class<R> annotationClass)
public static <R extends Annotation,S extends Annotation> boolean isAnnotationPresentOnField(Field field, Class<R> legacyAnnotationClass, Class<S> sdkAnnotationClass)
Copyright © 2022 MuleSoft, Inc.. All rights reserved.