Class Identifiers

java.lang.Object
dk.mada.jaxrs.model.naming.Identifiers

public final class Identifiers extends Object
Make identifiers valid for java. https://docs.oracle.com/javase/specs/jls/se7/html/jls-3.html#jls-3.8 A dash causes the following char to be upper-cased (foo-bar becomes fooBar). A group of upper-cased chars will be lower cased (FOOBar becomes fooBar).
  • Constructor Details

    • Identifiers

      public Identifiers()
  • Method Details

    • makeValidVariableName

      public String makeValidVariableName(String input)
      Make a valid variable name for java. The initial character is lower-case. Example: FOOBar becomes fOOBar, fooBAR becomes fooBAR
      Parameters:
      input - the name
      Returns:
      a valid variable name
    • makeValidEdgeVariableName

      public String makeValidEdgeVariableName(String input)
      Make a valid variable name for java, down-casing on edges. The initial character is lower-case. Example: FOOBar becomes fooBar, fooBAR becomes fooBar
      Parameters:
      input - the name
      Returns:
      a valid variable name
    • makeValidTypeName

      public String makeValidTypeName(String input)
      Make a valid type name for java. The initial character is upper-case. Example: FOOBar becomes FOOBar, fooBAR becomes FooBAR
      Parameters:
      input - the name
      Returns:
      a valid type name
    • makeValidEdgeTypeName

      public String makeValidEdgeTypeName(String input)
      Make a valid type name for java, down-casing on edges. The initial character is upper-case. Example: FOOBar becomes FooBar, fooBAR becomes FooBar
      Parameters:
      input - the name
      Returns:
      a valid type name