MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / get_visibility

Method get_visibility

atomic-semantic/src/parsers/java.rs:580–590  ·  view source on GitHub ↗

Get the visibility modifier as a string ("public ", "private ", "protected ", or "").

(&self, node: &Node, source: &str)

Source from the content-addressed store, hash-verified

578
579 /// Get the visibility modifier as a string ("public ", "private ", "protected ", or "").
580 fn get_visibility(&self, node: &Node, source: &str) -> String {
581 if self.has_modifier(node, source, "public") {
582 "public ".to_string()
583 } else if self.has_modifier(node, source, "protected") {
584 "protected ".to_string()
585 } else if self.has_modifier(node, source, "private") {
586 "private ".to_string()
587 } else {
588 String::new() // package-private
589 }
590 }
591
592 /// Get the text content of a node.
593 fn node_text(&self, node: &Node, source: &str) -> String {

Callers 4

extract_constructorMethod · 0.80
build_class_signatureMethod · 0.80

Calls 1

has_modifierMethod · 0.80

Tested by

no test coverage detected