@Test public void testProcessMagicWordNAMESPACENUMBERWithParameter() throws Exception { final String number = MagicWord.processMagicWord(MagicWord.MagicWordE.MAGIC_NAMESPACENUMBER, "User:Foo", wikiModel); assertThat(number).isEqualTo("2"); }
public static String processMagicWord(MagicWordE magicWord, String parameter, IWikiModel model) { assert(magicWord != null); SimpleDateFormat formatter = model.getSimpleDateFormat(); Date current = model.getCurrentTimeStamp(); if (current == null) { current = new Date(System.currentTimeMillis()); } switch (magicWord) { case MAGIC_LOCAL_DAY: formatter.applyPattern("d"); return formatter.format(current); case MAGIC_LOCAL_DAY2: formatter.applyPattern("dd"); return formatter.format(current); case MAGIC_LOCAL_DAY_NAME: formatter.applyPattern("EEEE"); return formatter.format(current); case MAGIC_LOCAL_DAY_OF_WEEK: formatter.applyPattern("F"); return formatter.format(current); case MAGIC_LOCAL_MONTH: formatter.applyPattern("MM"); return formatter.format(current); case MAGIC_LOCAL_MONTH_ABBR: formatter.applyPattern("MMM"); return formatter.format(current); case MAGIC_LOCAL_MONTH_NAME: formatter.applyPattern("MMMM"); return formatter.format(current); case MAGIC_LOCAL_TIME: formatter.applyPattern("HH:mm"); return formatter.format(current); case MAGIC_LOCAL_HOUR: formatter.applyPattern("HH"); return formatter.format(current); case MAGIC_LOCAL_WEEK: formatter.applyPattern("w"); return formatter.format(current); case MAGIC_LOCAL_YEAR: formatter.applyPattern("yyyy"); return formatter.format(current); case MAGIC_LOCAL_TIMESTAMP: formatter.applyPattern("yyyyMMddHHmmss"); return formatter.format(current); case MAGIC_CURRENT_DAY: formatter.applyPattern("d"); return formatter.format(current); case MAGIC_CURRENT_DAY2: formatter.applyPattern("dd"); return formatter.format(current); case MAGIC_CURRENT_DAY_NAME: formatter.applyPattern("EEEE"); return formatter.format(current); case MAGIC_CURRENT_DAY_OF_WEEK: formatter.applyPattern("F"); return formatter.format(current); case MAGIC_CURRENT_MONTH: formatter.applyPattern("MM"); return formatter.format(current); case MAGIC_CURRENT_MONTH_ABBR: formatter.applyPattern("MMM"); return formatter.format(current); case MAGIC_CURRENT_MONTH_NAME: formatter.applyPattern("MMMM"); return formatter.format(current); case MAGIC_CURRENT_TIME: formatter.applyPattern("HH:mm"); return formatter.format(current); case MAGIC_CURRENT_HOUR: formatter.applyPattern("HH"); return formatter.format(current); case MAGIC_CURRENT_WEEK: formatter.applyPattern("w"); return formatter.format(current); case MAGIC_CURRENT_YEAR: formatter.applyPattern("yyyy"); return formatter.format(current); case MAGIC_CURRENT_TIMESTAMP: formatter.applyPattern("yyyyMMddHHmmss"); return formatter.format(current); case MAGIC_PAGE_NAME: { String pagename = getPagenameHelper(parameter, model); if (pagename != null) { return pagename; } else { return ""; } } case MAGIC_PAGE_NAME_E: { String pagename = getPagenameHelper(parameter, model); if (pagename != null) { return model.encodeTitleToUrl(pagename, true); } else { return ""; } } case MAGIC_NAMESPACE: return getNamespace(parameter, model); case MAGIC_NAMESPACE_E: return model.encodeTitleToUrl(getNamespace(parameter, model), true); case MAGIC_NAMESPACENUMBER: { final INamespaceValue namespaceHelper = getNamespaceHelper(parameter, model); if (namespaceHelper != null) { return namespaceHelper.getCode().code.toString(); } else { return null; } } case MAGIC_TALK_SPACE: return getTalkspace(parameter, model); case MAGIC_TALK_SPACE_E: return model.encodeTitleToUrl(getTalkspace(parameter, model), true); case MAGIC_SUBJECT_SPACE: case MAGIC_ARTICLE_SPACE: return getSubjectSpace(parameter, model); case MAGIC_SUBJECT_SPACE_E: case MAGIC_ARTICLE_SPACE_E: return model.encodeTitleToUrl(getSubjectSpace(parameter, model), true); case MAGIC_FULL_PAGE_NAME: return getFullpagename(parameter, model); case MAGIC_FULL_PAGE_NAME_E: return model.encodeTitleToUrl(getFullpagename(parameter, model), true); case MAGIC_TALK_PAGE_NAME: return getTalkpage(parameter, model); case MAGIC_TALK_PAGE_NAME_E: return model.encodeTitleToUrl(getTalkpage(parameter, model), true); case MAGIC_SUBJECT_PAGE_NAME: case MAGIC_ARTICLE_PAGE_NAME: return getSubjectpage(parameter, model); case MAGIC_SUBJECT_PAGE_NAME_E: case MAGIC_ARTICLE_PAGE_NAME_E: return model.encodeTitleToUrl(getSubjectpage(parameter, model), true); case MAGIC_BASE_PAGE_NAME: return getBasePageName(parameter, model); case MAGIC_BASE_PAGE_NAME_E: return model.encodeTitleToUrl(getBasePageName(parameter, model), true); case MAGIC_SUB_PAGE_NAME: return getSubPageName(parameter, model); case MAGIC_SUB_PAGE_NAME_E: return model.encodeTitleToUrl(getSubPageName(parameter, model), false); default: break; } return magicWord.toString(); }
MagicWord { public static String processMagicWord(MagicWordE magicWord, String parameter, IWikiModel model) { assert(magicWord != null); SimpleDateFormat formatter = model.getSimpleDateFormat(); Date current = model.getCurrentTimeStamp(); if (current == null) { current = new Date(System.currentTimeMillis()); } switch (magicWord) { case MAGIC_LOCAL_DAY: formatter.applyPattern("d"); return formatter.format(current); case MAGIC_LOCAL_DAY2: formatter.applyPattern("dd"); return formatter.format(current); case MAGIC_LOCAL_DAY_NAME: formatter.applyPattern("EEEE"); return formatter.format(current); case MAGIC_LOCAL_DAY_OF_WEEK: formatter.applyPattern("F"); return formatter.format(current); case MAGIC_LOCAL_MONTH: formatter.applyPattern("MM"); return formatter.format(current); case MAGIC_LOCAL_MONTH_ABBR: formatter.applyPattern("MMM"); return formatter.format(current); case MAGIC_LOCAL_MONTH_NAME: formatter.applyPattern("MMMM"); return formatter.format(current); case MAGIC_LOCAL_TIME: formatter.applyPattern("HH:mm"); return formatter.format(current); case MAGIC_LOCAL_HOUR: formatter.applyPattern("HH"); return formatter.format(current); case MAGIC_LOCAL_WEEK: formatter.applyPattern("w"); return formatter.format(current); case MAGIC_LOCAL_YEAR: formatter.applyPattern("yyyy"); return formatter.format(current); case MAGIC_LOCAL_TIMESTAMP: formatter.applyPattern("yyyyMMddHHmmss"); return formatter.format(current); case MAGIC_CURRENT_DAY: formatter.applyPattern("d"); return formatter.format(current); case MAGIC_CURRENT_DAY2: formatter.applyPattern("dd"); return formatter.format(current); case MAGIC_CURRENT_DAY_NAME: formatter.applyPattern("EEEE"); return formatter.format(current); case MAGIC_CURRENT_DAY_OF_WEEK: formatter.applyPattern("F"); return formatter.format(current); case MAGIC_CURRENT_MONTH: formatter.applyPattern("MM"); return formatter.format(current); case MAGIC_CURRENT_MONTH_ABBR: formatter.applyPattern("MMM"); return formatter.format(current); case MAGIC_CURRENT_MONTH_NAME: formatter.applyPattern("MMMM"); return formatter.format(current); case MAGIC_CURRENT_TIME: formatter.applyPattern("HH:mm"); return formatter.format(current); case MAGIC_CURRENT_HOUR: formatter.applyPattern("HH"); return formatter.format(current); case MAGIC_CURRENT_WEEK: formatter.applyPattern("w"); return formatter.format(current); case MAGIC_CURRENT_YEAR: formatter.applyPattern("yyyy"); return formatter.format(current); case MAGIC_CURRENT_TIMESTAMP: formatter.applyPattern("yyyyMMddHHmmss"); return formatter.format(current); case MAGIC_PAGE_NAME: { String pagename = getPagenameHelper(parameter, model); if (pagename != null) { return pagename; } else { return ""; } } case MAGIC_PAGE_NAME_E: { String pagename = getPagenameHelper(parameter, model); if (pagename != null) { return model.encodeTitleToUrl(pagename, true); } else { return ""; } } case MAGIC_NAMESPACE: return getNamespace(parameter, model); case MAGIC_NAMESPACE_E: return model.encodeTitleToUrl(getNamespace(parameter, model), true); case MAGIC_NAMESPACENUMBER: { final INamespaceValue namespaceHelper = getNamespaceHelper(parameter, model); if (namespaceHelper != null) { return namespaceHelper.getCode().code.toString(); } else { return null; } } case MAGIC_TALK_SPACE: return getTalkspace(parameter, model); case MAGIC_TALK_SPACE_E: return model.encodeTitleToUrl(getTalkspace(parameter, model), true); case MAGIC_SUBJECT_SPACE: case MAGIC_ARTICLE_SPACE: return getSubjectSpace(parameter, model); case MAGIC_SUBJECT_SPACE_E: case MAGIC_ARTICLE_SPACE_E: return model.encodeTitleToUrl(getSubjectSpace(parameter, model), true); case MAGIC_FULL_PAGE_NAME: return getFullpagename(parameter, model); case MAGIC_FULL_PAGE_NAME_E: return model.encodeTitleToUrl(getFullpagename(parameter, model), true); case MAGIC_TALK_PAGE_NAME: return getTalkpage(parameter, model); case MAGIC_TALK_PAGE_NAME_E: return model.encodeTitleToUrl(getTalkpage(parameter, model), true); case MAGIC_SUBJECT_PAGE_NAME: case MAGIC_ARTICLE_PAGE_NAME: return getSubjectpage(parameter, model); case MAGIC_SUBJECT_PAGE_NAME_E: case MAGIC_ARTICLE_PAGE_NAME_E: return model.encodeTitleToUrl(getSubjectpage(parameter, model), true); case MAGIC_BASE_PAGE_NAME: return getBasePageName(parameter, model); case MAGIC_BASE_PAGE_NAME_E: return model.encodeTitleToUrl(getBasePageName(parameter, model), true); case MAGIC_SUB_PAGE_NAME: return getSubPageName(parameter, model); case MAGIC_SUB_PAGE_NAME_E: return model.encodeTitleToUrl(getSubPageName(parameter, model), false); default: break; } return magicWord.toString(); } }
MagicWord { public static String processMagicWord(MagicWordE magicWord, String parameter, IWikiModel model) { assert(magicWord != null); SimpleDateFormat formatter = model.getSimpleDateFormat(); Date current = model.getCurrentTimeStamp(); if (current == null) { current = new Date(System.currentTimeMillis()); } switch (magicWord) { case MAGIC_LOCAL_DAY: formatter.applyPattern("d"); return formatter.format(current); case MAGIC_LOCAL_DAY2: formatter.applyPattern("dd"); return formatter.format(current); case MAGIC_LOCAL_DAY_NAME: formatter.applyPattern("EEEE"); return formatter.format(current); case MAGIC_LOCAL_DAY_OF_WEEK: formatter.applyPattern("F"); return formatter.format(current); case MAGIC_LOCAL_MONTH: formatter.applyPattern("MM"); return formatter.format(current); case MAGIC_LOCAL_MONTH_ABBR: formatter.applyPattern("MMM"); return formatter.format(current); case MAGIC_LOCAL_MONTH_NAME: formatter.applyPattern("MMMM"); return formatter.format(current); case MAGIC_LOCAL_TIME: formatter.applyPattern("HH:mm"); return formatter.format(current); case MAGIC_LOCAL_HOUR: formatter.applyPattern("HH"); return formatter.format(current); case MAGIC_LOCAL_WEEK: formatter.applyPattern("w"); return formatter.format(current); case MAGIC_LOCAL_YEAR: formatter.applyPattern("yyyy"); return formatter.format(current); case MAGIC_LOCAL_TIMESTAMP: formatter.applyPattern("yyyyMMddHHmmss"); return formatter.format(current); case MAGIC_CURRENT_DAY: formatter.applyPattern("d"); return formatter.format(current); case MAGIC_CURRENT_DAY2: formatter.applyPattern("dd"); return formatter.format(current); case MAGIC_CURRENT_DAY_NAME: formatter.applyPattern("EEEE"); return formatter.format(current); case MAGIC_CURRENT_DAY_OF_WEEK: formatter.applyPattern("F"); return formatter.format(current); case MAGIC_CURRENT_MONTH: formatter.applyPattern("MM"); return formatter.format(current); case MAGIC_CURRENT_MONTH_ABBR: formatter.applyPattern("MMM"); return formatter.format(current); case MAGIC_CURRENT_MONTH_NAME: formatter.applyPattern("MMMM"); return formatter.format(current); case MAGIC_CURRENT_TIME: formatter.applyPattern("HH:mm"); return formatter.format(current); case MAGIC_CURRENT_HOUR: formatter.applyPattern("HH"); return formatter.format(current); case MAGIC_CURRENT_WEEK: formatter.applyPattern("w"); return formatter.format(current); case MAGIC_CURRENT_YEAR: formatter.applyPattern("yyyy"); return formatter.format(current); case MAGIC_CURRENT_TIMESTAMP: formatter.applyPattern("yyyyMMddHHmmss"); return formatter.format(current); case MAGIC_PAGE_NAME: { String pagename = getPagenameHelper(parameter, model); if (pagename != null) { return pagename; } else { return ""; } } case MAGIC_PAGE_NAME_E: { String pagename = getPagenameHelper(parameter, model); if (pagename != null) { return model.encodeTitleToUrl(pagename, true); } else { return ""; } } case MAGIC_NAMESPACE: return getNamespace(parameter, model); case MAGIC_NAMESPACE_E: return model.encodeTitleToUrl(getNamespace(parameter, model), true); case MAGIC_NAMESPACENUMBER: { final INamespaceValue namespaceHelper = getNamespaceHelper(parameter, model); if (namespaceHelper != null) { return namespaceHelper.getCode().code.toString(); } else { return null; } } case MAGIC_TALK_SPACE: return getTalkspace(parameter, model); case MAGIC_TALK_SPACE_E: return model.encodeTitleToUrl(getTalkspace(parameter, model), true); case MAGIC_SUBJECT_SPACE: case MAGIC_ARTICLE_SPACE: return getSubjectSpace(parameter, model); case MAGIC_SUBJECT_SPACE_E: case MAGIC_ARTICLE_SPACE_E: return model.encodeTitleToUrl(getSubjectSpace(parameter, model), true); case MAGIC_FULL_PAGE_NAME: return getFullpagename(parameter, model); case MAGIC_FULL_PAGE_NAME_E: return model.encodeTitleToUrl(getFullpagename(parameter, model), true); case MAGIC_TALK_PAGE_NAME: return getTalkpage(parameter, model); case MAGIC_TALK_PAGE_NAME_E: return model.encodeTitleToUrl(getTalkpage(parameter, model), true); case MAGIC_SUBJECT_PAGE_NAME: case MAGIC_ARTICLE_PAGE_NAME: return getSubjectpage(parameter, model); case MAGIC_SUBJECT_PAGE_NAME_E: case MAGIC_ARTICLE_PAGE_NAME_E: return model.encodeTitleToUrl(getSubjectpage(parameter, model), true); case MAGIC_BASE_PAGE_NAME: return getBasePageName(parameter, model); case MAGIC_BASE_PAGE_NAME_E: return model.encodeTitleToUrl(getBasePageName(parameter, model), true); case MAGIC_SUB_PAGE_NAME: return getSubPageName(parameter, model); case MAGIC_SUB_PAGE_NAME_E: return model.encodeTitleToUrl(getSubPageName(parameter, model), false); default: break; } return magicWord.toString(); }  }
MagicWord { public static String processMagicWord(MagicWordE magicWord, String parameter, IWikiModel model) { assert(magicWord != null); SimpleDateFormat formatter = model.getSimpleDateFormat(); Date current = model.getCurrentTimeStamp(); if (current == null) { current = new Date(System.currentTimeMillis()); } switch (magicWord) { case MAGIC_LOCAL_DAY: formatter.applyPattern("d"); return formatter.format(current); case MAGIC_LOCAL_DAY2: formatter.applyPattern("dd"); return formatter.format(current); case MAGIC_LOCAL_DAY_NAME: formatter.applyPattern("EEEE"); return formatter.format(current); case MAGIC_LOCAL_DAY_OF_WEEK: formatter.applyPattern("F"); return formatter.format(current); case MAGIC_LOCAL_MONTH: formatter.applyPattern("MM"); return formatter.format(current); case MAGIC_LOCAL_MONTH_ABBR: formatter.applyPattern("MMM"); return formatter.format(current); case MAGIC_LOCAL_MONTH_NAME: formatter.applyPattern("MMMM"); return formatter.format(current); case MAGIC_LOCAL_TIME: formatter.applyPattern("HH:mm"); return formatter.format(current); case MAGIC_LOCAL_HOUR: formatter.applyPattern("HH"); return formatter.format(current); case MAGIC_LOCAL_WEEK: formatter.applyPattern("w"); return formatter.format(current); case MAGIC_LOCAL_YEAR: formatter.applyPattern("yyyy"); return formatter.format(current); case MAGIC_LOCAL_TIMESTAMP: formatter.applyPattern("yyyyMMddHHmmss"); return formatter.format(current); case MAGIC_CURRENT_DAY: formatter.applyPattern("d"); return formatter.format(current); case MAGIC_CURRENT_DAY2: formatter.applyPattern("dd"); return formatter.format(current); case MAGIC_CURRENT_DAY_NAME: formatter.applyPattern("EEEE"); return formatter.format(current); case MAGIC_CURRENT_DAY_OF_WEEK: formatter.applyPattern("F"); return formatter.format(current); case MAGIC_CURRENT_MONTH: formatter.applyPattern("MM"); return formatter.format(current); case MAGIC_CURRENT_MONTH_ABBR: formatter.applyPattern("MMM"); return formatter.format(current); case MAGIC_CURRENT_MONTH_NAME: formatter.applyPattern("MMMM"); return formatter.format(current); case MAGIC_CURRENT_TIME: formatter.applyPattern("HH:mm"); return formatter.format(current); case MAGIC_CURRENT_HOUR: formatter.applyPattern("HH"); return formatter.format(current); case MAGIC_CURRENT_WEEK: formatter.applyPattern("w"); return formatter.format(current); case MAGIC_CURRENT_YEAR: formatter.applyPattern("yyyy"); return formatter.format(current); case MAGIC_CURRENT_TIMESTAMP: formatter.applyPattern("yyyyMMddHHmmss"); return formatter.format(current); case MAGIC_PAGE_NAME: { String pagename = getPagenameHelper(parameter, model); if (pagename != null) { return pagename; } else { return ""; } } case MAGIC_PAGE_NAME_E: { String pagename = getPagenameHelper(parameter, model); if (pagename != null) { return model.encodeTitleToUrl(pagename, true); } else { return ""; } } case MAGIC_NAMESPACE: return getNamespace(parameter, model); case MAGIC_NAMESPACE_E: return model.encodeTitleToUrl(getNamespace(parameter, model), true); case MAGIC_NAMESPACENUMBER: { final INamespaceValue namespaceHelper = getNamespaceHelper(parameter, model); if (namespaceHelper != null) { return namespaceHelper.getCode().code.toString(); } else { return null; } } case MAGIC_TALK_SPACE: return getTalkspace(parameter, model); case MAGIC_TALK_SPACE_E: return model.encodeTitleToUrl(getTalkspace(parameter, model), true); case MAGIC_SUBJECT_SPACE: case MAGIC_ARTICLE_SPACE: return getSubjectSpace(parameter, model); case MAGIC_SUBJECT_SPACE_E: case MAGIC_ARTICLE_SPACE_E: return model.encodeTitleToUrl(getSubjectSpace(parameter, model), true); case MAGIC_FULL_PAGE_NAME: return getFullpagename(parameter, model); case MAGIC_FULL_PAGE_NAME_E: return model.encodeTitleToUrl(getFullpagename(parameter, model), true); case MAGIC_TALK_PAGE_NAME: return getTalkpage(parameter, model); case MAGIC_TALK_PAGE_NAME_E: return model.encodeTitleToUrl(getTalkpage(parameter, model), true); case MAGIC_SUBJECT_PAGE_NAME: case MAGIC_ARTICLE_PAGE_NAME: return getSubjectpage(parameter, model); case MAGIC_SUBJECT_PAGE_NAME_E: case MAGIC_ARTICLE_PAGE_NAME_E: return model.encodeTitleToUrl(getSubjectpage(parameter, model), true); case MAGIC_BASE_PAGE_NAME: return getBasePageName(parameter, model); case MAGIC_BASE_PAGE_NAME_E: return model.encodeTitleToUrl(getBasePageName(parameter, model), true); case MAGIC_SUB_PAGE_NAME: return getSubPageName(parameter, model); case MAGIC_SUB_PAGE_NAME_E: return model.encodeTitleToUrl(getSubPageName(parameter, model), false); default: break; } return magicWord.toString(); }  static boolean isMagicWord(String name); static MagicWordE getMagicWord(String name); static String processMagicWord(MagicWordE magicWord, String parameter, IWikiModel model); }
MagicWord { public static String processMagicWord(MagicWordE magicWord, String parameter, IWikiModel model) { assert(magicWord != null); SimpleDateFormat formatter = model.getSimpleDateFormat(); Date current = model.getCurrentTimeStamp(); if (current == null) { current = new Date(System.currentTimeMillis()); } switch (magicWord) { case MAGIC_LOCAL_DAY: formatter.applyPattern("d"); return formatter.format(current); case MAGIC_LOCAL_DAY2: formatter.applyPattern("dd"); return formatter.format(current); case MAGIC_LOCAL_DAY_NAME: formatter.applyPattern("EEEE"); return formatter.format(current); case MAGIC_LOCAL_DAY_OF_WEEK: formatter.applyPattern("F"); return formatter.format(current); case MAGIC_LOCAL_MONTH: formatter.applyPattern("MM"); return formatter.format(current); case MAGIC_LOCAL_MONTH_ABBR: formatter.applyPattern("MMM"); return formatter.format(current); case MAGIC_LOCAL_MONTH_NAME: formatter.applyPattern("MMMM"); return formatter.format(current); case MAGIC_LOCAL_TIME: formatter.applyPattern("HH:mm"); return formatter.format(current); case MAGIC_LOCAL_HOUR: formatter.applyPattern("HH"); return formatter.format(current); case MAGIC_LOCAL_WEEK: formatter.applyPattern("w"); return formatter.format(current); case MAGIC_LOCAL_YEAR: formatter.applyPattern("yyyy"); return formatter.format(current); case MAGIC_LOCAL_TIMESTAMP: formatter.applyPattern("yyyyMMddHHmmss"); return formatter.format(current); case MAGIC_CURRENT_DAY: formatter.applyPattern("d"); return formatter.format(current); case MAGIC_CURRENT_DAY2: formatter.applyPattern("dd"); return formatter.format(current); case MAGIC_CURRENT_DAY_NAME: formatter.applyPattern("EEEE"); return formatter.format(current); case MAGIC_CURRENT_DAY_OF_WEEK: formatter.applyPattern("F"); return formatter.format(current); case MAGIC_CURRENT_MONTH: formatter.applyPattern("MM"); return formatter.format(current); case MAGIC_CURRENT_MONTH_ABBR: formatter.applyPattern("MMM"); return formatter.format(current); case MAGIC_CURRENT_MONTH_NAME: formatter.applyPattern("MMMM"); return formatter.format(current); case MAGIC_CURRENT_TIME: formatter.applyPattern("HH:mm"); return formatter.format(current); case MAGIC_CURRENT_HOUR: formatter.applyPattern("HH"); return formatter.format(current); case MAGIC_CURRENT_WEEK: formatter.applyPattern("w"); return formatter.format(current); case MAGIC_CURRENT_YEAR: formatter.applyPattern("yyyy"); return formatter.format(current); case MAGIC_CURRENT_TIMESTAMP: formatter.applyPattern("yyyyMMddHHmmss"); return formatter.format(current); case MAGIC_PAGE_NAME: { String pagename = getPagenameHelper(parameter, model); if (pagename != null) { return pagename; } else { return ""; } } case MAGIC_PAGE_NAME_E: { String pagename = getPagenameHelper(parameter, model); if (pagename != null) { return model.encodeTitleToUrl(pagename, true); } else { return ""; } } case MAGIC_NAMESPACE: return getNamespace(parameter, model); case MAGIC_NAMESPACE_E: return model.encodeTitleToUrl(getNamespace(parameter, model), true); case MAGIC_NAMESPACENUMBER: { final INamespaceValue namespaceHelper = getNamespaceHelper(parameter, model); if (namespaceHelper != null) { return namespaceHelper.getCode().code.toString(); } else { return null; } } case MAGIC_TALK_SPACE: return getTalkspace(parameter, model); case MAGIC_TALK_SPACE_E: return model.encodeTitleToUrl(getTalkspace(parameter, model), true); case MAGIC_SUBJECT_SPACE: case MAGIC_ARTICLE_SPACE: return getSubjectSpace(parameter, model); case MAGIC_SUBJECT_SPACE_E: case MAGIC_ARTICLE_SPACE_E: return model.encodeTitleToUrl(getSubjectSpace(parameter, model), true); case MAGIC_FULL_PAGE_NAME: return getFullpagename(parameter, model); case MAGIC_FULL_PAGE_NAME_E: return model.encodeTitleToUrl(getFullpagename(parameter, model), true); case MAGIC_TALK_PAGE_NAME: return getTalkpage(parameter, model); case MAGIC_TALK_PAGE_NAME_E: return model.encodeTitleToUrl(getTalkpage(parameter, model), true); case MAGIC_SUBJECT_PAGE_NAME: case MAGIC_ARTICLE_PAGE_NAME: return getSubjectpage(parameter, model); case MAGIC_SUBJECT_PAGE_NAME_E: case MAGIC_ARTICLE_PAGE_NAME_E: return model.encodeTitleToUrl(getSubjectpage(parameter, model), true); case MAGIC_BASE_PAGE_NAME: return getBasePageName(parameter, model); case MAGIC_BASE_PAGE_NAME_E: return model.encodeTitleToUrl(getBasePageName(parameter, model), true); case MAGIC_SUB_PAGE_NAME: return getSubPageName(parameter, model); case MAGIC_SUB_PAGE_NAME_E: return model.encodeTitleToUrl(getSubPageName(parameter, model), false); default: break; } return magicWord.toString(); }  static boolean isMagicWord(String name); static MagicWordE getMagicWord(String name); static String processMagicWord(MagicWordE magicWord, String parameter, IWikiModel model);  }