}
public String parseFunction(char[] src, int beginIndex, int endIndex, IWikiModel model) throws IOException {
if (model instanceof IContext) {
IContext context = (IContext) model;
List<String> list = new ArrayList<String>();
WikipediaScanner.splitByPipe(src, beginIndex, endIndex, list);
if (list.size() > 0) {
// name of the attribute
String attribute = parse(list.get(0), model);
if (attribute.length() > 0) {
String formatString = null;
String separatorString = null;
String nullvalueString = null;
if (list.size() > 1) {
// format string of the attribute
formatString = parse(list.get(1), model);
}
if (list.size() > 2) {
separatorString = parse(list.get(2), model);
if (separatorString.length() > 1) {
int begin = 0;
int end = separatorString.length();
if (separatorString.charAt(0) == '\'') {
begin = 1;
if (separatorString.charAt(end - 1) == '\'') {
end--;
} else {
begin = 0;
}
}
separatorString = separatorString.substring(begin, end);
}
}
if (list.size() > 3) {
nullvalueString = parse(list.get(3), model);
}
// get the assigned value of the attribute
Object value = context.getAttribute(attribute);
if (value != null) {
AttributeRenderer renderer;
StringBuilder builder;
if (value instanceof AttributeList && ((AttributeList) value).size() > 0) {
// multiple attribute values assigned