Package com.sap.cds.reflect
Interface CdsDefinition
-
- All Superinterfaces:
CdsAnnotatable
,CdsNamed
- All Known Subinterfaces:
CdsAction
,CdsArrayedType
,CdsAssociationType
,CdsDecimal
,CdsEntity
,CdsEnumType<T>
,CdsEvent
,CdsFunction
,CdsService
,CdsSimpleType
,CdsStringType
,CdsStructuredType
,CdsType
public interface CdsDefinition extends CdsAnnotatable, CdsNamed
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description void
accept(CdsVisitor visitor)
Accepts aCdsVisitor
visiting the elements of this definition (depth-first)default <T extends CdsDefinition>
Tas(Class<T> type)
Casts this type to the givenCdsDefinition
.static Predicate<CdsDefinition>
byNamespace(String namespace)
Returns aPredicate
to filterCdsDefinition(s)
that are inside the given namespace.default String
getKey()
Returns the name that uniquely identifies this named objectCdsKind
getKind()
Returns the kind of this definition.String
getName()
Returns the unqualified name of this definition.String
getQualifiedName()
Returns the fully qualified name of this definition.String
getQualifier()
Returns the qualifier part of this definition's qualified name.-
Methods inherited from interface com.sap.cds.reflect.CdsAnnotatable
annotations, findAnnotation, getAnnotationValue
-
-
-
-
Method Detail
-
accept
void accept(CdsVisitor visitor)
Accepts aCdsVisitor
visiting the elements of this definition (depth-first)- Parameters:
visitor
- theCdsVisitor
-
getQualifiedName
String getQualifiedName()
Returns the fully qualified name of this definition.- Returns:
- the fully qualified name of this definition
-
getName
String getName()
Returns the unqualified name of this definition.- Returns:
- the unqualified name
-
getQualifier
String getQualifier()
Returns the qualifier part of this definition's qualified name.- Returns:
- the qualifier of the qualified name, or an empty string if this definition does not have a qualifier
-
getKind
CdsKind getKind()
Returns the kind of this definition.- Returns:
- the kind of this definition
-
byNamespace
static Predicate<CdsDefinition> byNamespace(String namespace)
Returns aPredicate
to filterCdsDefinition(s)
that are inside the given namespace. If the namespace is empty ornull
, all definitions match.- Parameters:
namespace
- the namespace to filter, can be empty ornull
- Returns:
- a
Predicate
filtering by namespace
-
as
default <T extends CdsDefinition> T as(Class<T> type)
Casts this type to the givenCdsDefinition
.- Type Parameters:
T
- the return type- Parameters:
type
- the subtype ofCdsDefinition
to cast to- Returns:
- this type casted to the given
CdsDefinition
class
-
-