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.palantir.javapoet.TypeSpec.Builder builder, com.palantir.javapoet.ClassName entity, Map<String,com.palantir.javapoet.ParameterSpec> parameters)
     
    static void
    addStaticFactoryMethods(com.palantir.javapoet.TypeSpec.Builder builder, com.palantir.javapoet.TypeName returnType, com.palantir.javapoet.TypeSpec.Builder... anonymousbuilder)
     
    static Stream<com.sap.cds.reflect.CdsElement>
    getAnonymousElements(com.sap.cds.reflect.CdsElement element)
     
    static com.palantir.javapoet.TypeName
    getArrayTypeName(com.palantir.javapoet.TypeName javaType)
     
    static com.palantir.javapoet.TypeName
    getAttributeType(com.palantir.javapoet.ClassName parent, com.sap.cds.reflect.CdsType type, Configuration cfg)
     
    static List<com.sap.cds.reflect.CdsElement>
    getManagedToOneFks(com.sap.cds.reflect.CdsElement attribute)
     
    static com.palantir.javapoet.TypeName
    getOperationResultType(com.sap.cds.reflect.CdsEntity boundTo, com.sap.cds.reflect.CdsOperation operation, com.sap.cds.reflect.CdsType returnType, Configuration config)
     
    static com.palantir.javapoet.TypeName
    getReturnType(com.palantir.javapoet.ClassName parent, 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 boolean
    isIgnored(com.sap.cds.reflect.CdsAnnotatable def)
    Checks whether the given CdsAnnotatable is to be ignored by the code generation.
    static com.palantir.javapoet.ParameterizedTypeName
    listOf(com.palantir.javapoet.TypeName type)
     
    static void
    logWarningForManyToManyWithStructElement(com.sap.cds.reflect.CdsModel model, com.sap.cds.reflect.CdsStructuredType struct)
     
    static void
    writeType(String packageName, com.palantir.javapoet.TypeSpec typeSpec, GeneratedFile.Consumer consumer)
     

    Methods inherited from class java.lang.Object

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

    • getAttributeType

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

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

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

      public static com.palantir.javapoet.ParameterizedTypeName listOf(com.palantir.javapoet.TypeName type)
    • 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)
    • addStaticFactoryMethods

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

      public static void addStaticCreateForKeys(com.palantir.javapoet.TypeSpec.Builder builder, com.palantir.javapoet.ClassName entity, Map<String,com.palantir.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)
    • getArrayTypeName

      public static com.palantir.javapoet.TypeName getArrayTypeName(com.palantir.javapoet.TypeName javaType)
    • writeType

      public static void writeType(String packageName, com.palantir.javapoet.TypeSpec typeSpec, GeneratedFile.Consumer consumer)
    • isIgnored

      public static boolean isIgnored(com.sap.cds.reflect.CdsAnnotatable def)
      Checks whether the given CdsAnnotatable is to be ignored by the code generation.
      Parameters:
      def - the cds definition
      Returns:
      true if to be ignored by the code gen, false otherwise