Class TypeUtils

java.lang.Object
com.sap.cds.generator.util.TypeUtils

public class TypeUtils extends Object
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    addStaticCreateForKeys(com.squareup.javapoet.TypeSpec.Builder builder, com.sap.cds.reflect.CdsEntity entity, Map<String,com.squareup.javapoet.ParameterSpec> parameters)
     
    static void
    addStaticMethod(com.squareup.javapoet.TypeSpec.Builder builder, com.squareup.javapoet.TypeName returnType, com.squareup.javapoet.TypeSpec.Builder... anonymousbuilder)
     
    static com.squareup.javapoet.ClassName
    builderClassName(com.sap.cds.reflect.CdsDefinition def)
     
    static com.squareup.javapoet.ClassName
     
    static com.squareup.javapoet.ClassName
    eventContextClassName(com.sap.cds.reflect.CdsDefinition def, com.sap.cds.reflect.CdsEntity boundEntity, Configuration cfg)
    Returns the full qualified event context class name for the given CDS definition.
    static Stream<com.sap.cds.reflect.CdsElement>
    getAnonymousElements(com.sap.cds.reflect.CdsElement element)
     
    static com.squareup.javapoet.TypeName
    getAttributeType(com.sap.cds.reflect.CdsType type, Configuration cfg)
     
    static List<com.sap.cds.reflect.CdsElement>
    getManagedToOneFks(com.sap.cds.reflect.CdsElement attribute)
     
    static com.squareup.javapoet.TypeName
    getOperationResultType(com.sap.cds.reflect.CdsEntity boundTo, com.sap.cds.reflect.CdsOperation operation, com.sap.cds.reflect.CdsType returnType, NamesUtils namesUtils, Configuration config)
     
    static com.squareup.javapoet.TypeName
    getReturnType(com.sap.cds.reflect.CdsElement attribute, Configuration cfg)
     
    static boolean
    isAnonymousAspect(com.sap.cds.reflect.CdsElement element)
     
    static boolean
    isAnonymousType(com.sap.cds.reflect.CdsType type)
     
    static boolean
    isAnonymousType(com.sap.cds.reflect.CdsType type, Configuration config)
     
    static com.squareup.javapoet.ParameterizedTypeName
    listOf(com.squareup.javapoet.TypeName type)
     
    static void
    logWarningForManyToManyWithStructElement(com.sap.cds.reflect.CdsModel model, com.sap.cds.reflect.CdsStructuredType struct)
     
    static com.squareup.javapoet.ClassName
    typedServiceClassName(com.sap.cds.reflect.CdsService service, Configuration cfg)
    Returns the full qualified typed service class name for the given service definition.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • getAttributeType

      public static com.squareup.javapoet.TypeName getAttributeType(com.sap.cds.reflect.CdsType type, Configuration cfg)
    • getReturnType

      public static com.squareup.javapoet.TypeName getReturnType(com.sap.cds.reflect.CdsElement attribute, Configuration cfg)
    • getOperationResultType

      public static com.squareup.javapoet.TypeName getOperationResultType(com.sap.cds.reflect.CdsEntity boundTo, com.sap.cds.reflect.CdsOperation operation, com.sap.cds.reflect.CdsType returnType, NamesUtils namesUtils, Configuration config)
    • listOf

      public static com.squareup.javapoet.ParameterizedTypeName listOf(com.squareup.javapoet.TypeName type)
    • className

      public static com.squareup.javapoet.ClassName className(String name)
    • builderClassName

      public static com.squareup.javapoet.ClassName builderClassName(com.sap.cds.reflect.CdsDefinition def)
    • isAnonymousAspect

      public static boolean isAnonymousAspect(com.sap.cds.reflect.CdsElement element)
    • isAnonymousType

      public static boolean isAnonymousType(com.sap.cds.reflect.CdsType type, Configuration config)
    • isAnonymousType

      public static boolean isAnonymousType(com.sap.cds.reflect.CdsType type)
    • getAnonymousElements

      public static Stream<com.sap.cds.reflect.CdsElement> getAnonymousElements(com.sap.cds.reflect.CdsElement element)
    • addStaticMethod

      public static void addStaticMethod(com.squareup.javapoet.TypeSpec.Builder builder, com.squareup.javapoet.TypeName returnType, com.squareup.javapoet.TypeSpec.Builder... anonymousbuilder)
    • addStaticCreateForKeys

      public static void addStaticCreateForKeys(com.squareup.javapoet.TypeSpec.Builder builder, com.sap.cds.reflect.CdsEntity entity, Map<String,com.squareup.javapoet.ParameterSpec> parameters)
    • getManagedToOneFks

      public static List<com.sap.cds.reflect.CdsElement> getManagedToOneFks(com.sap.cds.reflect.CdsElement attribute)
    • logWarningForManyToManyWithStructElement

      public static void logWarningForManyToManyWithStructElement(com.sap.cds.reflect.CdsModel model, com.sap.cds.reflect.CdsStructuredType struct)
    • eventContextClassName

      public static com.squareup.javapoet.ClassName eventContextClassName(com.sap.cds.reflect.CdsDefinition def, com.sap.cds.reflect.CdsEntity boundEntity, Configuration cfg)
      Returns the full qualified event context class name for the given CDS definition.
      Parameters:
      def - the CdsDefinition
      boundEntity - an optionally bound entity
      cfg - the generator Configuration
      Returns:
      the full qualified event context ClassName
    • typedServiceClassName

      public static com.squareup.javapoet.ClassName typedServiceClassName(com.sap.cds.reflect.CdsService service, Configuration cfg)
      Returns the full qualified typed service class name for the given service definition.
      Parameters:
      service - the service definition
      cfg - the generator Configuration
      Returns:
      the full qualified typed service ClassName