class ScalaUtil extends AnyRef
By default scalaIdentifier uses underscores as needed for various cases that need translation of the given identifier to make it valid Scala. Similarly, getClassName also does some related logic.
With this flag set to true, both methods will change their logic to uses backticks instead of replacing or removing the characters that would make the resulting identifiers invalid.
- Alphabetic
- By Inheritance
- ScalaUtil
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
-
new
ScalaUtil(useBackticks: Boolean = false)
- useBackticks
False by default
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
getClassName(symbol: String): String
Returns a class name from the given symbol.
Returns a class name from the given symbol. If useBackticks: This is basically capitalizing the first character that can be capitalized. If none, then a
Uis prepended. Otherwise: Since underscores are specially used in generated code, this method camelizes the symbol in case of any underscores. -
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
def
scalaIdentifier(symbol: String): String
Returns a valid scala identifier from the given symbol:
Returns a valid scala identifier from the given symbol:
- encloses the symbol in backticks if the symbol is a scala reserved word; - appends an underscore if the symbol corresponds to a no-arg method in scope; - otherwise:
- returns symbol if it is a valid java identifier
- otherwise:
if useBackticks is true, encloses symbol in backticks
otherwise, returns
javaGenerator.javaIdentifier(symbol)
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )