com.sun.codemodel
Class JJavaName

java.lang.Object  extended by com.sun.codemodel.JJavaName

public class JJavaName
extends Object

Utility methods that convert arbitrary strings into Java identifiers.


Constructor Summary
JJavaName()
           
 
Method Summary
static StringgetPluralForm(String word)
          Experimental API: converts an English word into a plural form.
static booleanisFullyQualifiedClassName(String s)
          Checks if the given string is a valid fully qualified name.
static booleanisJavaIdentifier(String s)
          Checks if a given string is usable as a Java identifier.
static booleanisJavaPackageName(String s)
          Checks if the given string is a valid Java package name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JJavaName

public JJavaName()
Method Detail

isJavaIdentifier

public static boolean isJavaIdentifier(String s)
Checks if a given string is usable as a Java identifier.


isFullyQualifiedClassName

public static boolean isFullyQualifiedClassName(String s)
Checks if the given string is a valid fully qualified name.


isJavaPackageName

public static boolean isJavaPackageName(String s)
Checks if the given string is a valid Java package name.


getPluralForm

public static String getPluralForm(String word)
Experimental API: converts an English word into a plural form.

Parameters:
word - a word, such as "child", "apple". Must not be null. It accepts word concatanation forms that are common in programming languages, such as "my_child", "MyChild", "myChild", "MY-CHILD", "CODE003-child", etc, and mostly tries to do the right thing. ("my_children","MyChildren","myChildren", and "MY-CHILDREN", "CODE003-children" respectively)

Although this method only works for English words, it handles non-English words gracefully (by just returning it as-is.) For example, 日本語 will be returned as-is without modified, not "日本語s"

This method doesn't handle suffixes very well. For example, passing "person56" will return "person56s", not "people56".

Returns:
always non-null.


Copyright © 2005-2011
Oracle. All Rights Reserved.


NOTHING
NOTHING
Add the Maven Dependecy to your project: maven dependecy for com.amazonaws : aws-java-sdk : 1.3.14