public class NamingHelper extends Object
| Constructor and Description |
|---|
NamingHelper() |
| Modifier and Type | Method and Description |
|---|---|
static String |
cleanForJavadoc(String input)
Utility method to clean a string for use within javadoc
|
static String |
cleanLeadingAndTrailingNewLineAndChars(String input)
Utility method to clean New Line,Spaces and other highly useless characters found (mainly in javadoc)
|
static String |
convertClassName(Class<?> clazz)
Convert a class name into its restful Resource representation.
|
static String |
convertContentTypeToQualifier(String contentType)
Converts an http contentType into a qualifier that can be used within a Java method
|
static String |
getActionName(RamlResource controllerizedResource,
RamlResource resource,
RamlAction action,
RamlActionType actionType)
Attempts to infer the name of an action (intent) from a resource's relative URL and action details
|
static String |
getDefaultModelPackage()
Returns the default sub package that will be used for model objects used in the Request/Response body
|
static String |
getParameterName(String name)
Converts the name of a parameter into a name suitable for a Java parameter
|
static String |
getResourceName(RamlResource resource,
boolean singularize)
Attempts to infer the name of a resource from a resources's relative URL
|
static String |
getResourceName(String resource,
boolean singularize)
Attempts to infer the name of a resource from a resources's relative URL
|
static boolean |
isUriParamResource(String resource)
Checks if a Resource URI fragment is a URI Parameter.
|
static boolean |
isValidJavaClassName(String input)
Utility method to check if a string can be used as a valid class name
|
static String |
resolveProperties(String inputString)
Attempts to load system propertes from the string or use included defaults if available
|
public static String convertContentTypeToQualifier(String contentType)
contentType - The content type to convert application/jsonpublic static boolean isUriParamResource(String resource)
resource - The Resource key/ relative URLpublic static boolean isValidJavaClassName(String input)
input - String to checkpublic static String cleanForJavadoc(String input)
input - String to be cleanedpublic static String cleanLeadingAndTrailingNewLineAndChars(String input)
input - The string to be cleanedpublic static String convertClassName(Class<?> clazz)
clazz - The Class to namepublic static String resolveProperties(String inputString)
inputString - Strign containing spring property formatpublic static String getResourceName(RamlResource resource, boolean singularize)
resource - The raml resource being parsedsingularize - indicates if the resource name should be singularized or notpublic static String getResourceName(String resource, boolean singularize)
resource - The Url representation of this objectsingularize - indicates if the resource name should be singularized or notpublic static String getParameterName(String name)
name - The name of a RAML query parameter or request headerpublic static String getActionName(RamlResource controllerizedResource, RamlResource resource, RamlAction action, RamlActionType actionType)
controllerizedResource - The resource that is mapped to the root controllerresource - The child resource that will be mapped as a method of the root controlleraction - The RAML action objectactionType - The ActionType/HTTP Verb for this Actionpublic static String getDefaultModelPackage()
Copyright © 2017. All rights reserved.