[top] / zope / interface / interfaces / IInterfaceDeclaration
Declare and check the interfaces of objects
The functions defined in this interface are used to declare the interfaces that objects provide and to query the interfaces that have been declared.
Interfaces can be declared for objects in two ways:
The interfaces declared for an object are, therefore, the union of interfaces declared for the object directly and the interfaces declared for instances of the object's class.
Note that we say that a class implements the interfaces provided by it's instances. An instance can also provide interfaces directly. The interfaces provided by an object are the union of the interfaces provided directly and the interfaces implemented by the class.
There are no attributes or fields specified.
implements(*interfaces)
Declare interfaces implemented by instances of a class
This function is called in a class definition.
The arguments are one or more interfaces or interface specifications (IDeclaration objects).
The interfaces given (including the interfaces in the specifications) are added to any interfaces previously declared.
Previous declarations include declarations for base classes unless implementsOnly was used.
This function is provided for convenience. It provides a more convenient way to call classImplements. For example:
implements(I1)
is equivalent to calling:
classImplements(C, I1)
after the class has been created.
Consider the following example:
class C(A, B): implements(I1, I2)
Instances of C implement I1, I2, and whatever interfaces instances of A and B implement.
directlyProvidedBy(object)
Return the interfaces directly provided by the given object
The value returned is an IDeclaration.
classImplementsOnly(class_, *interfaces)
Declare the only interfaces implemented by instances of a class
The arguments after the class are one or more interfaces or interface specifications (IDeclaration objects).
The interfaces given (including the interfaces in the specifications) replace any previous declarations.
Consider the following example:
class C(A, B): ... classImplements(C, IA, IB. IC) classImplementsOnly(C. I1, I2)
Instances of C provide only I1, I2, and regardless of whatever interfaces instances of A and B implement.
implementsOnly(*interfaces)
Declare the only interfaces implemented by instances of a class
This function is called in a class definition.
The arguments are one or more interfaces or interface specifications (IDeclaration objects).
Previous declarations including declarations for base classes are overridden.
This function is provided for convenience. It provides a more convenient way to call classImplementsOnly. For example:
implementsOnly(I1)
is equivalent to calling:
classImplementsOnly(I1)
after the class has been created.
Consider the following example:
class C(A, B): implementsOnly(I1, I2)
Instances of C implement I1, I2, regardless of what instances of A and B implement.
moduleProvides(*interfaces)
Declare interfaces provided by a module
This function is used in a module definition.
The arguments are one or more interfaces or interface specifications (IDeclaration objects).
The given interfaces (including the interfaces in the specifications) are used to create the module's direct-object interface specification. An error will be raised if the module already has an interface specification. In other words, it is an error to call this function more than once in a module definition.
This function is provided for convenience. It provides a more convenient way to call directlyProvides for a module. For example:
moduleImplements(I1)
is equivalent to:
directlyProvides(sys.modules[__name__], I1)
Declaration(*interfaces)
Create an interface specification
The arguments are one or more interfaces or interface specifications (IDeclaration objects).
A new interface specification (IDeclaration) with the given interfaces is returned.
directlyProvides(object, *interfaces)
Declare interfaces declared directly for an object
The arguments after the object are one or more interfaces or interface specifications (IDeclaration objects).
The interfaces given (including the interfaces in the specifications) replace interfaces previously declared for the object.
Consider the following example:
class C(A, B): ... ob = C() directlyProvides(ob, I1, I2)
The object, ob provides I1, I2, and whatever interfaces instances have been declared for instances of C.
To remove directly provided interfaces, use directlyProvidedBy and subtract the unwanted interfaces. For example:
directlyProvides(ob, directlyProvidedBy(ob)-I2)
removes I2 from the interfaces directly provided by ob. The object, ob no longer directly provides I2, although it might still provide I2 if it's class implements I2.
To add directly provided interfaces, use directlyProvidedBy and include additional interfaces. For example:
directlyProvides(ob, directlyProvidedBy(ob), I2)
adds I2 to the interfaces directly provided by ob.
implementer(*interfaces)
Create a decorator for declaring interfaces implemented by a facory
A callable is returned that makes an implements declaration on objects passed to it.
implementedBy(class_)
Return the interfaces implemented for a class' instances
The value returned is an IDeclaration.
noLongerProvides(object, interface)
Remove an interface from the list of an object's directly provided interfaces:
noLongerProvides(ob, I1)
is equivalent to:
directlyProvides(ob, directlyProvidedBy(ob)-I1)
with the exception that if I1 is an interface that is provided by ob through the class's implementation, ValueError is raised.
alsoProvides(object, *interfaces)
Declare additional interfaces directly for an object:
alsoProvides(ob, I1)
is equivalent to:
directivelyProvides(ob, directlyProvidedBy(ob), I1)
providedBy(ob)
Return the interfaces provided by an object
This is the union of the interfaces directly provided by an object and interfaces implemented by it's class.
The value returned is an IDeclaration.
classProvides(*interfaces)
Declare interfaces provided directly by a class
This function is called in a class definition.
The arguments are one or more interfaces or interface specifications (IDeclaration objects).
The given interfaces (including the interfaces in the specifications) are used to create the class's direct-object interface specification. An error will be raised if the module class has an direct interface specification. In other words, it is an error to call this function more than once in a class definition.
Note that the given interfaces have nothing to do with the interfaces implemented by instances of the class.
This function is provided for convenience. It provides a more convenient way to call directlyProvides for a class. For example:
classProvides(I1)
is equivalent to calling:
directlyProvides(theclass, I1)
after the class has been created.
classImplements(class_, *interfaces)
Declare additional interfaces implemented for instances of a class
The arguments after the class are one or more interfaces or interface specifications (IDeclaration objects).
The interfaces given (including the interfaces in the specifications) are added to any interfaces previously declared.
Consider the following example:
class C(A, B): ... classImplements(C, I1, I2)
Instances of C provide I1, I2, and whatever interfaces instances of A and B provide.
There are no specific adapters registered for this interface.
There are no extended adapters registered for this interface.
zope.viewlet.metaconfigure.JavaScriptViewlet
(name: boston.js)
zope.viewlet.manager.<ViewletManager providing IJavaScript>
(name: zope.app.boston.IJavaScript)
zope.viewlet.viewlet.SimpleViewletClass from /opt/zope/sr/apidoc/src/zope/app/boston/viewlets/toolbar/viewlet.pt
(name: toolbar)
zope.traversing.namespace.lang
(name: lang)
zope.viewlet.manager.<ViewletManager providing ICSS>
(name: zope.app.boston.ICSS)
zope.traversing.namespace.acquire
(name: acquire)
zope.traversing.namespace.acquire
(name: acquire)
zope.traversing.namespace.acquire
(name: acquire)
zope.traversing.namespace.acquire
(name: acquire)
zope.app.apidoc.codemodule.browser.introspector.annotationsNamespace
(name: annotations)
zope.app.apidoc.codemodule.browser.introspector.annotationsNamespace
(name: annotations)
zope.app.apidoc.codemodule.browser.introspector.annotationsNamespace
(name: annotations)
zope.app.apidoc.codemodule.browser.introspector.annotationsNamespace
(name: annotations)
zope.viewlet.metaconfigure.CSSViewlet
(name: xmltree.css)
zope.app.pagetemplate.urlquote.URLQuote
(name: url)
zope.viewlet.viewlet.SimpleViewletClass from /opt/zope/sr/apidoc/src/zope/app/boston/viewlets/xmltree/xmltree.pt
(name: xmltree)
zope.viewlet.metaconfigure.CSSViewlet
(name: skin.css)
zope.app.preference.preference.preferencesNamespace
(name: preferences)
zope.app.preference.default.DefaultPreferences
(name: preferences)
zope.traversing.namespace.attr
(name: attribute)
zope.traversing.namespace.attr
(name: attribute)
zope.traversing.namespace.attr
(name: attribute)
zope.traversing.namespace.attr
(name: attribute)
zope.viewlet.manager.<ViewletManager providing IHead>
(name: zope.app.boston.IHead)
zope.app.component.back35.RegistrationManagerNamespace
(name: registrations)
zope.viewlet.manager.<ViewletManager providing ILeft>
(name: zope.app.boston.ILeft)
zope.traversing.namespace.resource
(name: resource)
zope.traversing.namespace.resource
(name: resource)
zope.traversing.namespace.resource
(name: resource)
zope.traversing.namespace.resource
(name: resource)
zope.traversing.namespace.etc
(name: etc)
zope.traversing.namespace.etc
(name: etc)
zope.traversing.namespace.etc
(name: etc)
zope.traversing.namespace.etc
(name: etc)
zope.traversing.namespace.etc
(name: etc)
zope.app.apidoc.apidoc.apidocNamespace
(name: apidoc)
zope.app.apidoc.apidoc.apidocNamespace
(name: apidoc)
zope.app.apidoc.apidoc.apidocNamespace
(name: apidoc)
zope.app.apidoc.apidoc.apidocNamespace
(name: apidoc)
zope.traversing.namespace.acquire
(name: acquire)
zope.traversing.namespace.lang
(name: lang)
zope.traversing.namespace.lang
(name: lang)
zope.traversing.namespace.lang
(name: lang)
zope.traversing.namespace.lang
(name: lang)
zope.traversing.namespace.item
(name: item)
zope.traversing.namespace.item
(name: item)
zope.traversing.namespace.item
(name: item)
zope.traversing.namespace.item
(name: item)
zope.traversing.namespace.item
(name: item)
zope.viewlet.metaconfigure.JavaScriptViewlet
(name: xmltree)
zope.viewlet.metaconfigure.CSSViewlet
(name: toolbar-css)
zope.traversing.namespace.adapter
(name: adapter)
zope.app.apidoc.apidoc.apidocNamespace
(name: apidoc)
zope.traversing.namespace.vh
(name: vh)
zope.traversing.namespace.vh
(name: vh)
zope.traversing.namespace.vh
(name: vh)
zope.traversing.namespace.vh
(name: vh)
zope.app.onlinehelp.helpNamespace
(name: help)
zope.app.onlinehelp.helpNamespace
(name: help)
zope.app.onlinehelp.helpNamespace
(name: help)
zope.app.onlinehelp.helpNamespace
(name: help)
zope.app.onlinehelp.helpNamespace
(name: help)
zope.traversing.namespace.adapter
(name: adapter)
zope.traversing.namespace.adapter
(name: adapter)
zope.traversing.namespace.adapter
(name: adapter)
zope.traversing.namespace.adapter
(name: adapter)
zope.traversing.namespace.debug
(name: debug)
zope.traversing.namespace.debug
(name: debug)
zope.traversing.namespace.debug
(name: debug)
zope.traversing.namespace.debug
(name: debug)
zope.app.pagetemplate.talesapi.ZopeTalesAPI
(name: zope)
zope.traversing.namespace.attr
(name: attribute)
zope.app.preference.preference.preferencesNamespace
(name: preferences)
zope.app.preference.preference.preferencesNamespace
(name: preferences)
zope.app.preference.preference.preferencesNamespace
(name: preferences)
zope.app.preference.preference.preferencesNamespace
(name: preferences)
zope.app.apidoc.codemodule.browser.introspector.annotationsNamespace
(name: annotations)
zope.traversing.namespace.view
(name: view)
zope.traversing.namespace.view
(name: view)
zope.traversing.namespace.view
(name: view)
zope.traversing.namespace.view
(name: view)
zope.formlib.namedtemplate.NamedTemplatePathAdapter
(name: template)
zope.viewlet.manager.<ViewletManager providing IToolBar>
(name: zope.app.boston.IToolBar)
zope.viewlet.metaconfigure.CSSViewlet
(name: widget.css)
There are no views available.
There are no views available.
There are no views available.
There are no views available.
There are no views available.
There are no views available.
There are no views available.
There are no views available.
There are no views available.
There are no views available.
There are no views available.
There are no views available.