Package com.sap.cds.reflect
Interface CdsStructuredType
- All Superinterfaces:
CdsAnnotatable
,CdsDefinition
,CdsNamed
,CdsType
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
accept
(CdsVisitor visitor) Accepts aCdsVisitor
visiting the elements of this definition (depth-first)default Stream<CdsElement>
Returns a sequentialStream
over theCdsElement(s)
of typeCdsAssociationType
in this structured type.default Stream<CdsElement>
Returns a sequentialStream
over theCdsElement(s)
of type composition in this structured type.default Stream<CdsElement>
Returns a sequentialStream
over the non virtualCdsElement(s)
in this structured type.default Stream<CdsElement>
Returns a sequentialStream
over theCdsElement(s)
in this structured type that are not of typeCdsAssociationType
and not virtual.elements()
Returns a sequentialStream
over allCdsElement(s)
in this structured type.default <T extends CdsType>
Stream<CdsElement>elementsOfType
(Class<T> type) findAssociation
(String name) findElement
(String name) Returns anOptional
wrapping aCdsElement
.getAssociation
(String name) Get aCdsElement
of typeCdsAssociationType
by name.getElement
(String name) Get aCdsElement
by name.<S extends CdsStructuredType>
SgetTargetOf
(String path) Returns the targetCdsStructuredType
of the given navigation path.default boolean
Returnstrue
if this is an inline defined structured type without a name.default boolean
Returnstrue
if this is a structured type.default Stream<CdsElement>
Returns a sequentialStream
over the keyCdsElement(s)
in this structured type.default Stream<CdsElement>
Returns a sequentialStream
over theCdsElement(s)
in this structured type that are not of typeCdsAssociationType
.default Stream<CdsElement>
Returns a sequentialStream
over the virtualCdsElement(s)
in this structured type.Methods inherited from interface com.sap.cds.reflect.CdsAnnotatable
annotations, findAnnotation, getAnnotationValue
Methods inherited from interface com.sap.cds.reflect.CdsDefinition
as, getKey, getKind, getName, getQualifiedName, getQualifier
Methods inherited from interface com.sap.cds.reflect.CdsType
isArrayed, isAssociation, isEnum, isSimple, isSimpleType, isSymbolicType
-
Method Details
-
getElement
Get aCdsElement
by name.- Parameters:
name
- the name of theCdsElement
- Returns:
- the
CdsElement
with the given name - Throws:
CdsElementNotFoundException
- if there is noCdsElement
with the given name
-
findElement
Returns anOptional
wrapping aCdsElement
.- Parameters:
name
- the name of theCdsElement
- Returns:
- an
Optional
describing theCdsElement
with the given name, or an emptyOptional
if there is noCdsElement
with this name
-
getAssociation
Get aCdsElement
of typeCdsAssociationType
by name.- Parameters:
name
- the name of theCdsElement
- Returns:
- the
CdsElement
of typeCdsAssociation
with the given name - Throws:
CdsElementNotFoundException
- if there is noCdsElement
with the given name
-
findAssociation
- Parameters:
name
- the name of theCdsElement
- Returns:
- an
Optional
describing theCdsElement
of typeCdsAssociation
with the given name, or an emptyOptional
if there is noCdsElement
with this name
-
getTargetOf
Returns the targetCdsStructuredType
of the given navigation path.- Parameters:
path
- the navigation path- Returns:
- the target
CdsStructuredType
of the path - Throws:
CdsReflectiveOperationException
- if the path is invalid
-
elements
Stream<CdsElement> elements()Returns a sequentialStream
over allCdsElement(s)
in this structured type.- Returns:
- a sequential
Stream
over theCdsElement(s)
-
keyElements
Returns a sequentialStream
over the keyCdsElement(s)
in this structured type.- Returns:
- a sequential
Stream
over the keyCdsElement(s)
-
virtualElements
Returns a sequentialStream
over the virtualCdsElement(s)
in this structured type.- Returns:
- a sequential
Stream
over the virtualCdsElement(s)
-
concreteElements
Returns a sequentialStream
over the non virtualCdsElement(s)
in this structured type.- Returns:
- a sequential
Stream
over the non virtualCdsElement(s)
-
nonAssociationElements
Returns a sequentialStream
over theCdsElement(s)
in this structured type that are not of typeCdsAssociationType
.- Returns:
- a sequential
Stream
over theCdsElement(s)
that are not of typeCdsAssociation
-
concreteNonAssociationElements
Returns a sequentialStream
over theCdsElement(s)
in this structured type that are not of typeCdsAssociationType
and not virtual.- Returns:
- a sequential
Stream
over theCdsElement(s)
that are not of typeCdsAssociation
-
associations
Returns a sequentialStream
over theCdsElement(s)
of typeCdsAssociationType
in this structured type.- Returns:
- a sequential
Stream
over theCdsElement(s)
of typeCdsAssociation
-
compositions
Returns a sequentialStream
over theCdsElement(s)
of type composition in this structured type.- Returns:
- a sequential
Stream
over theCdsElement(s)
of type composition
-
elementsOfType
- Type Parameters:
T
- the type of theCdsElement(s)
- Parameters:
type
- the type class of theCdsElement(s)
- Returns:
- a sequential
Stream
over theCdsElement(s)
of the given type<T>
-
isAnonymous
default boolean isAnonymous()Returnstrue
if this is an inline defined structured type without a name.- Returns:
true
if this is a structured type without name, otherwisefalse
-
isStructured
default boolean isStructured()Description copied from interface:CdsType
Returnstrue
if this is a structured type.- Specified by:
isStructured
in interfaceCdsType
- Returns:
true
if this is a structured type, otherwisefalse
-
accept
Description copied from interface:CdsDefinition
Accepts aCdsVisitor
visiting the elements of this definition (depth-first)- Specified by:
accept
in interfaceCdsDefinition
- Parameters:
visitor
- theCdsVisitor
-