Class Utils
java.lang.Object
software.amazon.awssdk.codegen.internal.Utils
-
Method Summary
Modifier and TypeMethodDescriptionstatic Stringcapitalize(String name) static voidcloseQuietly(Closeable closeable) static voidcreateDirectory(File dir) static FilecreateDirectory(String path) static FilecreateFile(String dir, String fileName) static ShapeMarshallercreateInputShapeMarshaller(ServiceMetadata service, Operation operation) Create the ShapeMarshaller to the input shape from the specified Operation.static ShapeMarshallercreateSyntheticInputShapeMarshaller(ServiceMetadata service, Operation operation) Create the ShapeMarshaller to the input shape from the specified Operation.static StringdirectoryToPackage(String directoryPath) Converts a directory to a Java package name.static ShapeModelfindMemberShapeModelByC2jNameIfExists(IntermediateModel intermediateModel, String shapeC2jName) Search for a shape model by its C2J name, excluding request and response shapes, which are not candidates to be members of another shape.static ShapeModelfindShapeModelByC2jName(IntermediateModel intermediateModel, String shapeC2jName) Search for intermediate shape model by its c2j name.static ShapeModelfindShapeModelByC2jNameIfExists(IntermediateModel intermediateModel, String shapeC2jName) Search for intermediate shape model by its c2j name.static List<ShapeModel> findShapesByC2jName(IntermediateModel intermediateModel, String shapeC2jName) static StringgetDefaultEndpointWithoutHttpProtocol(String endpoint) static StringgetFileNamePrefix(ServiceModel serviceModel) * @param serviceModel Service model to get prefix for.static InputStreamgetRequiredResourceAsStream(Class<?> clzz, String location) Return an InputStream of the specified resource, failing if it can't be found.static booleanisEnumShape(Shape shape) static booleanisExceptionShape(Shape shape) static booleanisListShape(Shape shape) static booleanisListWithEnumShape(MemberModel member) static booleanisMapKeyWithEnumShape(MapModel mapModel) static booleanisMapShape(Shape shape) static booleanisMapValueWithEnumShape(MapModel mapModel) static booleanisMapWithEnumShape(MemberModel member) static booleanisNullOrEmpty(String str) static booleanisOrContainsEnum(MemberModel member) static booleanisOrContainsEnumShape(Shape shape, Map<String, Shape> allShapes) static booleanstatic booleanisStructure(Shape shape) static StringpackageToDirectory(String packageName) Converts a Java package name to a directory.static StringremoveLeading(String str, String toRemove) static StringremoveTrailing(String str, String toRemove) static StringunCapitalize(String name)
-
Method Details
-
isScalar
-
isStructure
-
isListShape
-
isMapShape
-
isEnumShape
-
isExceptionShape
-
isOrContainsEnumShape
-
isOrContainsEnum
-
isListWithEnumShape
-
isMapWithEnumShape
-
isMapKeyWithEnumShape
-
isMapValueWithEnumShape
-
unCapitalize
-
capitalize
-
removeLeading
-
removeTrailing
-
getFileNamePrefix
* @param serviceModel Service model to get prefix for. * @return Prefix to use when writing model files (service and intermediate). -
directoryToPackage
-
packageToDirectory
-
getDefaultEndpointWithoutHttpProtocol
-
createDirectory
-
createDirectory
-
createFile
- Throws:
IOException
-
isNullOrEmpty
-
closeQuietly
-
getRequiredResourceAsStream
Return an InputStream of the specified resource, failing if it can't be found.- Parameters:
location- Location of resource
-
findShapeModelByC2jName
public static ShapeModel findShapeModelByC2jName(IntermediateModel intermediateModel, String shapeC2jName) throws IllegalArgumentException Search for intermediate shape model by its c2j name.- Returns:
- ShapeModel
- Throws:
IllegalArgumentException- if the specified c2j name is not found in the intermediate model.
-
findShapeModelByC2jNameIfExists
public static ShapeModel findShapeModelByC2jNameIfExists(IntermediateModel intermediateModel, String shapeC2jName) Search for intermediate shape model by its c2j name.- Returns:
- ShapeModel or null if the shape doesn't exist (if it's primitive or container type for example)
-
findMemberShapeModelByC2jNameIfExists
public static ShapeModel findMemberShapeModelByC2jNameIfExists(IntermediateModel intermediateModel, String shapeC2jName) Search for a shape model by its C2J name, excluding request and response shapes, which are not candidates to be members of another shape.- Returns:
- ShapeModel or null if the shape doesn't exist (if it's primitive or container type for example)
-
findShapesByC2jName
public static List<ShapeModel> findShapesByC2jName(IntermediateModel intermediateModel, String shapeC2jName) -
createInputShapeMarshaller
public static ShapeMarshaller createInputShapeMarshaller(ServiceMetadata service, Operation operation) Create the ShapeMarshaller to the input shape from the specified Operation. The input shape in the operation could be empty. -
createSyntheticInputShapeMarshaller
public static ShapeMarshaller createSyntheticInputShapeMarshaller(ServiceMetadata service, Operation operation) Create the ShapeMarshaller to the input shape from the specified Operation. The input shape in the operation could be empty.
-