public final class JCasFactory extends Object
JCas
objects.Modifier and Type | Method and Description |
---|---|
static org.apache.uima.jcas.JCas |
createJCas()
Creates a new
JCas . |
static org.apache.uima.jcas.JCas |
createJCas(String... typeSystemDescriptorNames)
Creates a new JCas from type system descriptor files found by name.
|
static org.apache.uima.jcas.JCas |
createJCas(String fileName,
org.apache.uima.resource.metadata.TypeSystemDescription typeSystemDescription)
This method creates a new JCas and loads the contents of an XMI or XCAS file into it.
|
static org.apache.uima.jcas.JCas |
createJCas(org.apache.uima.resource.metadata.TypeSystemDescription typeSystemDescription)
Create a new JCas for the given type system description.
|
static org.apache.uima.jcas.JCas |
createJCasFromPath(String... typeSystemDescriptorPaths)
Creates a new JCas from type system descriptor files.
|
static org.apache.uima.jcas.JCas |
createText(String aText)
Creates a new JCas with the given text.
|
static org.apache.uima.jcas.JCas |
createText(String aText,
String aLanguage)
Creates a new JCas with the given text and language.
|
public static org.apache.uima.jcas.JCas createText(String aText) throws org.apache.uima.resource.ResourceInitializationException, org.apache.uima.cas.CASException
TypeSystemDescriptionFactory.createTypeSystemDescription()
. Type priorities are
detected automatically using TypePrioritiesFactory.createTypePriorities()
. Indexes are
detected automatically using FsIndexFactory.createFsIndexCollection()
.aText
- the document text to be set in the new JCas.org.apache.uima.resource.ResourceInitializationException
- if the CAS could not be initializedorg.apache.uima.cas.CASException
- if the JCas could not be initializedpublic static org.apache.uima.jcas.JCas createText(String aText, String aLanguage) throws org.apache.uima.resource.ResourceInitializationException, org.apache.uima.cas.CASException
TypeSystemDescriptionFactory.createTypeSystemDescription()
. Type priorities are
detected automatically using TypePrioritiesFactory.createTypePriorities()
. Indexes are
detected automatically using FsIndexFactory.createFsIndexCollection()
.aText
- the document text to be set in the new JCas.aLanguage
- the document language to be set in the new JCas.org.apache.uima.resource.ResourceInitializationException
- if the CAS could not be initializedorg.apache.uima.cas.CASException
- if the JCas could not be initializedpublic static org.apache.uima.jcas.JCas createJCas() throws org.apache.uima.resource.ResourceInitializationException, org.apache.uima.cas.CASException
JCas
. The type system is detected automatically using
TypeSystemDescriptionFactory.createTypeSystemDescription()
. Type priorities are
detected automatically using TypePrioritiesFactory.createTypePriorities()
. Indexes are
detected automatically using FsIndexFactory.createFsIndexCollection()
.org.apache.uima.resource.ResourceInitializationException
- if the CAS could not be initializedorg.apache.uima.cas.CASException
- if the JCas could not be initializedpublic static org.apache.uima.jcas.JCas createJCas(String... typeSystemDescriptorNames) throws org.apache.uima.resource.ResourceInitializationException, org.apache.uima.cas.CASException
typeSystemDescriptorNames
- names of the type system descriptors on the classpath used to initialize the JCas (in
Java notation, e.g. "my.package.TypeSystem" without the ".xml" extension)org.apache.uima.resource.ResourceInitializationException
- if the CAS could not be initializedorg.apache.uima.cas.CASException
- if the JCas could not be initializedpublic static org.apache.uima.jcas.JCas createJCasFromPath(String... typeSystemDescriptorPaths) throws org.apache.uima.resource.ResourceInitializationException, org.apache.uima.cas.CASException
typeSystemDescriptorPaths
- paths to type system descriptor filesorg.apache.uima.resource.ResourceInitializationException
- if the CAS could not be initializedorg.apache.uima.cas.CASException
- if the JCas could not be initializedpublic static org.apache.uima.jcas.JCas createJCas(org.apache.uima.resource.metadata.TypeSystemDescription typeSystemDescription) throws org.apache.uima.resource.ResourceInitializationException, org.apache.uima.cas.CASException
typeSystemDescription
- a type system description to initialize the JCasorg.apache.uima.resource.ResourceInitializationException
- if the CAS could not be initializedorg.apache.uima.cas.CASException
- if the JCas could not be initializedpublic static org.apache.uima.jcas.JCas createJCas(String fileName, org.apache.uima.resource.metadata.TypeSystemDescription typeSystemDescription) throws org.apache.uima.resource.ResourceInitializationException, org.apache.uima.cas.CASException, IOException
fileName
- a file name for the serialized CAS datatypeSystemDescription
- a type system description to initialize the JCasorg.apache.uima.resource.ResourceInitializationException
- if the CAS could not be initializedorg.apache.uima.cas.CASException
- if the JCas could not be initializedIOException
- if there is a problem reading the fileCopyright © 2012–2022 The Apache Software Foundation. All rights reserved.