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

com.citytechinc.cq.component.dialog.transformer.LowerCaseDashTransformer Maven / Gradle / Ivy

There is a newer version: 7.0.0
Show newest version
package com.citytechinc.cq.component.dialog.transformer;

import com.citytechinc.cq.component.annotations.transformer.Transformer;
import com.citytechinc.cq.component.dialog.ComponentNameTransformer;

@Transformer("lower-case-dash")
public class LowerCaseDashTransformer implements ComponentNameTransformer {

    public String transform(String className) {
        return className
            .replaceAll(
                String.format("%s|%s|%s", "(?<=[A-Z])(?=[A-Z][a-z])", "(?<=[^A-Z])(?=[A-Z])",
                    "(?<=[A-Za-z])(?=[^A-Za-z])"), "-").toLowerCase();
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy