package org.apache.sling.scripting.java.impl;
The path has to be mapped to form a proper java class name.
- Parameters:
path- Returns:
- The mapped source path.
Converts the given identifier to a legal Java identifier
- Parameters:
identifier Identifier to convert- Returns:
- Legal Java identifier corresponding to the given identifier
modifiedIdentifier.append('_'); for (int i = 0; i < identifier.length(); i++) { char ch = identifier.charAt(i);
modifiedIdentifier.append(ch);
modifiedIdentifier.append('_'); modifiedIdentifier.append('_'); Mangle the specified character to create a legal Java class name.
char[] result = new char[5];
result[1] = Character.forDigit((ch >> 12) & 0xf, 16);
result[2] = Character.forDigit((ch >> 8) & 0xf, 16);
result[3] = Character.forDigit((ch >> 4) & 0xf, 16);
result[4] = Character.forDigit(ch & 0xf, 16);
"abstract", "assert", "boolean", "break", "byte", "case",
"catch", "char", "class", "const", "continue",
"default", "do", "double", "else", "enum", "extends",
"final", "finally", "float", "for", "goto",
"if", "implements", "import", "instanceof", "int",
"interface", "long", "native", "new", "package",
"private", "protected", "public", "return", "short",
"static", "strictfp", "super", "switch", "synchronized",
"this", "throws", "transient", "try", "void",
Test whether the argument is a Java keyword