org.milyn.ejc
Class EJCUtils

java.lang.Object
  extended by org.milyn.ejc.EJCUtils

public class EJCUtils
extends java.lang.Object

Utility class used when creating ClassModel and Binding file.


Constructor Summary
EJCUtils()
           
 
Method Summary
static java.lang.String deleteWithPascalNotation(java.lang.String value, char deleteChar)
          Removes all occurances of deleteChar and sets next character in value to uppercase.
static java.lang.String encodeAttributeName(JType type, java.lang.String name)
          Encodes a String into standard java attribute name convention.
static java.lang.String encodeAttributeName(java.lang.String name)
           
static java.lang.String encodeClassName(java.lang.String name)
          Encodes a String into standard java class name convention.
static java.lang.String encodeJavaIdentifier(java.lang.String identifier)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EJCUtils

public EJCUtils()
Method Detail

encodeClassName

public static java.lang.String encodeClassName(java.lang.String name)
                                        throws IllegalNameException
Encodes a String into standard java class name convention. The following steps are performed on the name: 1. First character is set to upper case. 2. Illegal characters like '-' and whitespace are removed.

Parameters:
name - the original class name.
Returns:
the class name complying with standard java class name convention.
Throws:
IllegalNameException - when class name is a reserved keyword in java.

encodeAttributeName

public static java.lang.String encodeAttributeName(JType type,
                                                   java.lang.String name)
                                            throws IllegalNameException
Encodes a String into standard java attribute name convention. The following steps are performed on the name: 1. First character is set to lower case. 2. Illegal characters like '-' and whitespace are removed. 3. If attributetype is a Collection a 's'-character is appended.

Parameters:
type - the type of attribute.
name - the original attribut name.
Returns:
the attribute name complying with standard java attribute name convention.
Throws:
IllegalNameException - when attribute name is a reserved keyword in java.

encodeAttributeName

public static java.lang.String encodeAttributeName(java.lang.String name)

encodeJavaIdentifier

public static java.lang.String encodeJavaIdentifier(java.lang.String identifier)

deleteWithPascalNotation

public static java.lang.String deleteWithPascalNotation(java.lang.String value,
                                                        char deleteChar)
Removes all occurances of deleteChar and sets next character in value to uppercase.

Parameters:
value - the String to perform deletion on.
deleteChar - the character to delete.
Returns:
the pascal notated String.


Copyright © 2011. All Rights Reserved.