Search in sources :

Example 1 with Yii2SupportSettings

use of com.nvlad.yii2support.utils.Yii2SupportSettings in project yii2support by nvlad.

the class ViewUtil method getPatterns.

@NotNull
private static Map<Pattern, String> getPatterns(Project project) {
    Map<Pattern, String> patterns = projectViewPatterns.get(project);
    if (patterns == null) {
        patterns = new LinkedHashMap<>();
        Yii2SupportSettings settings = Yii2SupportSettings.getInstance(project);
        for (Map.Entry<String, String> entry : settings.viewPathMap.entrySet()) {
            String patternString = "^(" + entry.getKey().replace("*", "([\\w-]+)") + ").+";
            Pattern pattern = Pattern.compile(patternString);
            patterns.put(pattern, entry.getValue());
        }
        projectViewPatterns.put(project, patterns);
    }
    return patterns;
}
Also used : Pattern(java.util.regex.Pattern) Yii2SupportSettings(com.nvlad.yii2support.utils.Yii2SupportSettings) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

Yii2SupportSettings (com.nvlad.yii2support.utils.Yii2SupportSettings)1 Pattern (java.util.regex.Pattern)1 NotNull (org.jetbrains.annotations.NotNull)1