-
A callback which will be used to resolve any CSDL Reference that is encountered during parsing, in order to fetch the referenced metadata. Must be set before
parse
is called, or else any CSDL Reference that is encountered during parsing will result in aCsdlException
being thrown.Declaration
Swift
final public var csdlFetcher: CSDLFetcher?
-
A bitmask of CSDL parser options.
See also
CsdlOption
.Declaration
Swift
final public var csdlOptions: Int = (0 as Int)
-
Should parser errors be logged before they are thrown?
Declaration
Swift
final public var logErrors: Bool = true
-
Should parser warnings be logged?
Declaration
Swift
final public var logWarnings: Bool = true
-
Should parsing requests be traced?
Declaration
Swift
final public var traceRequests: Bool = false
-
Data service name. If data metrics are required, this property should be set before
parse
is called, so that allDataMethod
andEntitySet
in the parsed document will have appropriately named metrics.Declaration
Swift
final public var serviceName: String?
-
Default initializer.
Declaration
Swift
override public init()
-
Add to
includeReferences
a supplementary CSDL edmx:Reference (with embedded edmx:Include). Call this function beforeparse
if the document to be parsed is missing expected edmx:Reference elements for well-known schemas. This function generates an edmx:Reference with a fabricatedUri
(with valueinclude/`ns`.xml
). It can be used together with acsdlFetcher
which resolves documents either by fabricated location (include/ns
.xml) or by namespace (ns
).Declaration
Swift
open func includeNamespace(ns: String, alias: String? = nil) -> Void
Parameters
ns
For the
Namespace
attribute ofedmx:Include
.alias
For the
Alias
attribute ofedmx:Include
. -
Add to
includeReferences
a supplementary CSDL edmx:Reference (with embedded edmx:Include). Call this function beforeparse
if the document to be parsed is missing expected edmx:Reference elements for well-known schemas. This function generates an edmx:Reference with a caller-specifiedUri
. It can be used together with acsdlFetcher
which resolves documents either by caller-specified location (uri
) or by namespace (ns
).Declaration
Swift
open func includeReference(uri: String, ns: String, alias: String? = nil) -> Void
Parameters
uri
For the
Uri
attribute ofedmx:Reference
.ns
For the
Namespace
attribute ofedmx:Include
.alias
For the
Alias
attribute ofedmx:Include
. -
Include the definitions of a pre-parsed schema into the document to be parsed. Call this function before
parse
if the document to be parsed has an edmx:Reference element for a well-known schema, and the pre-parsed schema should be used rather than loading the referenced schema over the network.Declaration
Swift
open func includeSchema(_ schema: DataSchema) -> Void
Parameters
schema
Pre-parsed schema.
-
Parse the text of an Open Data Protocol (OData) service metadata (CSDL) document. Supports OData versions 1.0 to 4.0.
Declaration
Swift
open func parse(_ text: String, url: String) throws -> CSDLDocument
Parameters
text
Text of the service metadata document.
url
URL of the service metadata document. Used for resolving relative URLs if any CSDL Reference is encountered during parsing. May also be included in exception messages.
Return Value
Parsed CSDL document.