Interface MessageTarget
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringConstant specifying a message target parameter, referring to the CQN of an event context. -
Method Summary
Modifier and TypeMethodDescriptionstatic MessageTargetcreate(com.sap.cds.ql.cqn.Path path, com.sap.cds.reflect.CdsElement element) static <E extends com.sap.cds.ql.StructuredType<E>>
MessageTargetCreates aMessageTargetbased on a CQN path.static MessageTargetCreates a string-basedMessageTarget.static MessageTargetCreates aMessageTargetbased on a parameter and aCqnReferencestatic <E extends com.sap.cds.ql.StructuredType<E>>
MessageTargetCreates aMessageTargetbased on a parameter and a CQN path.static MessageTargetCreates aMessageTargetbased on a parameter and a CQN path.static MessageTargetCreates aMessageTargetbased on a CQN path.com.sap.cds.ql.cqn.CqnReferencegetRef()
-
Field Details
-
PARAMETER_CQN
Constant specifying a message target parameter, referring to the CQN of an event context.This is used to decide whether a binding parameter is required for the message target output.
- See Also:
-
-
Method Details
-
create
Creates a string-basedMessageTarget. No further processing of the string is performed.- Parameters:
target- the string-based target- Returns:
- The created
MessageTarget
-
create
Creates aMessageTargetbased on a CQN path.The path is interpreted relative to the CQN statement, which was determined from the request. For CRUD events this CQN statement points to the targeted entity. For bound actions or functions this CQN statement points to the bound entity.
Is equivalent to calling
create(MessageTarget.PARAMETER_CQN, path)- Parameters:
path- the path to the target element or association- Returns:
- The created
MessageTarget
-
create
static MessageTarget create(String parameter, Function<com.sap.cds.ql.StructuredType<?>, Object> path) Creates aMessageTargetbased on a parameter and a CQN path.- Parameters:
parameter- target parameter serving as the entry point for the path resolution. PassingPARAMETER_CQNindicates that the path should be interpreted relatively to the target entity of the request. Alternatively you can pass names of action or function parameters.path- the path to the target element or association- Returns:
- The created
MessageTarget
-
create
static <E extends com.sap.cds.ql.StructuredType<E>> MessageTarget create(Class<E> type, Function<E, Object> path) Creates aMessageTargetbased on a CQN path. This method allows to build the path in a type-safe way, by passing the corresponding entity or structured type interface.The path is interpreted relative to the CQN statement, which was determined from the request. For CRUD events this CQN statement points to the targeted entity. For bound actions or functions this CQN statement points to the bound entity.
Is equivalent to calling
create(MessageTarget.PARAMETER_CQN, type, path)- Type Parameters:
E- the type of the root- Parameters:
type- the root type of the path. Either an entity or a structured type.path- the path to the target element or association- Returns:
- The created
MessageTarget
-
create
static <E extends com.sap.cds.ql.StructuredType<E>> MessageTarget create(String parameter, Class<E> type, Function<E, Object> path) Creates aMessageTargetbased on a parameter and a CQN path. This method allows to build the path in a type-safe way, by passing the corresponding entity or structured type interface.- Type Parameters:
E- the type of the root- Parameters:
parameter- target parameter serving as the entry point for the path resolution. PassingPARAMETER_CQNindicates that the path should be interpreted relatively to the target entity of the request. Alternatively you can pass names of action or function parameters.type- the root type of the path. Either an entity or a structured type.path- the path to the target element or association- Returns:
- The created
MessageTarget
-
create
Creates aMessageTargetbased on aPathand aCdsElement.The path is interpreted relative to the CQN statement, which was determined from the request. For CRUD events this CQN statement points to the targeted entity. For bound actions or functions this CQN statement points to the bound entity.
This method can be used with the
CdsDataProcessorand its functional interfaces.- Parameters:
path- the pathelement- the target element or association- Returns:
- The created
MessageTarget
-
create
Creates aMessageTargetbased on a parameter and aCqnReference- Parameters:
parameter- target parameter serving as the entry point for the path resolution. PassingPARAMETER_CQNindicates that the path should be interpreted relatively to the target entity of the request. Alternatively you can pass names of action or function parameters.ref- The reference to the target element or association- Returns:
- The created
MessageTarget
-
getRef
com.sap.cds.ql.cqn.CqnReference getRef()- Returns:
- the CQN reference of the message target
-
getParameter
String getParameter()- Returns:
- (target) parameter of the message target
-