Class DefaultNamingStrategy

  • All Implemented Interfaces:
    NamingStrategy

    public class DefaultNamingStrategy
    extends Object
    implements NamingStrategy
    Default implementation of naming strategy respecting.
    • Method Detail

      • getExceptionName

        public String getExceptionName​(String errorShapeName)
        Specified by:
        getExceptionName in interface NamingStrategy
        Parameters:
        errorShapeName - Name of error shape to derive exception class name from.
        Returns:
        Appropriate name to use for a Java exception class name
      • getRequestClassName

        public String getRequestClassName​(String operationName)
        Specified by:
        getRequestClassName in interface NamingStrategy
        Parameters:
        operationName - Name of operation used to derive request class name.
        Returns:
        Appropriate name to use for the Java class representing the request shape.
      • getResponseClassName

        public String getResponseClassName​(String operationName)
        Specified by:
        getResponseClassName in interface NamingStrategy
        Parameters:
        operationName - Name of operation used to derive response class name.
        Returns:
        Appropriate name to use for the Java class representing the response shape.
      • getVariableName

        public String getVariableName​(String name)
        Specified by:
        getVariableName in interface NamingStrategy
        Parameters:
        name - Some contextual name to derive variable name from (i.e. member name, java class name, etc).
        Returns:
        Appropriate name to use for a Java variable or field.
      • getEnumValueName

        public String getEnumValueName​(String enumValue)
        Specified by:
        getEnumValueName in interface NamingStrategy
        Parameters:
        enumValue - Enum value as defined in the service model used to derive the java name.
        Returns:
        Appropriate name to use for a Java enum value
      • getShapeClassName

        public String getShapeClassName​(String shapeName)
        Specified by:
        getShapeClassName in interface NamingStrategy
        Parameters:
        shapeName - Name of structure used to derive Java class name.
        Returns:
        Appropriate name to use for a Java class for an arbitrary (not a request, response, error) structure.
      • getFluentGetterMethodName

        public String getFluentGetterMethodName​(String memberName,
                                                Shape parentShape,
                                                Shape shape)
        Specified by:
        getFluentGetterMethodName in interface NamingStrategy
        Parameters:
        memberName - Member name to name getter for.
        shape - The shape associated with the member.
        Returns:
        Name of the getter method for a model class member.
      • getFluentEnumGetterMethodName

        public String getFluentEnumGetterMethodName​(String memberName,
                                                    Shape parentShape,
                                                    Shape shape)
        Specified by:
        getFluentEnumGetterMethodName in interface NamingStrategy
        Parameters:
        memberName - The full member to get the name for.
        shape - The shape associated with the member.
        Returns:
        Name of the getter method for an enum model class member.
      • getExistenceCheckMethodName

        public String getExistenceCheckMethodName​(String memberName,
                                                  Shape parentShape)
        Description copied from interface: NamingStrategy
        Names a method that would check for existence of the member in the response.
        Specified by:
        getExistenceCheckMethodName in interface NamingStrategy
        Parameters:
        memberName - The member name to get the method name for.
        parentShape - The shape containing the member.
        Returns:
        Name of an existence check method.
      • getBeanStyleGetterMethodName

        public String getBeanStyleGetterMethodName​(String memberName,
                                                   Shape parentShape,
                                                   Shape c2jShape)
        Specified by:
        getBeanStyleGetterMethodName in interface NamingStrategy
        Parameters:
        memberName - Member name to name getter for.
        Returns:
        Name of the JavaBean getter method for model class member.
      • getBeanStyleSetterMethodName

        public String getBeanStyleSetterMethodName​(String memberName,
                                                   Shape parentShape,
                                                   Shape c2jShape)
        Specified by:
        getBeanStyleSetterMethodName in interface NamingStrategy
        Parameters:
        memberName - Member name to name setter for.
        Returns:
        Name of the JavaBean setter method for model class member.
      • getFluentSetterMethodName

        public String getFluentSetterMethodName​(String memberName,
                                                Shape parentShape,
                                                Shape shape)
        Specified by:
        getFluentSetterMethodName in interface NamingStrategy
        Parameters:
        memberName - Member name to name fluent setter for.
        Returns:
        Appropriate name to use for fluent setter method (i.e. withFoo) for a model class member.
      • getFluentEnumSetterMethodName

        public String getFluentEnumSetterMethodName​(String memberName,
                                                    Shape parentShape,
                                                    Shape shape)
        Specified by:
        getFluentEnumSetterMethodName in interface NamingStrategy
        Parameters:
        memberName - The full member to get the name for.
        shape - The shape associated with the member.
        Returns:
        Name of the getter method for an enum model class member.
      • getUnionEnumTypeName

        public String getUnionEnumTypeName​(MemberModel memberModel)
        Description copied from interface: NamingStrategy
        Returns the name of the provided member as if it will be included in an enum (as in, when the parent shape is a union and we need to create an enum with each member name in it).
        Specified by:
        getUnionEnumTypeName in interface NamingStrategy
        Parameters:
        memberModel - Member to generate the union enum type name for.