Lines Matching refs:name

63         self.name = raw[1].strip(";")
93 self.name = raw[1]
135 self.fullname = self.pkg.name + "." + self.fullname
136 self.name = self.fullname[self.fullname.rindex(".")+1:]
148 self.name = raw[raw.index("package")+1]
220 if re.match("[A-Z0-9_]+", f.name) is None:
236 if re.search("[A-Z]{2,}", clazz.name) is not None:
237 warn(clazz, None, "Class name style should be Mtp not MTP")
238 if re.match("[^A-Z]", clazz.name):
249 if re.search("[A-Z]{2,}", m.name) is not None:
250 warn(clazz, m, "Method name style should be getMtu() instead of getMTU()")
251 if re.match("[^a-z]", m.name):
252 error(clazz, m, "Method name must start with lowercase char")
261 if clazz.name.endswith("Callbacks"):
262 error(clazz, None, "Class name must not be plural")
263 if clazz.name.endswith("Observer"):
266 if clazz.name.endswith("Callback"):
271 if not re.match("on[A-Z][a-z]*", m.name):
279 If only a single method, it must match class name:
282 if clazz.name.endswith("Listener"):
287 if not re.match("on[A-Z][a-z]*", m.name):
290 if len(clazz.methods) == 1 and clazz.name.startswith("On"):
292 if (m.name + "Listener").lower() != clazz.name.lower():
293 error(clazz, m, "Single listener method name should match class name")
299 All action values must be scoped by package and match name:
305 if f.name.startswith("EXTRA_"): continue
306 if f.name == "SERVICE_INTERFACE" or f.name == "PROVIDER_INTERFACE": continue
309 if "_ACTION" in f.name or "ACTION_" in f.name or ".action." in f.value.lower():
310 if not f.name.startswith("ACTION_"):
311 error(clazz, f, "Intent action constant name must be ACTION_FOO")
320 prefix = clazz.pkg.name + ".action"
321 expected = prefix + "." + f.name[7:]
329 All extra values must be scoped by package and match name:
338 if f.name.startswith("ACTION_"): continue
341 if "_EXTRA" in f.name or "EXTRA_" in f.name or ".extra" in f.value.lower():
342 if not f.name.startswith("EXTRA_"):
345 if clazz.pkg.name == "android.content" and clazz.name == "Intent":
347 elif clazz.pkg.name == "android.app.admin":
350 prefix = clazz.pkg.name + ".extra"
351 expected = prefix + "." + f.name[6:]
358 methods = [ m.name for m in clazz.methods ]
368 creator = [ i for i in clazz.fields if i.name == "CREATOR" ]
369 write = [ i for i in clazz.methods if i.name == "writeToParcel" ]
370 describe = [ i for i in clazz.methods if i.name == "describeContents" ]
416 if not re.match("[a-z]([a-zA-Z]+)?", f.name):
419 if re.match("[ms][A-Z]", f.name):
422 if re.match("[A-Z_]+", f.name):
431 methods = [ m.name for m in clazz.methods ]
434 if m.name.startswith("register"):
435 other = "unregister" + m.name[8:]
438 if m.name.startswith("unregister"):
439 other = "register" + m.name[10:]
443 if m.name.startswith("add") or m.name.startswith("remove"):
447 if m.name.startswith("add"):
448 other = "remove" + m.name[3:]
451 if m.name.startswith("remove") and not m.name.startswith("removeAll"):
452 other = "add" + m.name[6:]
456 if m.name.startswith("register") or m.name.startswith("unregister"):
469 if clazz.name == "Intent": return
473 if m.name.startswith("create") and m.name.endswith("Intent"):
485 if not clazz.name.endswith("Service"):
486 error(clazz, None, "Inconsistent class name; should be FooService")
490 if f.name == "SERVICE_INTERFACE":
503 if not clazz.name.endswith("Provider"):
504 error(clazz, None, "Inconsistent class name; should be FooProvider")
508 if f.name == "PROVIDER_INTERFACE":
511 error(clazz, f, "Inconsistent interface name; expected %s" % (clazz.fullname))
521 if not clazz.name.endswith("Receiver"):
522 error(clazz, None, "Inconsistent class name; should be FooReceiver")
526 if not clazz.name.endswith("Activity"):
527 error(clazz, None, "Inconsistent class name; should be FooActivity")
532 if not re.match("on[A-Z]", m.name):
543 if not clazz.name.endswith("Builder"): return
545 if clazz.name != "Builder":
550 if m.name == "build":
554 if m.name.startswith("get"): continue
555 if m.name.startswith("clear"): continue
557 if m.name.startswith("with"):
560 if m.name.startswith("set"):
576 if clazz.pkg.name.startswith("com.android"):
606 cr = rank(clazz.pkg.name)
628 methods = [ m.name for m in clazz.methods ]
633 builder_methods = [ m.name for m in api[builder].methods ]
636 if m.typ == "boolean" and m.name.startswith("get") and m.name != "get" and len(m.args) == 0:
637 setter = "set" + m.name[3:]
664 if "FLAG_" in f.name:
670 scope = f.name[0:f.name.index("FLAG_")]
684 if clazz.pkg.name.startswith("java"): continue
685 if clazz.pkg.name.startswith("junit"): continue
686 if clazz.pkg.name.startswith("org.apache"): continue
687 if clazz.pkg.name.startswith("org.xml"): continue
688 if clazz.pkg.name.startswith("org.json"): continue
689 if clazz.pkg.name.startswith("org.w3c"): continue