Package com.sap.cds.reflect
Interface CdsStructuredType
-
- All Superinterfaces:
CdsAnnotatable
,CdsDefinition
,CdsNamed
,CdsType
public interface CdsStructuredType extends CdsType
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description default void
accept(CdsVisitor visitor)
Accepts aCdsVisitor
visiting the elements of this definition (depth-first)default Stream<CdsElement>
associations()
Returns a sequentialStream
over theCdsElement(s)
of typeCdsAssociationType
in this structured type.default Stream<CdsElement>
compositions()
Returns a sequentialStream
over theCdsElement(s)
of type composition in this structured type.default Stream<CdsElement>
concreteElements()
Returns a sequentialStream
over the non virtualCdsElement(s)
in this structured type.default Stream<CdsElement>
concreteNonAssociationElements()
Returns a sequentialStream
over theCdsElement(s)
in this structured type that are not of typeCdsAssociationType
and not virtual.Stream<CdsElement>
elements()
Returns a sequentialStream
over allCdsElement(s)
in this structured type.default <T extends CdsType>
Stream<CdsElement>elementsOfType(Class<T> type)
Optional<CdsElement>
findAssociation(String name)
Optional<CdsElement>
findElement(String name)
Returns anOptional
wrapping aCdsElement
.CdsElement
getAssociation(String name)
Get aCdsElement
of typeCdsAssociationType
by name.CdsElement
getElement(String name)
Get aCdsElement
by name.<S extends CdsStructuredType>
SgetTargetOf(String path)
Returns the targetCdsStructuredType
of the given navigation path.default boolean
isAnonymous()
Returnstrue
if this is an inline defined structured type without a name.default boolean
isInlineDefined()
Deprecated.instead useisAnonymous()
default boolean
isStructured()
Returnstrue
if this is a structured type.default Stream<CdsElement>
keyElements()
Returns a sequentialStream
over the keyCdsElement(s)
in this structured type.default Stream<CdsElement>
nonAssociationElements()
Returns a sequentialStream
over theCdsElement(s)
in this structured type that are not of typeCdsAssociationType
.default Stream<CdsElement>
virtualElements()
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
-
-
-
-
Method Detail
-
getElement
CdsElement getElement(String name)
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
Optional<CdsElement> findElement(String name)
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
CdsElement getAssociation(String name)
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
Optional<CdsElement> findAssociation(String name)
- 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
<S extends CdsStructuredType> S getTargetOf(String path)
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
default Stream<CdsElement> keyElements()
Returns a sequentialStream
over the keyCdsElement(s)
in this structured type.- Returns:
- a sequential
Stream
over the keyCdsElement(s)
-
virtualElements
default Stream<CdsElement> virtualElements()
Returns a sequentialStream
over the virtualCdsElement(s)
in this structured type.- Returns:
- a sequential
Stream
over the virtualCdsElement(s)
-
concreteElements
default Stream<CdsElement> concreteElements()
Returns a sequentialStream
over the non virtualCdsElement(s)
in this structured type.- Returns:
- a sequential
Stream
over the non virtualCdsElement(s)
-
nonAssociationElements
default Stream<CdsElement> 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
default Stream<CdsElement> 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
default Stream<CdsElement> associations()
Returns a sequentialStream
over theCdsElement(s)
of typeCdsAssociationType
in this structured type.- Returns:
- a sequential
Stream
over theCdsElement(s)
of typeCdsAssociation
-
compositions
default Stream<CdsElement> 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
default <T extends CdsType> Stream<CdsElement> elementsOfType(Class<T> type)
- 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>
-
isInlineDefined
@Deprecated default boolean isInlineDefined()
Deprecated.instead useisAnonymous()
-
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
default void accept(CdsVisitor visitor)
Description copied from interface:CdsDefinition
Accepts aCdsVisitor
visiting the elements of this definition (depth-first)- Specified by:
accept
in interfaceCdsDefinition
- Parameters:
visitor
- theCdsVisitor
-
-