public Template getShapeTemplate(ShapeModel shape) throws IOException {
        switch (shape.getShapeType()) {
        case Request:
            return getRequestClassTemplate();
        case Response:
            return getResponseClassTemplate();
        case Model:
            return getModelClassTemplate();
        case Enum:
            return getModelEnumTemplate();
        case Exception:
            return getExceptionClassTemplate();
        default:
            throw new RuntimeException(
                    "Unable to determine template for shape "
                            + shape.getShapeName());
        }
    }
Util class that sets up the freemarker configuration and loads the templates.
aws-java-sdk-code-generator/src/main/java/com/amazonaws/codegen/internal/Freemarker.java