DocumentMetaData extends DocumentAnnotation { public static DocumentMetaData create(final CAS aCas) throws IllegalStateException, CASException { try { get(aCas); throw new IllegalStateException("CAS already contains DocumentMetaData"); } catch (IllegalArgumentException e) { DocumentMetaData docMetaData = new DocumentMetaData(aCas.getJCas()); initDocumentMetaData(docMetaData); return docMetaData; } } 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 public void doubleInitTest() throws Exception { String documentText = "initialized"; String documentLanguage = "en"; JCas jcas = JCasFactory.createJCas(); jcas.setDocumentText(documentText); jcas.setDocumentLanguage(documentLanguage); DocumentAnnotation documentAnnotation = selectSingle(jcas, DocumentAnnotation.class); assertEquals(0, documentAnnotation.getBegin()); assertEquals(documentText.length(), documentAnnotation.getEnd()); assertEquals(documentLanguage, documentAnnotation.getLanguage()); DocumentMetaData meta = DocumentMetaData.create(jcas); assertTrue(meta == jcas.getDocumentAnnotationFs()); assertEquals(0, meta.getBegin()); assertEquals(documentText.length(), meta.getEnd()); assertEquals(documentLanguage, meta.getLanguage()); documentAnnotation = selectSingle(jcas, DocumentAnnotation.class); }