KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > python > core > PyDescriptor


1 package org.python.core;
2
3 public abstract class PyDescriptor extends PyObject {
4
5     protected PyType dtype;
6     protected String JavaDoc name;
7
8     protected PyException call_wrongtype(PyType objtype) {
9         return Py.TypeError(
10             "descriptor '"
11                 + name
12                 + "' requires '"
13                 + dtype.fastGetName()
14                 + "' object but received a '"
15                 + objtype.fastGetName()
16                 + "'");
17     }
18     
19     protected PyException get_wrongtype(PyType objtype) {
20          return Py.TypeError(
21              "descriptor '"
22                  + name
23                  + "' for '"
24                  + dtype.fastGetName()
25                  + "' objects doesn't apply to '"
26                  + objtype.fastGetName()
27                  + "' object");
28      }
29     
30     protected String JavaDoc blurb() {
31         return "descriptor '"+name+"' of '"+dtype.fastGetName()+"' object";
32     }
33
34 }
35
Popular Tags