org.apache.ws.jaxme.js
public class Util extends Object
Various static utility methods.
Method Summary | |
---|---|
static String | asJavaIdentifier(String pIdentifier) Takes as input an arbitrary String and maps it to a String, which is a valid Java identifier. |
static void | checkJavaIdentifier(String pName) Returns whether the given name is a valid Java identifier. |
static JavaSource | newJavaSource(JavaSourceFactory pFactory, Class pClass) Converts the given class into an instance of
JavaSource. |
Takes as input an arbitrary String and maps it to a String, which is a valid Java identifier. Mapping works as follows:
Parameters: pIdentifier The identifier being mapped
Throws: IllegalArgumentException The parameter pIdentifier
cannot be converted into a Java identifier, because it is null or
empty.
Returns whether the given name is a valid Java identifier. Works by using Character#isJavaIdentifierStart(char) and Character#isJavaIdentifierPart(char).
Throws: IllegalArgumentException The name is not valid. An explanation why is given in the detail message.