java.lang.Object
org.mule.runtime.api.util.NameUtils
org.mule.runtime.extension.api.util.NameUtils
public class NameUtils
extends org.mule.runtime.api.util.NameUtils
Extends
NameUtils with extensions oriented behavior- Since:
- 1.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from class org.mule.runtime.api.util.NameUtils
COMPONENT_NAME_SEPARATOR -
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends org.mule.runtime.api.meta.NamedObject>
List<T>alphaSortDescribedList(List<T> list) Sorts the givenlistin ascending alphabetic order, usingNamedObject.getName()as the sorting criteriastatic StringdefaultNamespace(String extensionName) static StringgetAliasName(Class<?> type) Deprecated.static StringgetAliasName(Field field) Deprecated.since 1.5.0 useTypeUtils.getAlias(Field)insteadstatic StringgetAliasName(Parameter parameter) static StringgetAliasName(org.mule.metadata.api.model.MetadataType metadataType) This method will look for theTypeAliasAnnotationof theMetadataTypeto get the type simple name.static StringgetComponentDeclarationTypeName(org.mule.runtime.api.meta.model.declaration.fluent.BaseDeclaration declaration) static StringgetComponentModelTypeName(org.mule.runtime.api.meta.model.parameter.ParameterizedModel component) static StringgetDeclarationTypeName(org.mule.runtime.api.meta.model.declaration.fluent.ParameterizedDeclaration declaration) static StringgetModelName(Object model) static StringgetTopLevelTypeName(org.mule.metadata.api.model.MetadataType metadataType) Returns a hypenized name of the give top levelmetadataType.static booleanisUncountable(String word) Return true if the word is uncountable.static StringReturn the itemized version of a word, which is an {@link this#hyphenize hyphenized} version of the word with theitemsuffixstatic StringReturn the pluralized version of a word.static StringReturn the pluralized version of a word.static Stringsingularize(String word) Return the singularized version of a word.static Stringsingularize(String word, boolean considerUncountable) Return the singularized version of a word.Methods inherited from class org.mule.runtime.api.util.NameUtils
hyphenize, sanitizeName, sanitizeName, titleize, toCamelCase, underscorize
-
Field Details
-
CONFIGURATION
- See Also:
-
OPERATION
- See Also:
-
CONNECTION_PROVIDER
- See Also:
-
SOURCE
- See Also:
-
SOURCE_CALLBACK
- See Also:
-
FUNCTION
- See Also:
-
CONSTRUCT
- See Also:
-
NESTABLE_COMPONENT
- See Also:
-
-
Method Details
-
pluralize
Return the pluralized version of a word.- Parameters:
word- The word- Returns:
- The pluralized word
-
pluralize
Return the pluralized version of a word.- Parameters:
word- The wordconsiderUncountable- if it should consider that the word may be uncountable- Returns:
- The pluralized word
-
singularize
Return the singularized version of a word.- Parameters:
word- The word- Returns:
- The singularized word
-
singularize
Return the singularized version of a word.- Parameters:
word- The wordconsiderUncountable- if it should consider that the word may be uncountable- Returns:
- The singularized word
-
itemize
Return the itemized version of a word, which is an {@link this#hyphenize hyphenized} version of the word with theitemsuffix- Parameters:
word- The word- Returns:
- The singularized word
-
isUncountable
Return true if the word is uncountable.- Parameters:
word- The word- Returns:
- True if it is uncountable
-
getTopLevelTypeName
Returns a hypenized name of the give top levelmetadataType.This method will look for the
TypeAliasAnnotationof theMetadataTypeto get the type simple name.As a fallback, it uses
ClassInformationAnnotation.getClassname()to obtain the simple name of the class. Finally if there is no ClassInformation, theTypeIdAnnotationwill be used as Alias, failing if it is not found.- Parameters:
metadataType- theMetadataTypewhich name you want- Returns:
- the hypenized name for the given
type
-
getAliasName
This method will look for theTypeAliasAnnotationof theMetadataTypeto get the type simple name.As a fallback, it uses
ClassInformationAnnotation.getClassname()to obtain the simple name of the class. Finally if there is no ClassInformation, theTypeIdAnnotationwill be used as Alias, failing if it is not found.- Parameters:
metadataType- theMetadataTypewhose Alias is required- Returns:
- the alias of the given type
-
getAliasName
Deprecated.since 1.5.0 useJavaParserUtils.getAlias(Class)instead -
getAliasName
Deprecated.since 1.5.0 useTypeUtils.getAlias(Field)instead -
getAliasName
-
defaultNamespace
-
getComponentModelTypeName
public static String getComponentModelTypeName(org.mule.runtime.api.meta.model.parameter.ParameterizedModel component) -
getDeclarationTypeName
public static String getDeclarationTypeName(org.mule.runtime.api.meta.model.declaration.fluent.ParameterizedDeclaration declaration) -
getComponentDeclarationTypeName
public static String getComponentDeclarationTypeName(org.mule.runtime.api.meta.model.declaration.fluent.BaseDeclaration declaration) -
getModelName
-
alphaSortDescribedList
public static <T extends org.mule.runtime.api.meta.NamedObject> List<T> alphaSortDescribedList(List<T> list) Sorts the givenlistin ascending alphabetic order, usingNamedObject.getName()as the sorting criteria- Type Parameters:
T- the generic type of the items in thelist- Parameters:
list- aListwith instances ofNamedObject- Returns:
- the sorted
list
-
JavaParserUtils.getAlias(Class)instead