Package com.sap.cds.generator.util
Class TypeUtils
java.lang.Object
com.sap.cds.generator.util.TypeUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddStaticCreateForKeys(com.palantir.javapoet.TypeSpec.Builder builder, com.palantir.javapoet.ClassName entity, Map<String, com.palantir.javapoet.ParameterSpec> parameters) static voidaddStaticFactoryMethods(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.TypeNamegetArrayTypeName(com.palantir.javapoet.TypeName javaType) static com.palantir.javapoet.TypeNamegetAttributeType(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.TypeNamegetOperationResultType(com.sap.cds.reflect.CdsEntity boundTo, com.sap.cds.reflect.CdsOperation operation, com.sap.cds.reflect.CdsType returnType, Configuration config) static com.palantir.javapoet.TypeNamegetReturnType(com.palantir.javapoet.ClassName parent, com.sap.cds.reflect.CdsElement attribute, Configuration cfg) static booleanisAnonymousAspect(com.sap.cds.reflect.CdsElement element) static booleanisAnonymousType(com.sap.cds.reflect.CdsType type) static booleanisAnonymousType(com.sap.cds.reflect.CdsType type, Configuration config) static booleanisIgnored(com.sap.cds.reflect.CdsAnnotatable def) Checks whether the givenCdsAnnotatableis to be ignored by the code generation.static com.palantir.javapoet.ParameterizedTypeNamelistOf(com.palantir.javapoet.TypeName type) static voidlogWarningForManyToManyWithStructElement(com.sap.cds.reflect.CdsModel model, com.sap.cds.reflect.CdsStructuredType struct) static voidwriteType(String packageName, com.palantir.javapoet.TypeSpec typeSpec, GeneratedFile.Consumer consumer)
-
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
-
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
-
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 givenCdsAnnotatableis to be ignored by the code generation.- Parameters:
def- the cds definition- Returns:
- true if to be ignored by the code gen, false otherwise
-