MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / visibility_of

Method visibility_of

codegraph-kernel/src/java.rs:412–429  ·  view source on GitHub ↗
(&self, node: Node)

Source from the content-addressed store, hash-verified

410 }
411
412 fn visibility_of(&self, node: Node) -> Option<u8> {
413 for i in 0..node.child_count() {
414 let child = node.child(i)?;
415 if child.kind() == "modifiers" {
416 let text = self.text(child);
417 if text.contains("public") {
418 return Some(1);
419 }
420 if text.contains("private") {
421 return Some(2);
422 }
423 if text.contains("protected") {
424 return Some(3);
425 }
426 }
427 }
428 None
429 }
430
431 fn is_static(&self, node: Node) -> bool {
432 // An interface constant is implicitly `public static final`.

Callers 5

extract_classMethod · 0.45
extract_methodMethod · 0.45
extract_functionMethod · 0.45
extract_enumMethod · 0.45
extract_fieldMethod · 0.45

Calls 1

textMethod · 0.65

Tested by

no test coverage detected