All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.ybo.trackingplugin.tasks.utils.impl.patterns.JavaMethodPattern.kt Maven / Gradle / Ivy

Go to download

gradle plugin allowing to add automatic logs (or other process) at the start of each traced method

There is a newer version: 0.6.2
Show newest version
package com.ybo.trackingplugin.tasks.utils.impl.patterns

import com.ybo.trackingplugin.tasks.data.PatternToSearch
import com.ybo.trackingplugin.tasks.data.TraceAnnotationMark

internal class JavaMethodPattern(
    val markToLookFor: TraceAnnotationMark,
) : PatternToSearch {
    private val toProcessAnnotationShort: String = markToLookFor.shortVersion
    private val toProcessAnnotationLong: String = markToLookFor.longVersion
    override val name = JavaMethodPatternName.JavaNormalMethod
    override fun regex(): Regex {
        return Regex("($toProcessAnnotationShort|$toProcessAnnotationLong)\\s*\\n*(?:\\s*@[^\\n]*\\s*\\n*)*\\s*(?:public\\s+|protected\\s+|private\\s+|static\\s+|\\s)[\\w<>\\[\\]\\.]+\\s+(\\w+)\\s*\\(([^)]*)\\)\\s*\\{[ \\t]*\\n*([ \\t]*)")
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy