public class Utils extends Object
Constructor and Description |
---|
Utils() |
Modifier and Type | Method and Description |
---|---|
static String |
capitialize(String name) |
static void |
closeQuietly(Closeable closeable) |
static void |
createDirectory(File dir) |
static File |
createDirectory(String path) |
static File |
createFile(String dir,
String fileName) |
static ShapeMarshaller |
createInputShapeMarshaller(ServiceMetadata service,
Operation operation)
Create the ShapeMarshaller to the input shape from the specified Operation.
|
static String |
directoryToPackage(String directoryPath)
Converts a directory to a Java package name.
|
static ShapeModel |
findShapeModelByC2jName(IntermediateModel intermediateModel,
String shapeC2jName)
Search for intermediate shape model by its c2j name.
|
static ShapeModel |
findShapeModelByC2jNameIfExists(IntermediateModel intermediateModel,
String shapeC2jName)
Search for intermediate shape model by its c2j name.
|
static String |
getAuthPolicyPackageName(String serviceName,
CustomizationConfig customizationConfig) |
static String |
getClientPackageName(String serviceName,
CustomizationConfig customizationConfig) |
static String |
getDefaultEndpointWithoutHttpProtocol(String endpoint) |
static String |
getFileNamePrefix(ServiceModel serviceModel)
* @param serviceModel Service model to get prefix for.
|
static String |
getModelPackageName(String serviceName,
CustomizationConfig customizationConfig) |
static String |
getRequestTransformPackageName(String serviceName,
CustomizationConfig customizationConfig) |
static InputStream |
getRequiredResourceAsStream(Class<?> clzz,
String location)
Return an InputStream of the specified resource, failing if it can't be found.
|
static String |
getServiceName(ServiceMetadata metadata,
CustomizationConfig customizationConfig) |
static String |
getSmokeTestPackageName(String serviceName,
CustomizationConfig customizationConfig) |
static String |
getTransformPackageName(String serviceName,
CustomizationConfig customizationConfig) |
static String |
getWaitersPackageName(String serviceName,
CustomizationConfig customizationConfig) |
static boolean |
isEnumShape(Shape shape) |
static boolean |
isExceptionShape(Shape shape) |
static boolean |
isListShape(Shape shape) |
static boolean |
isMapShape(Shape shape) |
static boolean |
isNullOrEmpty(String str) |
static boolean |
isScalar(Shape shape) |
static boolean |
isStructure(Shape shape) |
static String |
packageToDirectory(String packageName)
Converts a Java package name to a directory.
|
static String |
pascalCase(String baseName) |
static String |
unCapitialize(String name) |
public static boolean isScalar(Shape shape)
public static boolean isStructure(Shape shape)
public static boolean isListShape(Shape shape)
public static boolean isMapShape(Shape shape)
public static boolean isEnumShape(Shape shape)
public static boolean isExceptionShape(Shape shape)
public static String getServiceName(ServiceMetadata metadata, CustomizationConfig customizationConfig)
public static String getClientPackageName(String serviceName, CustomizationConfig customizationConfig)
public static String getModelPackageName(String serviceName, CustomizationConfig customizationConfig)
public static String getTransformPackageName(String serviceName, CustomizationConfig customizationConfig)
public static String getRequestTransformPackageName(String serviceName, CustomizationConfig customizationConfig)
public static String getWaitersPackageName(String serviceName, CustomizationConfig customizationConfig)
public static String getSmokeTestPackageName(String serviceName, CustomizationConfig customizationConfig)
public static String getAuthPolicyPackageName(String serviceName, CustomizationConfig customizationConfig)
public static String getFileNamePrefix(ServiceModel serviceModel)
public static String directoryToPackage(String directoryPath)
directoryPath
- Directory to convert.public static String packageToDirectory(String packageName)
packageName
- Java package to convert.public static String getDefaultEndpointWithoutHttpProtocol(String endpoint)
public static void createDirectory(File dir)
public static File createFile(String dir, String fileName) throws IOException
IOException
public static boolean isNullOrEmpty(String str)
public static void closeQuietly(Closeable closeable)
public static InputStream getRequiredResourceAsStream(Class<?> clzz, String location)
location
- Location of resourcepublic static ShapeModel findShapeModelByC2jName(IntermediateModel intermediateModel, String shapeC2jName) throws IllegalArgumentException
IllegalArgumentException
- if the specified c2j name is not found in the intermediate model.public static ShapeModel findShapeModelByC2jNameIfExists(IntermediateModel intermediateModel, String shapeC2jName)
public static ShapeMarshaller createInputShapeMarshaller(ServiceMetadata service, Operation operation)
Copyright © 2017. All rights reserved.