CsdlDocument

open class CsdlDocument

Encapsulates the definitions from a parsed Open Data Protocol (OData) service metadata (CSDL) document.

See Also:

{@link com.sap.cloud.mobile.kotlin.odata.csdl.CsdlParser}.

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
var logger: Any?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard

If this model contains navigation properties without defined partners, then set {@link com.sap.cloud.mobile.kotlin.odata.Property#partnerPath Property.partnerPath} on each navigation property so as to make the relationship appear bidirectional. Such a change will only be made if there is one partnerless navigation property on each entity type, referring to the candidate partner type. This is primarily helpful for model visualization.

Link copied to clipboard
open fun addOwner(owner: Any)

Register owner as an owner of this metadata document.

Link copied to clipboard
open fun addVocabularyReference(ns: String, uri: String?)
open fun addVocabularyReference(ns: String, uri: String?, alias: String?)

Add a well-known vocabulary reference to this metadata. If this metadata already has a reference to the well-known vocabulary, then no change is made. If the reference is to one of the {@link com.sap.cloud.mobile.kotlin.odata.csdl.CsdlDocument#builtinVocabularyNamespaces CsdlDocument.builtinVocabularyNamespaces}, then all defined annotation terms/types from the vocabulary will also be added to the current metadata.

See Also:

{@link com.sap.cloud.mobile.kotlin.odata.csdl.CsdlDocument#builtinVocabularyNamespaces CsdlDocument.builtinVocabularyNamespaces}.

Link copied to clipboard
open fun applyAnnotations()

Apply any database-related and security-related annotations (from OData namespaces "com.sap.cloud.server.odata.*") to this metadata.

Link copied to clipboard
open fun csdlException(line: Int, message: String): CsdlException

Return a CsdlException for specified line number and error message.

Link copied to clipboard

Lookup a complex type by qualified name. If the complex type does not exist it indicates a fundamental implementation problem, therefore a non-catchable PanicException will be thrown, and the app intentionally crashes. The reason behind this drastic behaviour is to avoid mismatch between server and client. It is still possible to avoid the PanicException by looking up simplet types before calling this method like in the following code snippet:

Link copied to clipboard

Lookup a data method by qualified name (for function/action definitions) or by unqualified name (for function/action imports). If the data method does not exist it indicates a fundamental implementation problem, therefore a non-catchable PanicException will be thrown, and the app intentionally crashes. The reason behind this drastic behaviour is to avoid mismatch between server and client. It is still possible to avoid the PanicException by looking up data methods before calling this method like in the following code snippet:

Link copied to clipboard

Lookup a data schema by name. Panic if the data schema does not exist.

Link copied to clipboard
open fun getEntitySet(name: String): EntitySet

Lookup an entity set (or singleton entity) by name. If the entity set does not exist it indicates a fundamental implementation problem, therefore a non-catchable PanicException will be thrown, and the app intentionally crashes. The reason behind this drastic behaviour is to avoid mismatch between server and client. It is still possible to avoid the PanicException by looking up simplet types before calling this method like in the following code snippet: Note that OData singleton entities are represented by entity sets where {@link com.sap.cloud.mobile.kotlin.odata.EntitySet#isSingleton EntitySet.isSingleton} is true.

Link copied to clipboard

Lookup an entity type by qualified name. If the entity type does not exist it indicates a fundamental implementation problem, therefore a non-catchable PanicException will be thrown, and the app intentionally crashes. The reason behind this drastic behaviour is to avoid mismatch between server and client. It is still possible to avoid the PanicException by looking up simplet types before calling this method like in the following code snippet:

Link copied to clipboard
open fun getEnumType(name: String): EnumType

Lookup an enum type by qualified name. If the enum type does not exist it indicates a fundamental implementation problem, therefore a non-catchable PanicException will be thrown, and the app intentionally crashes. The reason behind this drastic behaviour is to avoid mismatch between server and client. It is still possible to avoid the PanicException by looking up simplet types before calling this method like in the following code snippet:

Link copied to clipboard
open fun getOwners(): ObjectList

Return all the current registered owners of this metadata document.

Link copied to clipboard

Lookup a simple type by qualified name. If the simple type does not exist it indicates a fundamental implementation problem, therefore a non-catchable PanicException will be thrown, and the app intentionally crashes. The reason behind this drastic behaviour is to avoid mismatch between server and client. It is still possible to avoid the PanicException by looking up simplet types before calling this method like in the following code snippet:

Link copied to clipboard
open fun getSingleton(name: String): EntitySet

Lookup a singleton entity by name. If the singleton entity does not exist it indicates a fundamental implementation problem, therefore a non-catchable PanicException will be thrown, and the app intentionally crashes. The reason behind this drastic behaviour is to avoid mismatch between server and client. It is still possible to avoid the PanicException by looking up simplet types before calling this method like in the following code snippet: Note that OData singleton entities are represented by entity sets where {@link com.sap.cloud.mobile.kotlin.odata.EntitySet#isSingleton EntitySet.isSingleton} is true.

Link copied to clipboard

Return true if this document includes a top-level reference for CSDL namespace ns.

See Also:

{@link com.sap.cloud.mobile.kotlin.odata.csdl.CsdlDocument#topReferences CsdlDocument.topReferences}.

Link copied to clipboard
open fun hasTopSchema(ns: String): Boolean

Return true if this document includes a top-level schema for CSDL namespace ns.

See Also:

{@link com.sap.cloud.mobile.kotlin.odata.csdl.CsdlDocument#topSchemas CsdlDocument.topSchemas}.

Link copied to clipboard

Mark this document and its elements as being immortal. Helps to improve performance in reference counted environments (e.g. Swift). Should only be used for metadata documents with process lifetime. Otherwise a memory leak could be caused.

Link copied to clipboard

Inherit annotations from entity types to entity sets in this metadata.

Link copied to clipboard
open fun removeOwner(owner: Any)

Unregister owner as an owner of this metadata document.

Link copied to clipboard
open fun resolveEntity(entity: EntityValue)

Resolve the EntityValue.entitySet of entity (if it is not already set). Throw an exception if entity.entitySet is not set, and is not unique (i.e. multiple entity sets use the same entity type) or there is a circular dependency in related entities (parent entity is set as child as well) or an entity is resolved multiple times meaning that it is embedded as child more than once.