public class NameUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
CONFIGURATION |
static String |
CONNECTION_PROVIDER |
static String |
OPERATION |
static String |
SOURCE |
static String |
SOURCE_CALLBACK |
| Modifier and Type | Method and Description |
|---|---|
static <T extends org.mule.runtime.api.meta.NamedObject> |
alphaSortDescribedList(List<T> list)
Sorts the given
list in ascending alphabetic order, using NamedObject.getName() as the sorting criteria |
static String |
defaultNamespace(String extensionName) |
static String |
getAliasName(Class<?> type) |
static String |
getAliasName(Field field) |
static String |
getAliasName(org.mule.metadata.api.model.MetadataType metadataType) |
static String |
getAliasName(Parameter parameter) |
static String |
getAliasName(String defaultName,
Alias aliasAnnotation) |
static String |
getComponentDeclarationTypeName(org.mule.runtime.api.meta.model.declaration.fluent.BaseDeclaration declaration) |
static String |
getComponentModelTypeName(Object component) |
static String |
getModelName(Object model) |
static String |
getTopLevelTypeName(org.mule.metadata.api.model.MetadataType metadataType)
Returns a hypenized name of the give top level
metadataType. |
static String |
hyphenize(String camelCaseName)
Transforms a camel case value into a hyphenizedone.
|
static boolean |
isUncountable(String word)
Return true if the word is uncountable.
|
static String |
itemize(String word)
Return the itemized version of a word, which is
an
hyphenized version of the word with
the item suffix |
static String |
pluralize(String word)
Return the pluralized version of a word.
|
static String |
sanitizeName(String originalName)
Removes everything that's not a word, a dot nor a hyphen
|
static String |
singularize(String word)
Return the singularized version of a word.
|
public static final String CONFIGURATION
public static final String OPERATION
public static final String CONNECTION_PROVIDER
public static final String SOURCE
public static final String SOURCE_CALLBACK
public static String hyphenize(String camelCaseName)
For example:
messageProcessor would be transformed to message-processor
camelCaseName - a String in camel case formcamelCaseName in hypenized formpublic static String pluralize(String word)
word - The wordpublic static String singularize(String word)
word - The wordpublic static String itemize(String word)
hyphenized version of the word with
the item suffixword - The wordpublic static boolean isUncountable(String word)
word - The wordpublic static String getTopLevelTypeName(org.mule.metadata.api.model.MetadataType metadataType)
metadataType.
This method will look for the TypeAliasAnnotation of the MetadataType
to get the type simple name.
As a fallback, it uses JavaTypeUtils.getType(MetadataType) to obtain the
Class that the metadataType represents. Then, it
checks if the Alias annotation is present. If so, the
Alias.value() is used. Otherwise, the Class.getSimpleName() will
be considered.
metadataType - the MetadataType which name you wanttypepublic static String getAliasName(org.mule.metadata.api.model.MetadataType metadataType)
public static String getComponentDeclarationTypeName(org.mule.runtime.api.meta.model.declaration.fluent.BaseDeclaration declaration)
public static <T extends org.mule.runtime.api.meta.NamedObject> List<T> alphaSortDescribedList(List<T> list)
list in ascending alphabetic order, using NamedObject.getName() as the sorting criteriaT - the generic type of the items in the listlist - a List with instances of NamedObjectlistCopyright © 2017 MuleSoft, Inc.. All rights reserved.