public class NameUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static String |
defaultNamespace(String extensionName) |
static String |
getAbstractTopLevelTypeName(org.mule.metadata.api.model.MetadataType metadataType) |
static String |
getAliasName(Class<?> type) |
static String |
getAliasName(Field field) |
static String |
getAliasName(String defaultName,
Alias aliasAnnotation) |
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 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 getAbstractTopLevelTypeName(org.mule.metadata.api.model.MetadataType metadataType)
Copyright © 2016 MuleSoft, Inc.. All rights reserved.