public class CdsModelUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static 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.AnalysisResult |
getEntityPath(com.sap.cds.ql.cqn.CqnSelect select,
com.sap.cds.reflect.CdsModel model) |
static com.sap.cds.ql.cqn.AnalysisResult |
getEntityPath(com.sap.cds.ql.cqn.CqnStructuredTypeRef ref,
com.sap.cds.reflect.CdsModel model) |
static List<String> |
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 is restricted in general.
|
static com.sap.cds.reflect.CdsEntity |
getRefTarget(com.sap.cds.ql.cqn.CqnStructuredTypeRef ref,
com.sap.cds.reflect.CdsEntity target) |
static Restriction |
getRestrictionOrNull(com.sap.cds.reflect.CdsAnnotatable cdsModelElement)
Returns a
Restriction instance reflecting @restrict resp. |
static com.sap.cds.reflect.CdsEntity |
getTargetEntity(com.sap.cds.ql.cqn.CqnSelect select,
com.sap.cds.reflect.CdsModel model) |
static com.sap.cds.reflect.CdsEntity |
getTargetEntity(com.sap.cds.ql.cqn.CqnStructuredTypeRef ref,
com.sap.cds.reflect.CdsModel model) |
static String |
getTargetKeysAsString(com.sap.cds.reflect.CdsModel model,
com.sap.cds.ql.cqn.CqnStatement statement) |
static boolean |
isChildEntity(com.sap.cds.ql.cqn.CqnStructuredTypeRef ref,
com.sap.cds.reflect.CdsModel model) |
static boolean |
isPublic(com.sap.cds.reflect.CdsAnnotatable cdsModelElement)
Returns
true if the passed model element (either service or entity) has no effective restriction. |
public static Restriction getRestrictionOrNull(com.sap.cds.reflect.CdsAnnotatable cdsModelElement)
Restriction instance reflecting @restrict resp. @requires on the given service or null
if not annotated.cdsModelElement - The CDS model element to be inspectedRestriction instancepublic static boolean isPublic(com.sap.cds.reflect.CdsAnnotatable cdsModelElement)
true if the passed model element (either service or entity) has no effective restriction.
Please note that this does not include hierarchical dependencies.cdsModelElement - The element from the CDS modeltrue if publicpublic static List<String> getPublicEvents(com.sap.cds.reflect.CdsAnnotatable cdsModelElement)
cdsModelElement - The CDS model elementpublic static com.sap.cds.ql.cqn.AnalysisResult getEntityPath(com.sap.cds.ql.cqn.CqnStructuredTypeRef ref,
com.sap.cds.reflect.CdsModel model)
public static boolean isChildEntity(com.sap.cds.ql.cqn.CqnStructuredTypeRef ref,
com.sap.cds.reflect.CdsModel model)
public static com.sap.cds.reflect.CdsEntity getTargetEntity(com.sap.cds.ql.cqn.CqnSelect select,
com.sap.cds.reflect.CdsModel model)
public static com.sap.cds.reflect.CdsEntity getTargetEntity(com.sap.cds.ql.cqn.CqnStructuredTypeRef ref,
com.sap.cds.reflect.CdsModel model)
public static com.sap.cds.ql.cqn.AnalysisResult getEntityPath(com.sap.cds.ql.cqn.CqnSelect select,
com.sap.cds.reflect.CdsModel model)
public static com.sap.cds.reflect.CdsEntity getRefTarget(com.sap.cds.ql.cqn.CqnStructuredTypeRef ref,
com.sap.cds.reflect.CdsEntity target)
public static String getTargetKeysAsString(com.sap.cds.reflect.CdsModel model, com.sap.cds.ql.cqn.CqnStatement statement)
public static Optional<com.sap.cds.reflect.CdsFunction> findFunction(com.sap.cds.reflect.CdsService service, com.sap.cds.reflect.CdsEntity entity, String name)
Copyright © 2021. All rights reserved.