class

Analyzer::Java::Struts2

Inherits Analyzer < FileHelper < Reference < Object

Constants

DEFAULT_LOCATORS = ["action", "actions", "struts", "struts2"]
REST_METHODS = {"index" => {"GET", ""}, "show" => {"GET", "/:id"}, "edit" => {"GET", "/:id/edit"}, "editNew" => {"GET", "/new"}, "deleteConfirm" => {"GET", "/:id/deleteConfirm"}, "create" => {"POST", ""}, "update" => {"PUT", "/:id"}, "destroy" => {"DELETE", "/:id"}}
STRUTS_CONFIG_BASENAMES = Set {"struts.xml", "struts-plugin.xml", "struts-deferred.xml"}
STRUTS_JAVA_SOURCE_RE = Regex.union("org.apache.struts2", "com.opensymphony.xwork2", "@Action", "@Namespace")

struts_java_source? gates the per-file convention-action scan; one precompiled Regex.union scan (PCRE2 JIT, auto-escapes each literal) replaces 4 separate String#includes? passes over the same buffer.

VALUE_KEY_PATTERN = /(?:^|[,({]\s*)value\s*=\s*"((?:\\.|[^"\\])*)"/m

Crystal recompiles an interpolated regex literal on every evaluation (a full PCRE2 JIT compile). Every caller probes the value key, so precompile its matcher once at load time.

Class methods

tech_name
Source

Instance methods

analyze
Source
tech

Instance-side view of the same declaration. The per-file rescues live on this base class, which has no way to name the analyzer that is running inside them, so a skipped file could not be attributed to a tech. Deriving it from analyzer_for keeps the name written exactly once.

Source

Nested types