public interface CdsModel
| Modifier and Type | Interface and Description |
|---|---|
static interface |
CdsModel.Reader |
| Modifier and Type | Field and Description |
|---|---|
static CdsModel.Reader |
reader |
| Modifier and Type | Method and Description |
|---|---|
default void |
accept(CdsVisitor visitor)
Accepts a
CdsVisitor visiting the definitions in this model
(depth-first) |
Stream<CdsAction> |
actions()
Returns a sequential
Stream over all CdsAction definitions in
this model. |
Stream<CdsAnnotation<?>> |
annotations(String namespace)
Returns a sequential
Stream over all CdsAnnotation(s) for the given namespace. |
default Stream<CdsEntity> |
concreteEntities()
Returns a sequential
Stream over all non abstract CdsEntity
definitions in this model. |
Stream<CdsEntity> |
entities()
Returns a sequential
Stream over all CdsEntity definitions in
this model. |
Stream<CdsEvent> |
events()
Returns a sequential
Stream over all CdsEvent definitions in
this model. |
Optional<CdsAction> |
findAction(String qualifiedName)
|
Optional<CdsEntity> |
findEntity(String qualifiedName)
|
Optional<CdsEvent> |
findEvent(String qualifiedName)
|
Optional<CdsFunction> |
findFunction(String qualifiedName)
Returns an
Optional wrapping a CdsFunction. |
Optional<CdsService> |
findService(String qualifiedName)
Returns an
Optional wrapping a CdsService. |
<T extends CdsType> |
findType(String qualifiedName)
|
Stream<CdsFunction> |
functions()
Returns a sequential
Stream over all CdsFunction definitions
in this model. |
CdsAction |
getAction(String qualifiedName)
Get a
CdsAction via its fully qualified name. |
CdsEntity |
getEntity(String qualifiedName)
Get a
CdsEntity via its fully qualified name. |
CdsEvent |
getEvent(String qualifiedName)
Get a
CdsEvent via its fully qualified name. |
CdsFunction |
getFunction(String qualifiedName)
Get a
CdsFunction via its fully qualified name. |
<T> T |
getMeta(String key)
Returns the meta property for the given key.
|
CdsService |
getService(String qualifiedName)
Get a
CdsService via its fully qualified name. |
<T extends CdsType> |
getType(String qualifiedName)
Get a
CdsType via its fully qualified name. |
String |
getVersion()
Returns the CSN version this model was read from.
|
static CdsModel |
read(InputStream csn)
Creates a CDS model from a CSN input stream.
|
static CdsModel |
read(String csn)
Creates a CDS model from a CSN String.
|
Stream<CdsService> |
services()
Returns a sequential
Stream over all CdsService definitions
in this model. |
Stream<CdsType> |
types()
Returns a sequential
Stream over all CdsType definitions in
this model. |
static final CdsModel.Reader reader
static CdsModel read(InputStream csn)
csn - the CSN input streamstatic CdsModel read(String csn)
csn - the CSN input as StringStream<CdsAnnotation<?>> annotations(String namespace)
Stream over all CdsAnnotation(s) for the given namespace.namespace - the namespaceStream over CdsAnnotation(s) for the
given namespaceStream<CdsService> services()
Stream over all CdsService definitions
in this model.Stream over the CdsService definitionsCdsService getService(String qualifiedName)
CdsService via its fully qualified name.qualifiedName - the fully qualified name of the CdsServiceCdsService with the given fully qualified nameCdsDefinitionNotFoundException - if there is no CdsService with
the given nameOptional<CdsService> findService(String qualifiedName)
Optional wrapping a CdsService.qualifiedName - the fully qualified name of the CdsServiceOptional describing the CdsService with the given
qualified name, or an empty Optional if there is no
CdsService with this nameStream<CdsType> types()
Stream over all CdsType definitions in
this model.Stream over the CdsType definitions<T extends CdsType> T getType(String qualifiedName)
CdsType via its fully qualified name.T - the return typequalifiedName - the fully qualified name of the CdsTypeCdsType with the given fully qualified nameCdsDefinitionNotFoundException - if there is no CdsType with
the given name<T extends CdsType> Optional<T> findType(String qualifiedName)
T - the return typequalifiedName - the fully qualified name of the CdsTypeOptional describing the CdsType with the given
qualified name, or an empty Optional if there is no
CdsType with this nameStream<CdsEntity> entities()
Stream over all CdsEntity definitions in
this model.Stream over the CdsEntity definitionsdefault Stream<CdsEntity> concreteEntities()
Stream over all non abstract CdsEntity
definitions in this model.Stream over the non abstract CdsEntity
definitionsCdsEntity getEntity(String qualifiedName)
CdsEntity via its fully qualified name.qualifiedName - the fully qualified name of the CdsEntityCdsEntity with the given fully qualified nameCdsDefinitionNotFoundException - if there is no CdsEntity with
the given nameOptional<CdsEntity> findEntity(String qualifiedName)
qualifiedName - the fully qualified name of the CdsEntityOptional describing the CdsEntity with the given
qualified name, or an empty Optional if there is no
CdsEntity with this nameStream<CdsAction> actions()
Stream over all CdsAction definitions in
this model.Stream over the CdsAction definitionsCdsAction getAction(String qualifiedName)
CdsAction via its fully qualified name.qualifiedName - the fully qualified name of the CdsActionCdsAction with the given fully qualified nameCdsDefinitionNotFoundException - if there is no CdsAction with
the given nameOptional<CdsAction> findAction(String qualifiedName)
qualifiedName - the fully qualified name of the CdsActionOptional describing the CdsAction with the given
qualified name, or an empty Optional if there is no
CdsAction with this nameStream<CdsFunction> functions()
Stream over all CdsFunction definitions
in this model.Stream over the CdsFunction definitionsCdsFunction getFunction(String qualifiedName)
CdsFunction via its fully qualified name.qualifiedName - the fully qualified name of the CdsFunctionCdsFunction with the given fully qualified nameCdsDefinitionNotFoundException - if there is no CdsFunction
with the given nameOptional<CdsFunction> findFunction(String qualifiedName)
Optional wrapping a CdsFunction.qualifiedName - the fully qualified name of the CdsFunctionOptional describing the CdsFunction with the given
qualified name, or an empty Optional if there is no
CdsFunction with this nameStream<CdsEvent> events()
Stream over all CdsEvent definitions in
this model.Stream over the CdsEvent definitionsCdsEvent getEvent(String qualifiedName)
CdsEvent via its fully qualified name.qualifiedName - the fully qualified name of the CdsEventCdsEvent with the given fully qualified nameCdsDefinitionNotFoundException - if there is no CdsEvent with
the given nameOptional<CdsEvent> findEvent(String qualifiedName)
qualifiedName - the fully qualified name of the CdsEventOptional describing the CdsEvent with the given
qualified name, or an empty Optional if there is no
CdsEvent with this name<T> T getMeta(String key)
T - the expected type of the meta propertykey - the qualified name of the meta propertynull if there is no
property with the given keyString getVersion()
default void accept(CdsVisitor visitor)
CdsVisitor visiting the definitions in this model
(depth-first)visitor - the CdsVisitorCopyright © 2020 SAP. All rights reserved.