in ruta-core/src/main/java/org/apache/uima/ruta/action/MarkReloadExtension.java [92:191]
public AbstractRutaAction createAction(String name, List<RutaExpression> args)
throws RutaParseException {
INumberExpression ignoreLength = null;
ITypeExpression typeExpr = null;
switch (name) {
case "MARKFASTRELOAD":
if(args.size() < 2) {
throw new RutaParseException("Not enough arguments for action " + name +": " + args);
}
IStringExpression listName= null;
IBooleanExpression ignore= null;
IBooleanExpression ignoreWS= null;
if(args.get(0) instanceof ITypeExpression) {
typeExpr = (ITypeExpression) args.get(0);
} else {
throw new RutaParseException("Expected typeExpr expression argument typeExpr for action " + name +" but got " + args.get(0).getClass().getName());
}
if(args.get(1) instanceof IStringExpression) {
listName = (IStringExpression) args.get(1);
} else {
throw new RutaParseException("Expected string expression argument listName for action " + name +" but got " + args.get(1).getClass().getName());
}
if(args.size() > 2 && args.get(2) instanceof IBooleanExpression) {
ignore = (IBooleanExpression) args.get(2);
} else {
throw new RutaParseException("Expected boolean expression argument ignore for action " + name +" but got " + args.get(2).getClass().getName());
}
if(args.size() > 3 && args.get(3) instanceof INumberExpression) {
ignoreLength = (INumberExpression) args.get(3);
} else {
throw new RutaParseException("Expected number expression argument ignoreLength for action " + name +" but got " + args.get(3).getClass().getName());
}
if(args.size() > 4 && args.get(4) instanceof IBooleanExpression) {
ignoreWS = (IBooleanExpression) args.get(4);
} else {
throw new RutaParseException("Expected boolean expression argument ignoreWS for action " + name +" but got " + args.get(4).getClass().getName());
}
return new MarkFastReloadAction(typeExpr, listName, ignore, ignoreLength, ignoreWS);
case "MARKTABLERELOAD":
if(args.size() < 3) {
throw new RutaParseException("Not enough arguments for action " + name +": " + args);
}
INumberExpression indexExpr = null;
IStringExpression tableName = null;
Map<IStringExpression, INumberExpression> featureMap = null;
IBooleanExpression ignoreCase = null;
IStringExpression ignoreChar = null;
INumberExpression maxIgnoreChar = null;
if(args.get(0) instanceof ITypeExpression) {
typeExpr = (ITypeExpression) args.get(0);
} else {
throw new RutaParseException("Expected type expression argument typeExpr for action " + name +" but got " + args.get(0).getClass().getName());
}
if(args.get(1) instanceof INumberExpression) {
indexExpr = (INumberExpression) args.get(1);
} else {
throw new RutaParseException("Expected number expression argument indexExpr for action " + name +" but got " + args.get(1).getClass().getName());
}
if(args.get(2) instanceof IStringExpression) {
tableName = (IStringExpression) args.get(2);
} else {
throw new RutaParseException("Expected string expression argument tableName for action " + name +" but got " + args.get(2).getClass().getName());
}
if(args.size() > 3 && args.get(3) instanceof Map) {
featureMap = (Map<IStringExpression, INumberExpression>) args.get(3);
} else {
throw new RutaParseException("Expected map argument featureMap for action " + name +" but got " + args.get(3).getClass().getName());
}
if(args.size() > 4 && args.get(4) instanceof IBooleanExpression) {
ignoreCase = (IBooleanExpression) args.get(4);
} else {
throw new RutaParseException("Expected boolean expression argument ignoreCase for action " + name +" but got " + args.get(4).getClass().getName());
}
if(args.size() > 5 && args.get(5) instanceof INumberExpression) {
ignoreLength = (INumberExpression) args.get(5);
} else {
throw new RutaParseException("Expected number expression argument ignoreLength for action " + name +" but got " + args.get(5).getClass().getName());
}
if(args.size() > 6 && args.get(6) instanceof IStringExpression) {
ignoreChar = (IStringExpression) args.get(6);
} else {
throw new RutaParseException("Expected boolean expression argument ignoreChar for action " + name +" but got " + args.get(6).getClass().getName());
}
if(args.size() > 7 && args.get(7) instanceof INumberExpression) {
maxIgnoreChar = (INumberExpression) args.get(7);
} else {
throw new RutaParseException("Expected number expression argument maxIgnoreChar for action " + name +" but got " + args.get(7).getClass().getName());
}
return new MarkTableReloadAction(typeExpr, indexExpr, tableName, featureMap, ignoreCase, ignoreLength, ignoreChar, maxIgnoreChar);
default:
break;
}
return null;
}