@Test(expected = IllegalArgumentException.class) public void testGetNonAnnotationType() { String text = "Rot wood cheeses dew?"; tokenBuilder.buildTokens(jCas, text); CAS cas = jCas.getCas(); getAnnotationType(cas, TOP.class); }
public static Type getAnnotationType(CAS aCas, Class<?> aJCasClass) { final Type type = getType(aCas, aJCasClass); if (!aCas.getTypeSystem().subsumes(aCas.getAnnotationType(), type)) { throw new IllegalArgumentException("Type [" + aJCasClass.getName() + "] is not an annotation type"); } return type; }
CasUtil { public static Type getAnnotationType(CAS aCas, Class<?> aJCasClass) { final Type type = getType(aCas, aJCasClass); if (!aCas.getTypeSystem().subsumes(aCas.getAnnotationType(), type)) { throw new IllegalArgumentException("Type [" + aJCasClass.getName() + "] is not an annotation type"); } return type; } }
CasUtil { public static Type getAnnotationType(CAS aCas, Class<?> aJCasClass) { final Type type = getType(aCas, aJCasClass); if (!aCas.getTypeSystem().subsumes(aCas.getAnnotationType(), type)) { throw new IllegalArgumentException("Type [" + aJCasClass.getName() + "] is not an annotation type"); } return type; } private  CasUtil(); }
CasUtil { public static Type getAnnotationType(CAS aCas, Class<?> aJCasClass) { final Type type = getType(aCas, aJCasClass); if (!aCas.getTypeSystem().subsumes(aCas.getAnnotationType(), type)) { throw new IllegalArgumentException("Type [" + aJCasClass.getName() + "] is not an annotation type"); } return type; } private  CasUtil(); @Deprecated @SuppressWarnings("unchecked") static Iterator<T> iteratorFS(CAS cas, Type type); @SuppressWarnings("unchecked") static Iterator<T> iterator(CAS cas, Type type); static Type getType(CAS cas, Class<?> type); static Type getType(CAS aCas, String aTypename); static Type getAnnotationType(CAS aCas, Class<?> aJCasClass); static Type getAnnotationType(CAS aCas, String aTypeName); static List<FeatureStructure> selectFS(ArrayFS array, Type type); @SuppressWarnings({ "unchecked", "rawtypes" }) static List<AnnotationFS> select(ArrayFS array, Type type); static Collection<FeatureStructure> selectAllFS(final CAS aCas); @SuppressWarnings("unchecked") @Deprecated static List<T> selectFS(final CAS cas, final Type type); static Collection<AnnotationFS> selectAll(final CAS aCas); @SuppressWarnings({ "unchecked", "rawtypes" }) static Collection<AnnotationFS> select(final CAS cas, final Type type); static List<AnnotationFS> selectAt(final CAS aCas, final Type aType, int aBegin, int aEnd); static AnnotationFS selectSingleAt(final CAS aCas, final Type aType, int aBegin, int aEnd); static List<AnnotationFS> selectBetween(final Type type, final AnnotationFS ann1,
          final AnnotationFS ann2); static List<AnnotationFS> selectBetween(final CAS cas, final Type type,
          final AnnotationFS ann1, final AnnotationFS ann2); static List<AnnotationFS> selectCovered(Type type, AnnotationFS coveringAnnotation); static List<AnnotationFS> selectCovered(CAS cas, Type type, AnnotationFS coveringAnnotation); static List<AnnotationFS> selectCovered(CAS cas, Type type, int begin, int end); static List<AnnotationFS> selectCovering(Type type, AnnotationFS coveredAnnotation); static List<AnnotationFS> selectCovering(CAS cas, Type type, AnnotationFS coveredAnnotation); static List<AnnotationFS> selectCovering(CAS cas, Type type, int begin, int end); static Map<AnnotationFS, List<AnnotationFS>> indexCovering(CAS cas, Type type,
          Type coveringType); static Map<AnnotationFS, List<AnnotationFS>> indexCovered(CAS cas, Type type,
          Type coveredType); static AnnotationFS selectByIndex(CAS cas, Type type, int index); static AnnotationFS selectSingle(CAS cas, Type type); static FeatureStructure selectSingleFS(CAS cas, Type type); static AnnotationFS selectSingleRelative(Type type, AnnotationFS annotation, int index); static AnnotationFS selectSingleRelative(CAS cas, Type type, AnnotationFS aAnchor,
          int aPosition); static List<AnnotationFS> selectPreceding(CAS cas, Type type, AnnotationFS annotation,
          int count); static List<AnnotationFS> selectFollowing(CAS cas, Type type, AnnotationFS annotation,
          int count); static boolean exists(CAS aCas, Type aType); static CAS getView(CAS cas, String viewName, CAS fallback); static CAS getView(CAS cas, String viewName, boolean create); static List<String> toText(Iterable<T> iterable); static List<String> toText(Iterator<T> iterator); }
CasUtil { public static Type getAnnotationType(CAS aCas, Class<?> aJCasClass) { final Type type = getType(aCas, aJCasClass); if (!aCas.getTypeSystem().subsumes(aCas.getAnnotationType(), type)) { throw new IllegalArgumentException("Type [" + aJCasClass.getName() + "] is not an annotation type"); } return type; } private  CasUtil(); @Deprecated @SuppressWarnings("unchecked") static Iterator<T> iteratorFS(CAS cas, Type type); @SuppressWarnings("unchecked") static Iterator<T> iterator(CAS cas, Type type); static Type getType(CAS cas, Class<?> type); static Type getType(CAS aCas, String aTypename); static Type getAnnotationType(CAS aCas, Class<?> aJCasClass); static Type getAnnotationType(CAS aCas, String aTypeName); static List<FeatureStructure> selectFS(ArrayFS array, Type type); @SuppressWarnings({ "unchecked", "rawtypes" }) static List<AnnotationFS> select(ArrayFS array, Type type); static Collection<FeatureStructure> selectAllFS(final CAS aCas); @SuppressWarnings("unchecked") @Deprecated static List<T> selectFS(final CAS cas, final Type type); static Collection<AnnotationFS> selectAll(final CAS aCas); @SuppressWarnings({ "unchecked", "rawtypes" }) static Collection<AnnotationFS> select(final CAS cas, final Type type); static List<AnnotationFS> selectAt(final CAS aCas, final Type aType, int aBegin, int aEnd); static AnnotationFS selectSingleAt(final CAS aCas, final Type aType, int aBegin, int aEnd); static List<AnnotationFS> selectBetween(final Type type, final AnnotationFS ann1,
          final AnnotationFS ann2); static List<AnnotationFS> selectBetween(final CAS cas, final Type type,
          final AnnotationFS ann1, final AnnotationFS ann2); static List<AnnotationFS> selectCovered(Type type, AnnotationFS coveringAnnotation); static List<AnnotationFS> selectCovered(CAS cas, Type type, AnnotationFS coveringAnnotation); static List<AnnotationFS> selectCovered(CAS cas, Type type, int begin, int end); static List<AnnotationFS> selectCovering(Type type, AnnotationFS coveredAnnotation); static List<AnnotationFS> selectCovering(CAS cas, Type type, AnnotationFS coveredAnnotation); static List<AnnotationFS> selectCovering(CAS cas, Type type, int begin, int end); static Map<AnnotationFS, List<AnnotationFS>> indexCovering(CAS cas, Type type,
          Type coveringType); static Map<AnnotationFS, List<AnnotationFS>> indexCovered(CAS cas, Type type,
          Type coveredType); static AnnotationFS selectByIndex(CAS cas, Type type, int index); static AnnotationFS selectSingle(CAS cas, Type type); static FeatureStructure selectSingleFS(CAS cas, Type type); static AnnotationFS selectSingleRelative(Type type, AnnotationFS annotation, int index); static AnnotationFS selectSingleRelative(CAS cas, Type type, AnnotationFS aAnchor,
          int aPosition); static List<AnnotationFS> selectPreceding(CAS cas, Type type, AnnotationFS annotation,
          int count); static List<AnnotationFS> selectFollowing(CAS cas, Type type, AnnotationFS annotation,
          int count); static boolean exists(CAS aCas, Type aType); static CAS getView(CAS cas, String viewName, CAS fallback); static CAS getView(CAS cas, String viewName, boolean create); static List<String> toText(Iterable<T> iterable); static List<String> toText(Iterator<T> iterator); static final String UIMA_BUILTIN_JCAS_PREFIX; }