AnnotatedFieldNameUtil { public static String sanitizeXmlElementName(String name) { return sanitizeXmlElementName(name, "_"); } private  AnnotatedFieldNameUtil(); static BookkeepFieldType whichBookkeepingSubfield(String bookkeepName); static String contentIdField(String fieldName); static String forwardIndexIdField(String annotFieldName); static String lengthTokensField(String fieldName); static String tagAnnotationField(String fieldName); static String annotationField(String fieldName, String annotName, String sensitivityName); static String annotationField(String fieldName, String annotName); static String annotationSensitivity(String fieldAnnotName, String sensitivityName); static String[] getNameComponents(String luceneFieldName); static String getBaseName(String luceneFieldName); static String getDefaultMainAnnotationName(); static MatchSensitivity sensitivity(String luceneField); static boolean isAnnotatedField(String luceneFieldName); static boolean isValidXmlElementName(String name); static String sanitizeXmlElementName(String name); static String sanitizeXmlElementName(String name, String replaceChar); static final String FORWARD_INDEX_ID_BOOKKEEP_NAME; static final String TAGS_ANNOT_NAME; static final String WORD_ANNOT_NAME; static final String PUNCTUATION_ANNOT_NAME; static final String LEMMA_ANNOT_NAME; static final String SUBANNOTATION_FIELD_PREFIX_SEPARATOR; static final String SUBANNOTATION_SEPARATOR; }
@Test public void testSanitizeXmlElementName() { Assert.assertEquals("word", AnnotatedFieldNameUtil.sanitizeXmlElementName("word")); Assert.assertEquals("_0word", AnnotatedFieldNameUtil.sanitizeXmlElementName("0word")); Assert.assertEquals("_xmlword", AnnotatedFieldNameUtil.sanitizeXmlElementName("xmlword")); Assert.assertEquals("fun_word", AnnotatedFieldNameUtil.sanitizeXmlElementName("fun-word")); Assert.assertEquals("fun.word", AnnotatedFieldNameUtil.sanitizeXmlElementName("fun.word")); Assert.assertEquals("fun_word", AnnotatedFieldNameUtil.sanitizeXmlElementName("fun_word")); Assert.assertEquals("word0", AnnotatedFieldNameUtil.sanitizeXmlElementName("word0")); }