@Test public void testCreateTypePrioritiesFromClasses() throws Exception { TypePriorities prio = createTypePriorities(Annotation.class); CasCreationUtils.createCas(createTypeSystemDescription(), prio, null); assertThat(prio.getPriorityLists()).hasSize(1); assertThat(prio.getPriorityLists()[0].getTypes()).containsExactly(CAS.TYPE_NAME_ANNOTATION); }
@SafeVarargs public static TypePriorities createTypePriorities(Class<? extends TOP>... prioritizedTypes) { String[] typeNames = new String[prioritizedTypes.length]; for (int i = 0; i < prioritizedTypes.length; i++) { if (!TOP.class.isAssignableFrom(prioritizedTypes[i])) { throw new IllegalArgumentException("[" + prioritizedTypes[i] + "] is not a JCas type"); } String typeName = prioritizedTypes[i].getName(); if (typeName.startsWith(UIMA_BUILTIN_JCAS_PREFIX)) { typeName = "uima." + typeName.substring(UIMA_BUILTIN_JCAS_PREFIX.length()); } typeNames[i] = typeName; } return createTypePriorities(typeNames); }
TypePrioritiesFactory { @SafeVarargs public static TypePriorities createTypePriorities(Class<? extends TOP>... prioritizedTypes) { String[] typeNames = new String[prioritizedTypes.length]; for (int i = 0; i < prioritizedTypes.length; i++) { if (!TOP.class.isAssignableFrom(prioritizedTypes[i])) { throw new IllegalArgumentException("[" + prioritizedTypes[i] + "] is not a JCas type"); } String typeName = prioritizedTypes[i].getName(); if (typeName.startsWith(UIMA_BUILTIN_JCAS_PREFIX)) { typeName = "uima." + typeName.substring(UIMA_BUILTIN_JCAS_PREFIX.length()); } typeNames[i] = typeName; } return createTypePriorities(typeNames); } }
TypePrioritiesFactory { @SafeVarargs public static TypePriorities createTypePriorities(Class<? extends TOP>... prioritizedTypes) { String[] typeNames = new String[prioritizedTypes.length]; for (int i = 0; i < prioritizedTypes.length; i++) { if (!TOP.class.isAssignableFrom(prioritizedTypes[i])) { throw new IllegalArgumentException("[" + prioritizedTypes[i] + "] is not a JCas type"); } String typeName = prioritizedTypes[i].getName(); if (typeName.startsWith(UIMA_BUILTIN_JCAS_PREFIX)) { typeName = "uima." + typeName.substring(UIMA_BUILTIN_JCAS_PREFIX.length()); } typeNames[i] = typeName; } return createTypePriorities(typeNames); } private  TypePrioritiesFactory(); }
TypePrioritiesFactory { @SafeVarargs public static TypePriorities createTypePriorities(Class<? extends TOP>... prioritizedTypes) { String[] typeNames = new String[prioritizedTypes.length]; for (int i = 0; i < prioritizedTypes.length; i++) { if (!TOP.class.isAssignableFrom(prioritizedTypes[i])) { throw new IllegalArgumentException("[" + prioritizedTypes[i] + "] is not a JCas type"); } String typeName = prioritizedTypes[i].getName(); if (typeName.startsWith(UIMA_BUILTIN_JCAS_PREFIX)) { typeName = "uima." + typeName.substring(UIMA_BUILTIN_JCAS_PREFIX.length()); } typeNames[i] = typeName; } return createTypePriorities(typeNames); } private  TypePrioritiesFactory(); @SafeVarargs static TypePriorities createTypePriorities(Class<? extends TOP>... prioritizedTypes); static TypePriorities createTypePriorities(String... prioritizedTypeNames); static TypePriorities createTypePriorities(); static String[] scanTypePrioritiesDescriptors(); static void forceTypePrioritiesDescriptorsScan(); }
TypePrioritiesFactory { @SafeVarargs public static TypePriorities createTypePriorities(Class<? extends TOP>... prioritizedTypes) { String[] typeNames = new String[prioritizedTypes.length]; for (int i = 0; i < prioritizedTypes.length; i++) { if (!TOP.class.isAssignableFrom(prioritizedTypes[i])) { throw new IllegalArgumentException("[" + prioritizedTypes[i] + "] is not a JCas type"); } String typeName = prioritizedTypes[i].getName(); if (typeName.startsWith(UIMA_BUILTIN_JCAS_PREFIX)) { typeName = "uima." + typeName.substring(UIMA_BUILTIN_JCAS_PREFIX.length()); } typeNames[i] = typeName; } return createTypePriorities(typeNames); } private  TypePrioritiesFactory(); @SafeVarargs static TypePriorities createTypePriorities(Class<? extends TOP>... prioritizedTypes); static TypePriorities createTypePriorities(String... prioritizedTypeNames); static TypePriorities createTypePriorities(); static String[] scanTypePrioritiesDescriptors(); static void forceTypePrioritiesDescriptorsScan();  }