CSDLFetcher

open class CSDLFetcher : ObjectBase

Callback which can locate and fetch the text of an Open Data Protocol (OData) service metadata (CSDL) document.

See also

CsdlParser.csdlFetcher.
  • Default initializer.

    Declaration

    Swift

    override public init()
  • Declaration

    Swift

    open func accept(uri: String, ns: String) throws -> Bool

    Parameters

    uri

    Location of document to be read.

    ns

    Namespace for schema to be read.

    Return Value

    true if this fetcher accepts a location (or associated namespace), meaning that a fetch call would be expected to succeed. This function returns false by default for OData standard vocabulary namespaces (Org.OData.*), otherwise this function returns true. Override this function in subclasses to return true only for those well-known location/namespace values that the fetcher expects that it can resolve to a service metadata document.

  • Throws

    CsdlException if the document cannot be fetched.

    Declaration

    Swift

    open func fetch(uri: String, ns: String) throws -> String

    Parameters

    uri

    Location of document to be read.

    ns

    Namespace for schema to be read.

    Return Value

    The XML content of a service metadata document at the specified URL.

  • Declaration

    Swift

    open func ignore(uri: String, ns: String) throws -> Bool

    Parameters

    uri

    Location of document to be read.

    ns

    Namespace for schema to be read.

    Return Value

    true if this fetcher wants to force the CsdlParser to ignore a reference. This function returns false by default. Override this function in subclasses to return true only for those well-known location/namespace values that the fetcher wants to suppress fetching for.