def getTag(self, paintable): class1 = self._widgetMappingCache.get(paintable.__class__) if class1 is None: # Client widget annotation is searched from component hierarchy # to detect the component that presumably has client side # implementation. The server side name is used in the # transportation, but encoded into integer strings to optimized # transferred data. class1 = paintable.__class__ while not self.hasClientWidgetMapping(class1): superclass = getSuperClass(class1) if superclass is not None and issubclass(class1, IPaintable): class1 = superclass else: logger.warning(('No superclass of ' + clsname(paintable.__class__) + ' has a @ClientWidget annotation. Component ' 'will not be mapped correctly on client side.')) break self._widgetMappingCache[paintable.__class__] = class1 self._usedPaintableTypes.append(class1) return self._manager.getTagForType(class1)
def getTag(self, paintable): class1 = self._widgetMappingCache.get(paintable.__class__) if class1 is None: # Client widget annotation is searched from component hierarchy # to detect the component that presumably has client side # implementation. The server side name is used in the # transportation, but encoded into integer strings to optimized # transferred data. class1 = paintable.__class__ while not self.hasClientWidgetMapping(class1): superclass = getSuperClass(class1) if superclass is not None and issubclass(class1, IPaintable): class1 = superclass else: logger.warning( ('No superclass of ' + clsname(paintable.__class__) + ' has a @ClientWidget annotation. Component ' 'will not be mapped correctly on client side.')) break self._widgetMappingCache[paintable.__class__] = class1 self._usedPaintableTypes.append(class1) return self._manager.getTagForType(class1)
def getJavadocUrl(cls, baseUrl, clazz): if not baseUrl.endswith('/'): baseUrl += '/' #path = clazz.__name__.replace('\\.', '/') path = clsname(clazz) path = path.replace('\\$', '.') return baseUrl + path + '-class.html'
def getApplicationContext(cls, session, servlet): """Gets the application context for an HttpSession. @param session: the HTTP session. @return: the application context for HttpSession. """ cx = servlet.getSessionAttribute(session, clsname(WebApplicationContext), None) if cx is None: cx = WebApplicationContext() servlet.setSessionAttribute(session, clsname(WebApplicationContext), cx) if cx.session is None: cx.session = session return cx
def findClassesNoTests(cls, baseClass, basePackage, ignoredPackages): classes = cls.findClasses(baseClass, basePackage, ignoredPackages) classesNoTests = list() for clazz in classes: if 'Test' not in clsname(clazz): testPresent = False #for method in clazz.getMethods(): # if method.isAnnotationPresent(Test): # testPresent = True # break if not testPresent: classesNoTests.append(clazz) return classesNoTests
def findClasses(cls, baseClass, basePackage, ignoredPackages=None): if ignoredPackages == None: ignoredPackages = [] classes = list() basePackageDirName = '/' + basePackage.replace('.', '/') location = cls.getResource(basePackageDirName) if not exists(location): raise IOError('Directory ' + location + ' does not exist') cls.findPackages(location, basePackage, baseClass, classes, ignoredPackages) classes.sort(key=lambda klass: clsname(klass)) return classes
def main(cls, args): print 'ComponentContainers' print '===================' for c in cls.getComponentContainers(): print clsname(c) print print 'Components' print '==========' for c in cls.getComponents(): print clsname(c) print print 'Server side classes' print '===================' for c in cls.getAllServerSideClasses(): print clsname(c)
def getIdentifier(self): return clsname(TreeDropCriterion)
def getIdentifier(self): return clsname(self.__class__) # FIXME: Python client-side