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

com.hypertino.inflector.naming.CamelCaseParser.scala Maven / Gradle / Ivy

package com.hypertino.inflector.naming

object CamelCaseParser extends IdentifierParser {
  override def parse(identifier: String, builder: IdentifierBuilder): Unit = {
    var prevIsSmallCaps = false
    for (c <- identifier) {
      if (c.isUpper) {
        if (prevIsSmallCaps) {
          builder.divider()
          builder.regular(c)
        }
        else {
          builder.regular(c)
        }
        prevIsSmallCaps = false
      }
      else {
        prevIsSmallCaps = true
        builder.regular(c)
      }
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy