public class ExtensionModelUtils extends Object
ExtensionModel instances| Modifier and Type | Method and Description |
|---|---|
static boolean |
acceptsExpressions(org.mule.runtime.api.meta.ExpressionSupport support) |
static boolean |
canBeUsedImplicitly(org.mule.runtime.api.meta.model.parameter.ParameterizedModel parameterizedModel)
Returns whether the given model can be used implicitly.
|
static Set<org.mule.runtime.api.meta.model.config.ConfigurationModel> |
getConfigurationForComponent(org.mule.runtime.api.meta.model.ExtensionModel extensionModel,
org.mule.runtime.api.meta.model.ComponentModel component) |
static List<org.mule.runtime.api.meta.model.ComponentModel> |
getConnectedComponents(org.mule.runtime.api.meta.model.ExtensionModel extensionModel)
Returns a
List with all the ComponentModel available to the extensionModel which requires a
connection. |
static List<org.mule.runtime.api.meta.model.ComponentModel> |
getConnectedComponents(org.mule.runtime.api.meta.model.ExtensionModel extensionModel,
org.mule.runtime.api.meta.model.config.ConfigurationModel configurationModel)
Returns a
List with all the ComponentModel available to the configurationModel which requires a
connection. |
static Object |
getDefaultValue(AccessibleObject object)
Tests the given
object to be annotated with Optional. |
static String |
getDefaultValue(Optional optional)
Returns the default value associated with the given annotation.
|
static Optional<String> |
getDefaultValue(org.mule.runtime.api.meta.model.parameter.ParameterModel model) |
static Optional<String> |
getDefaultValue(String name,
org.mule.metadata.api.model.MetadataType model)
Retrieves the default value of a field for a given
MetadataType |
static List<org.mule.runtime.api.meta.model.parameter.ParameterModel> |
getDynamicParameters(org.mule.runtime.api.meta.model.parameter.ParameterizedModel model)
Collects the
parameters from model which supports or requires expressions |
static <T extends org.mule.runtime.api.meta.model.parameter.ParameterizedModel> |
getFirstImplicit(List<T> models)
Returns the first item in the
models List that can be used implicitly. |
static boolean |
isContent(org.mule.runtime.api.meta.model.parameter.ParameterModel parameterModel) |
static boolean |
isContent(org.mule.runtime.api.meta.model.parameter.ParameterRole purpose) |
static boolean |
isInfrastructure(org.mule.runtime.api.meta.model.parameter.ParameterModel parameter) |
static boolean |
isRequired(org.mule.runtime.api.meta.model.parameter.ParameterGroupModel group)
Tests if the given
group contains at least one required ParameterModel |
static boolean |
isText(org.mule.runtime.api.meta.model.parameter.ParameterModel parameter) |
static boolean |
requiresConfig(org.mule.runtime.api.meta.model.ExtensionModel extensionModel,
org.mule.runtime.api.meta.NamedObject component) |
static org.mule.runtime.api.meta.model.parameter.ParameterRole |
roleOf(Optional<Content> content) |
static Map<org.mule.metadata.api.model.ObjectType,Set<org.mule.metadata.api.model.ObjectType>> |
toSubTypesMap(Collection<org.mule.runtime.api.meta.model.SubTypesModel> subTypes) |
public static Optional<String> getDefaultValue(org.mule.runtime.api.meta.model.parameter.ParameterModel model)
model - the parameter who's default value is wantedpublic static Optional<String> getDefaultValue(String name, org.mule.metadata.api.model.MetadataType model)
MetadataTypename - the field's namemodel - the MetadataType containing the field who's default value is wantedpublic static List<org.mule.runtime.api.meta.model.parameter.ParameterModel> getDynamicParameters(org.mule.runtime.api.meta.model.parameter.ParameterizedModel model)
parameters from model which supports or requires expressionsmodel - a ParameterizedModelList of ParameterModel. Can be empty but will never be nullpublic static boolean acceptsExpressions(org.mule.runtime.api.meta.ExpressionSupport support)
support - a ExpressionSupportsupport is one which accepts or requires expressionspublic static List<org.mule.runtime.api.meta.model.ComponentModel> getConnectedComponents(org.mule.runtime.api.meta.model.ExtensionModel extensionModel)
List with all the ComponentModel available to the extensionModel which requires a
connection. This includes both SourceModel and OperationModel.extensionModel - a ExtensionModelList of ComponentModel. It might be empty but will never be nullpublic static List<org.mule.runtime.api.meta.model.ComponentModel> getConnectedComponents(org.mule.runtime.api.meta.model.ExtensionModel extensionModel, org.mule.runtime.api.meta.model.config.ConfigurationModel configurationModel)
List with all the ComponentModel available to the configurationModel which requires a
connection. This includes both SourceModel and OperationModel.extensionModel - the ExtensionModel that owns the configurationModelconfigurationModel - the ConfigurationModel which components you wantList of ComponentModel. It might be empty but will never be nullpublic static boolean requiresConfig(org.mule.runtime.api.meta.model.ExtensionModel extensionModel,
org.mule.runtime.api.meta.NamedObject component)
extensionModel - the model which owns the componentcomponent - a componentcomponent needs to be provided with a config
in order to functionpublic static Set<org.mule.runtime.api.meta.model.config.ConfigurationModel> getConfigurationForComponent(org.mule.runtime.api.meta.model.ExtensionModel extensionModel, org.mule.runtime.api.meta.model.ComponentModel component)
extensionModel - the model which owns the componentcomponent - a componentSet with the ConfigurationModel that the can be used alongside with the componentpublic static boolean isContent(org.mule.runtime.api.meta.model.parameter.ParameterModel parameterModel)
public static boolean isText(org.mule.runtime.api.meta.model.parameter.ParameterModel parameter)
true if the given ParameterModel has layout property
LayoutModel.isText()public static boolean isContent(org.mule.runtime.api.meta.model.parameter.ParameterRole purpose)
public static org.mule.runtime.api.meta.model.parameter.ParameterRole roleOf(Optional<Content> content)
public static Map<org.mule.metadata.api.model.ObjectType,Set<org.mule.metadata.api.model.ObjectType>> toSubTypesMap(Collection<org.mule.runtime.api.meta.model.SubTypesModel> subTypes)
public static boolean isInfrastructure(org.mule.runtime.api.meta.model.parameter.ParameterModel parameter)
true if the given ParameterModel was enriched with InfrastructureParameterModelPropertypublic static <T extends org.mule.runtime.api.meta.model.parameter.ParameterizedModel> T getFirstImplicit(List<T> models)
models List that can be used implicitly.
A ParameterizedModel is consider to be implicit when all its ParameterModels are optional
T - the generic type of the items in the models. It's a type which is assignable from
ParameterizedModelmodels - a List of Tmodels or null if none of the models are implicitpublic static boolean canBeUsedImplicitly(org.mule.runtime.api.meta.model.parameter.ParameterizedModel parameterizedModel)
parameterizedModel - modelpublic static String getDefaultValue(Optional optional)
The reason for this method to be instead of simply using
Optional.defaultValue() is a limitation on the Java language to have
an annotation which defaults to a null value. For that reason, this method tests the default value for equality
against the Optional.NULL. If such test is positive, then
null is returned.
If a null optional is supplied, then this method returns null
optional - a nullable annotationnullpublic static Object getDefaultValue(AccessibleObject object)
object to be annotated with Optional.
If the annotation is present, then a default value is extracted by the rules of
getDefaultValue(org.mule.runtime.extension.api.annotation.param.Optional). Otherwise, null is returned.
Notice that a null return value doesn't necessarily mean that the annotation is not present. It could well be that
null happens to be the default value.
object - an object potentially annotated with Optionalnullpublic static boolean isRequired(org.mule.runtime.api.meta.model.parameter.ParameterGroupModel group)
group contains at least one required ParameterModelgroup - the ParameterGroupModel to be inspectedtrue if the given group contains at least one required ParameterModelCopyright © 2017 MuleSoft, Inc.. All rights reserved.