Package com.sap.cds.services.utils.model
Class CdsModelUtils
java.lang.Object
com.sap.cds.services.utils.model.CdsModelUtils
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Optional<com.sap.cds.reflect.CdsAction>findAction(com.sap.cds.reflect.CdsService service, com.sap.cds.reflect.CdsEntity entity, String name) static Optional<com.sap.cds.reflect.CdsFunction>findFunction(com.sap.cds.reflect.CdsService service, com.sap.cds.reflect.CdsEntity entity, String name) static com.sap.cds.ql.cqn.AnalysisResultgetEntityPath(com.sap.cds.ql.cqn.CqnSelect select, com.sap.cds.reflect.CdsModel model) static com.sap.cds.ql.cqn.AnalysisResultgetEntityPath(com.sap.cds.ql.cqn.CqnStructuredTypeRef ref, com.sap.cds.reflect.CdsModel model) getPublicEvents(com.sap.cds.reflect.CdsAnnotatable cdsModelElement) Returns a list of all events that are not restricted for the given model element, although the element itself might be restricted in general.static com.sap.cds.reflect.CdsEntitygetRefTarget(com.sap.cds.ql.cqn.CqnStructuredTypeRef ref, com.sap.cds.reflect.CdsEntity target) static RestrictiongetRestrictionOrNull(com.sap.cds.reflect.CdsAnnotatable cdsModelElement) Returns aRestrictioninstance reflecting @restrict resp.static com.sap.cds.reflect.CdsEntitygetTargetEntity(com.sap.cds.ql.cqn.CqnSelect select, com.sap.cds.reflect.CdsModel model) static com.sap.cds.reflect.CdsEntitygetTargetEntity(com.sap.cds.ql.cqn.CqnStructuredTypeRef ref, com.sap.cds.reflect.CdsModel model) static StringgetTargetKeysAsString(com.sap.cds.reflect.CdsModel model, com.sap.cds.ql.cqn.CqnStatement statement) static booleanisChildEntity(com.sap.cds.ql.cqn.CqnStructuredTypeRef ref, com.sap.cds.reflect.CdsModel model) isPublic(com.sap.cds.reflect.CdsAnnotatable cdsModelElement) Returnstrueif the passed model element (either service or entity) has no effective restriction.
-
Field Details
-
$USER
- See Also:
-
-
Constructor Details
-
CdsModelUtils
-
-
Method Details
-
isPublic
Returnstrueif the passed model element (either service or entity) has no effective restriction. Please note that this does not include hierarchical dependencies.- Parameters:
cdsModelElement- The element from the CDS model- Returns:
trueif public
-
getPublicEvents
Returns a list of all events that are not restricted for the given model element, although the element itself might be restricted in general.- Parameters:
cdsModelElement- The CDS model element- Returns:
- The list of public events
-
getRestrictionOrNull
Returns aRestrictioninstance reflecting @restrict resp. @requires on the given service ornullif not annotated.- Parameters:
cdsModelElement- The CDS model element to be inspected- Returns:
- The
Restrictioninstance
-
getEntityPath
public static com.sap.cds.ql.cqn.AnalysisResult getEntityPath(com.sap.cds.ql.cqn.CqnStructuredTypeRef ref, com.sap.cds.reflect.CdsModel model) -
isChildEntity
public static boolean isChildEntity(com.sap.cds.ql.cqn.CqnStructuredTypeRef ref, com.sap.cds.reflect.CdsModel model) -
getTargetEntity
public static com.sap.cds.reflect.CdsEntity getTargetEntity(com.sap.cds.ql.cqn.CqnSelect select, com.sap.cds.reflect.CdsModel model) -
getTargetEntity
public static com.sap.cds.reflect.CdsEntity getTargetEntity(com.sap.cds.ql.cqn.CqnStructuredTypeRef ref, com.sap.cds.reflect.CdsModel model) -
getEntityPath
public static com.sap.cds.ql.cqn.AnalysisResult getEntityPath(com.sap.cds.ql.cqn.CqnSelect select, com.sap.cds.reflect.CdsModel model) -
getRefTarget
public static com.sap.cds.reflect.CdsEntity getRefTarget(com.sap.cds.ql.cqn.CqnStructuredTypeRef ref, com.sap.cds.reflect.CdsEntity target) -
getTargetKeysAsString
public static String getTargetKeysAsString(com.sap.cds.reflect.CdsModel model, com.sap.cds.ql.cqn.CqnStatement statement) -
findFunction
-
findAction
-