DocumentMetaData extends DocumentAnnotation { public static DocumentMetaData get(final CAS aCas) { FSIterator<FeatureStructure> iterator = aCas.getIndexRepository().getAllIndexedFS( CasUtil.getType(aCas, DocumentMetaData.class)); if (!iterator.hasNext()) { throw new IllegalArgumentException(new Throwable("CAS does not contain any " + DocumentMetaData.class.getName())); } DocumentMetaData result = (DocumentMetaData) iterator.next(); if (iterator.hasNext()) { throw new IllegalArgumentException(new Throwable("CAS contains more than one " + DocumentMetaData.class.getName())); } return result; } protected  DocumentMetaData();  DocumentMetaData(TypeImpl type, CASImpl casImpl);  DocumentMetaData(JCas jcas);  DocumentMetaData(JCas jcas, int begin, int end); @Override int getTypeIndexID(); String getDocumentTitle(); void setDocumentTitle(String v); String getDocumentId(); void setDocumentId(String v); String getDocumentUri(); void setDocumentUri(String v); String getCollectionId(); void setCollectionId(String v); String getDocumentBaseUri(); void setDocumentBaseUri(String v); boolean getIsLastSegment(); void setIsLastSegment(boolean v); static DocumentMetaData create(final CAS aCas); static DocumentMetaData create(final JCas aJcas); static void copy(final JCas aSourceView, final JCas aTargetView); static DocumentMetaData get(final CAS aCas); static DocumentMetaData get(final JCas aJCas); @SuppressWarnings ("hiding")
  final static String _TypeName; @SuppressWarnings ("hiding")
  final static int typeIndexID; @SuppressWarnings ("hiding")
  final static int type; final static String _FeatName_documentTitle; final static String _FeatName_documentId; final static String _FeatName_documentUri; final static String _FeatName_collectionId; final static String _FeatName_documentBaseUri; final static String _FeatName_isLastSegment; }
@Test(expected = IllegalArgumentException.class) public void noAnnotationTest() throws Exception { JCas jcas = JCasFactory.createJCas(); DocumentMetaData.get(jcas); }
@Test(expected = IllegalArgumentException.class) public void tooManyAnnotationsTest2() throws Exception { JCas jcas = JCasFactory.createJCas(); jcas.setDocumentText("initialized"); jcas.getDocumentAnnotationFs().addToIndexes(); DocumentMetaData.get(jcas); }