Show FixtureSource.java syntax highlighted
package ca.ucalgary.cpsc.ebe.fitClipse.FixtureGenerater;
import java.util.StringTokenizer;
public abstract class FixtureSource {
private String wikiData;
public abstract String generateSource(String wikiData, String sourcePath) throws Exception;
public FixtureSource(){
}
protected static String toCamelCase(String in){
StringTokenizer tokens = new StringTokenizer(in, " ");
String cameledResult = "";
boolean first = true;
while(tokens.hasMoreTokens()){
String nextWord = tokens.nextToken();
if(!first){
char f = Character.toUpperCase(nextWord.charAt(0));
nextWord = String.valueOf(f) + nextWord.substring(1);
cameledResult += nextWord;
}else{
char f = Character.toLowerCase(nextWord.charAt(0));
nextWord = String.valueOf(f) + nextWord.substring(1);
cameledResult += nextWord;
first = false;
}
}
return cameledResult;
}
protected static String removeWhiteSpace(String in){
return in.replaceAll(" ", "").replaceAll("\\.", "");
}
protected static String removeWikiFormatting(String in){
String result = in;
result = result.replaceAll("\\|", "").replaceAll("''", "");
result = result.replaceAll("'''", "");
result = result.replaceAll("!-", "").replaceAll("-!", "");
return result;
}
protected static String[] parseJavaQName(String in) throws Exception{
String[] result = new String[2];
int index = in.lastIndexOf(".");
if(index == -1){
result[0] = "";
result[1] = in;
return result;
}
result[0] = in.substring(0, index);
result[1] = in.substring(index + 1);
return result;
}
}
See more files for this project here